Skip to content

Commit 257ca14

Browse files
ColinIanKingingomolnar
authored andcommitted
x86/boot: Remove redundant initialization of the 'delta' variable in strcmp()
The 'delta' variable is zero-initialized, but never read before the real initialization happens. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20231219141304.367200-1-colin.i.king@gmail.com
1 parent 78a509f commit 257ca14

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/boot/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int strcmp(const char *str1, const char *str2)
4949
{
5050
const unsigned char *s1 = (const unsigned char *)str1;
5151
const unsigned char *s2 = (const unsigned char *)str2;
52-
int delta = 0;
52+
int delta;
5353

5454
while (*s1 || *s2) {
5555
delta = *s1 - *s2;

0 commit comments

Comments
 (0)