Skip to contentSkip to conversation

scsi: aic7xxx: Fix compiler warnings triggered by user space code

PATCH Applied Bart Van Assche 2 participants 3 messages Apr 2 – Apr 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: aic7xxx: Fix compiler warnings triggered by user space code

Fix the following compiler warnings:

aicasm_gram.y:1107:24: warning: comparison of different enumeration types
('scope_type' and 'enum yytokentype') [-Wenum-compare]

 1107 |                  || last_scope->type == T_ELSE) {
      |                     ~~~~~~~~~~~~~~~~ ^  ~~~~~~

aicasm_scan.l:392:14: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
392 | while (c = *yptr++) {
| ~~^~~~~~~~~
aicasm_macro_scan.l:153:1: warning: non-void function does not return a value

      [-Wreturn-type]
  153 | }
      | ^
---
 drivers/scsi/aic7xxx/aicasm/aicasm.h      | 2 +-
 drivers/scsi/aic7xxx/aicasm/aicasm_gram.y | 2 +-
 drivers/scsi/aic7xxx/aicasm/aicasm_scan.l | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/aic7xxx/aicasm/aicasm.h +1 -1
index 716a2aefc925..f290b50c6475 100644
@@ -82,7 +82,7 @@ extern int   src_mode;
 extern int   dst_mode;
 struct symbol;
 
-void stop(const char *errstring, int err_code);
+void __attribute__((noreturn)) stop(const char *errstring, int err_code);
 void include_file(char *file_name, include_type type);
 void expand_macro(struct symbol *macro_symbol);
 struct instruction *seq_alloc(void);
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y +1 -1
index b1c9ce477cbd..f6dbb9855daa 100644
@@ -1104,7 +1104,7 @@ conditional:
 		last_scope = TAILQ_LAST(&scope_context->inner_scope,
 					scope_tailq);
 		if (last_scope == NULL
-		 || last_scope->type == T_ELSE) {
+		 || last_scope->type == (int)T_ELSE) {
 
 			stop("'else if' without leading 'if'", EX_DATAERR);
 			/* NOTREACHED */
drivers/scsi/aic7xxx/aicasm/aicasm_scan.l +1 -1
index fc7e6c58148d..c0d92cf5f9b5 100644
@@ -389,7 +389,7 @@ nop			{ return T_NOP; }
 				char c;
 
 				yptr = yytext;
-				while (c = *yptr++) {
+				while ((c = *yptr++)) {
 					/*
 					 * Strip carriage returns.
 					 */
#1 lore raw

Bart,

Quoted 1 line

Fix the following compiler warnings:

Applied to 7.1/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen
#2 lore raw
In reply to Bart Van Assche
Quoted 11 lines · Bart Van Assche

Fix the following compiler warnings:

aicasm_gram.y:1107:24: warning: comparison of different enumeration types
('scope_type' and 'enum yytokentype') [-Wenum-compare]

 1107 |                  || last_scope->type == T_ELSE) {
      |                     ~~~~~~~~~~~~~~~~ ^  ~~~~~~

aicasm_scan.l:392:14: warning: using the result of an assignment as a condition
without parentheses [-Wparentheses]
392 | while (c = *yptr++) {
| ~~^~~~~~~~~
aicasm_macro_scan.l:153:1: warning: non-void function does not return a value

Quoted 5 lines
      [-Wreturn-type]
  153 | }
      | ^

[...]

Applied to 7.1/scsi-queue, thanks!

[1/1] scsi: aic7xxx: Fix compiler warnings triggered by user space code

      https://git.kernel.org/mkp/scsi/c/1821f77fdaec
Signature · 1 line
Martin K. Petersen