mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-24 08:56:28 -05:00
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>
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#define SCLP_HEADER "sclp: "
|
||||
|
||||
struct sclp_trace_entry {
|
||||
char id[4];
|
||||
char id[4] __nonstring;
|
||||
u32 a;
|
||||
u64 b;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user