[PATCH] scsi: aic7xxx: Fix some build warning

From: zheng tan
Date: Fri May 31 2024 - 04:14:48 EST


From: Zheng tan <tanzheng@xxxxxxxxxx>

Fixed some warnings in compilation:

aicasm_gram.c:1562:16: warning: implicit declaration of function ‘yylex’
yychar = yylex ();

aicasm_scan.l:417:6: warning: implicit declaration of function ‘mm_switch_to_buffer’
mm_switch_to_buffer(old_state);
^~~~~~~~~~~~~~~~~~~
yy_switch_to_buffer
aicasm_scan.l:418:6: warning: implicit declaration of function ‘mmparse’
mmparse();
^~~~~~~
yyparse
aicasm_scan.l:421:6: warning: implicit declaration of function ‘mm_delete_buffer’
mm_delete_buffer(temp_state);

Reported-by: k2ci <kernel-bot@xxxxxxxxxx>
Signed-off-by: Zheng tan <tanzheng@xxxxxxxxxx>
---
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y | 2 +-
drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y | 2 +-
drivers/scsi/aic7xxx/aicasm/aicasm_scan.l | 7 ++++---
3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
index 65182ad9cdf8..ac96fb9152b6 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
@@ -103,7 +103,7 @@ static void add_version(const char *verstring);
static int is_download_const(expression_t *immed);
static int is_location_address(symbol_t *symbol);
void yyerror(const char *string);
-
+int yylex(void);
#define SRAM_SYMNAME "SRAM_BASE"
#define SCB_SYMNAME "SCB_BASE"
%}
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
index 8c0479865f04..d787b2f89007 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
@@ -62,7 +62,7 @@ static symbol_t *macro_symbol;

static void add_macro_arg(const char *argtext, int position);
void mmerror(const char *string);
-
+int mmlex(void);
%}

%union {
diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
index c78d4f68eea5..8214d7eaef1d 100644
--- a/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
+++ b/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
@@ -56,6 +56,7 @@
#include "aicasm.h"
#include "aicasm_symbol.h"
#include "aicasm_gram.h"
+#include "aicasm_macro_gram.h"

/* This is used for macro body capture too, so err on the large size. */
#define MAX_STR_CONST 4096
@@ -414,11 +415,11 @@ nop { return T_NOP; }
yy_create_buffer(stdin,
YY_BUF_SIZE);
yy_switch_to_buffer(temp_state);
- mm_switch_to_buffer(old_state);
+ yy_switch_to_buffer(old_state);
mmparse();
- mm_switch_to_buffer(temp_state);
+ yy_switch_to_buffer(temp_state);
yy_switch_to_buffer(old_state);
- mm_delete_buffer(temp_state);
+ yy_delete_buffer(temp_state);
expand_macro(yylval.sym);
} else {
if (yylval.sym->type == UNINITIALIZED) {
--
2.25.1