scst_lib: Mark devkey string as nonstring

Fix the following GCC 15 warnings:

    initializer-string for array of ‘unsigned char’ truncates NUL
    terminator but destination lacks ‘nonstring’ attribute
    (17 chars into 16 available)

This patch doesn't change any functionality.
This commit is contained in:
Gleb Chesnokov
2025-04-18 17:21:48 +03:00
parent f32f464190
commit ef37ad252c
2 changed files with 26 additions and 18 deletions

View File

@@ -419,6 +419,14 @@ static inline void be32_to_cpu_array(u32 *dst, const __be32 *src, size_t len)
#endif
#endif
/*
* See also commit 92676236917d ("Compiler Attributes: add support for
* __nonstring (gcc >= 8)") # v4.20.
*/
#ifndef __nonstring
#define __nonstring
#endif
/* <linux/debugfs.h> */
/*

View File

@@ -456,24 +456,24 @@ static int get_cdb_info_dyn_runtime_attr(struct scst_cmd *cmd,
struct scst_sdbops {
uint8_t ops; /* SCSI-2 op codes */
uint8_t devkey[16]; /* Key for every device type M,O,V,R
* type_disk devkey[0]
* type_tape devkey[1]
* type_printer devkey[2]
* type_processor devkey[3]
* type_worm devkey[4]
* type_cdrom devkey[5]
* type_scanner devkey[6]
* type_mod devkey[7]
* type_changer devkey[8]
* type_commdev devkey[9]
* type_reserv devkey[A]
* type_reserv devkey[B]
* type_raid devkey[C]
* type_enclosure devkey[D]
* type_reserv devkey[E]
* type_reserv devkey[F]
*/
uint8_t devkey[16] __nonstring; /* Key for every device type M,O,V,R
* type_disk devkey[0]
* type_tape devkey[1]
* type_printer devkey[2]
* type_processor devkey[3]
* type_worm devkey[4]
* type_cdrom devkey[5]
* type_scanner devkey[6]
* type_mod devkey[7]
* type_changer devkey[8]
* type_commdev devkey[9]
* type_reserv devkey[A]
* type_reserv devkey[B]
* type_raid devkey[C]
* type_enclosure devkey[D]
* type_reserv devkey[E]
* type_reserv devkey[F]
*/
uint8_t info_lba_off; /* LBA offset in cdb */
uint8_t info_lba_len; /* LBA length in cdb */
uint8_t info_len_off; /* length offset in cdb */