Skip to content

Commit 6d074ce

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: stex: Fix gcc 13 warnings
gcc 13 may assign another type to enumeration constants than gcc 12. Split the large enum at the top of source file stex.c such that the type of the constants used in time expressions is changed back to the same type chosen by gcc 12. This patch suppresses compiler warnings like this one: In file included from ./include/linux/bitops.h:7, from ./include/linux/kernel.h:22, from drivers/scsi/stex.c:13: drivers/scsi/stex.c: In function ‘stex_common_handshake’: ./include/linux/typecheck.h:12:25: error: comparison of distinct pointer types lacks a cast [-Werror] 12 | (void)(&__dummy == &__dummy2); \ | ^~ ./include/linux/jiffies.h:106:10: note: in expansion of macro ‘typecheck’ 106 | typecheck(unsigned long, b) && \ | ^~~~~~~~~ drivers/scsi/stex.c:1035:29: note: in expansion of macro ‘time_after’ 1035 | if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) { | ^~~~~~~~~~ See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405. Cc: stable@vger.kernel.org Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20230529195034.3077-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent d54820b commit 6d074ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/scsi/stex.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ enum {
109109
TASK_ATTRIBUTE_HEADOFQUEUE = 0x1,
110110
TASK_ATTRIBUTE_ORDERED = 0x2,
111111
TASK_ATTRIBUTE_ACA = 0x4,
112+
};
112113

114+
enum {
113115
SS_STS_NORMAL = 0x80000000,
114116
SS_STS_DONE = 0x40000000,
115117
SS_STS_HANDSHAKE = 0x20000000,
@@ -121,7 +123,9 @@ enum {
121123
SS_I2H_REQUEST_RESET = 0x2000,
122124

123125
SS_MU_OPERATIONAL = 0x80000000,
126+
};
124127

128+
enum {
125129
STEX_CDB_LENGTH = 16,
126130
STATUS_VAR_LEN = 128,
127131

0 commit comments

Comments
 (0)