Skip to content

Commit ff8a58b

Browse files
committed
s390/sclp: add __nonstring annotation
Add __nonstring annotation, since the missing string termination for id member of sclp_trace_entry is intended. This way we get rid of this warning: drivers/s390/char/sclp.c:84:9: warning: ‘strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation] 84 | strncpy(e.id, id, sizeof(e.id)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent 7d66561 commit ff8a58b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/s390/char/sclp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define SCLP_HEADER "sclp: "
2929

3030
struct sclp_trace_entry {
31-
char id[4];
31+
char id[4] __nonstring;
3232
u32 a;
3333
u64 b;
3434
};

0 commit comments

Comments
 (0)