diff mbox series

[v2,25/44] mac53c94: Fix a set-but-not-used compiler warning

Message ID 20220208172514.3481-26-bvanassche@acm.org
State Superseded
Headers show
Series Remove the SCSI pointer from struct scsi_cmnd | expand

Commit Message

Bart Van Assche Feb. 8, 2022, 5:24 p.m. UTC
Fix the following compiler warning:

   drivers/scsi/mac53c94.c: In function 'mac53c94_init':
   drivers/scsi/mac53c94.c:128:13: warning: variable 'x' set but not used [-Wunused-but-set-variable]
     128 |         int x;

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mac53c94.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Hannes Reinecke Feb. 9, 2022, 8:10 a.m. UTC | #1
On 2/8/22 18:24, Bart Van Assche wrote:
> Fix the following compiler warning:
> 
>     drivers/scsi/mac53c94.c: In function 'mac53c94_init':
>     drivers/scsi/mac53c94.c:128:13: warning: variable 'x' set but not used [-Wunused-but-set-variable]
>       128 |         int x;
> 
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   drivers/scsi/mac53c94.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
> index 3976a18f6333..afa08309de36 100644
> --- a/drivers/scsi/mac53c94.c
> +++ b/drivers/scsi/mac53c94.c
> @@ -125,7 +125,6 @@ static void mac53c94_init(struct fsc_state *state)
>   {
>   	struct mac53c94_regs __iomem *regs = state->regs;
>   	struct dbdma_regs __iomem *dma = state->dma;
> -	int x;
>   
>   	writeb(state->host->this_id | CF1_PAR_ENABLE, &regs->config1);
>   	writeb(TIMO_VAL(250), &regs->sel_timeout);	/* 250ms */
> @@ -134,7 +133,7 @@ static void mac53c94_init(struct fsc_state *state)
>   	writeb(0, &regs->config3);
>   	writeb(0, &regs->sync_period);
>   	writeb(0, &regs->sync_offset);
> -	x = readb(&regs->interrupt);
> +	(void)readb(&regs->interrupt);
>   	writel((RUN|PAUSE|FLUSH|WAKE) << 16, &dma->control);
>   }
>   
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Himanshu Madhani Feb. 9, 2022, 6:33 p.m. UTC | #2
> On Feb 8, 2022, at 9:24 AM, Bart Van Assche <bvanassche@acm.org> wrote:
> 
> Fix the following compiler warning:
> 
>   drivers/scsi/mac53c94.c: In function 'mac53c94_init':
>   drivers/scsi/mac53c94.c:128:13: warning: variable 'x' set but not used [-Wunused-but-set-variable]
>     128 |         int x;
> 
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/scsi/mac53c94.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
> index 3976a18f6333..afa08309de36 100644
> --- a/drivers/scsi/mac53c94.c
> +++ b/drivers/scsi/mac53c94.c
> @@ -125,7 +125,6 @@ static void mac53c94_init(struct fsc_state *state)
> {
> 	struct mac53c94_regs __iomem *regs = state->regs;
> 	struct dbdma_regs __iomem *dma = state->dma;
> -	int x;
> 
> 	writeb(state->host->this_id | CF1_PAR_ENABLE, &regs->config1);
> 	writeb(TIMO_VAL(250), &regs->sel_timeout);	/* 250ms */
> @@ -134,7 +133,7 @@ static void mac53c94_init(struct fsc_state *state)
> 	writeb(0, &regs->config3);
> 	writeb(0, &regs->sync_period);
> 	writeb(0, &regs->sync_offset);
> -	x = readb(&regs->interrupt);
> +	(void)readb(&regs->interrupt);
> 	writel((RUN|PAUSE|FLUSH|WAKE) << 16, &dma->control);
> }
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index 3976a18f6333..afa08309de36 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -125,7 +125,6 @@  static void mac53c94_init(struct fsc_state *state)
 {
 	struct mac53c94_regs __iomem *regs = state->regs;
 	struct dbdma_regs __iomem *dma = state->dma;
-	int x;
 
 	writeb(state->host->this_id | CF1_PAR_ENABLE, &regs->config1);
 	writeb(TIMO_VAL(250), &regs->sel_timeout);	/* 250ms */
@@ -134,7 +133,7 @@  static void mac53c94_init(struct fsc_state *state)
 	writeb(0, &regs->config3);
 	writeb(0, &regs->sync_period);
 	writeb(0, &regs->sync_offset);
-	x = readb(&regs->interrupt);
+	(void)readb(&regs->interrupt);
 	writel((RUN|PAUSE|FLUSH|WAKE) << 16, &dma->control);
 }