public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Hannes Reinecke <hare@suse.com>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Subject: [PATCH] scsi: aic7xxx: Fix compiler warnings triggered by user space code
Date: Thu,  2 Apr 2026 08:33:33 -0700	[thread overview]
Message-ID: <20260402153341.2909184-1-bvanassche@acm.org> (raw)

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 | }
      | ^

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 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(-)

diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.h b/drivers/scsi/aic7xxx/aicasm/aicasm.h
index 716a2aefc925..f290b50c6475 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm.h
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm.h
@@ -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);
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
index b1c9ce477cbd..f6dbb9855daa 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
@@ -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 */
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
index fc7e6c58148d..c0d92cf5f9b5 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
@@ -389,7 +389,7 @@ nop			{ return T_NOP; }
 				char c;
 
 				yptr = yytext;
-				while (c = *yptr++) {
+				while ((c = *yptr++)) {
 					/*
 					 * Strip carriage returns.
 					 */

             reply	other threads:[~2026-04-02 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 15:33 Bart Van Assche [this message]
2026-04-03  1:18 ` [PATCH] scsi: aic7xxx: Fix compiler warnings triggered by user space code Martin K. Petersen
2026-04-09  2:42 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260402153341.2909184-1-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox