Skip to content

Commit 7afa81c

Browse files
nathanchancedavem330
authored andcommitted
isdn: avm: Fix string plus integer warning from Clang
A recent commit in Clang expanded the -Wstring-plus-int warning, showing some odd behavior in this file. drivers/isdn/hardware/avm/b1.c:426:30: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] cinfo->version[j] = "\0\0" + 1; ~~~~~~~^~~ drivers/isdn/hardware/avm/b1.c:426:30: note: use array indexing to silence this warning cinfo->version[j] = "\0\0" + 1; ^ & [ ] 1 warning generated. This is equivalent to just "\0". Nick pointed out that it is smarter to use "" instead of "\0" because "" is used elsewhere in the kernel and can be deduplicated at the linking stage. Link: ClangBuiltLinux#309 Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8a7fa0c commit 7afa81c

File tree

1 file changed

+1
-1
lines changed
  • drivers/isdn/hardware/avm

1 file changed

+1
-1
lines changed

drivers/isdn/hardware/avm/b1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo)
423423
int i, j;
424424

425425
for (j = 0; j < AVM_MAXVERSION; j++)
426-
cinfo->version[j] = "\0\0" + 1;
426+
cinfo->version[j] = "";
427427
for (i = 0, j = 0;
428428
j < AVM_MAXVERSION && i < cinfo->versionlen;
429429
j++, i += cinfo->versionbuf[i] + 1)

0 commit comments

Comments
 (0)