Message ID | 20210312105530.2219008-4-lee.jones@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Rid W=1 warnings from Block | expand |
On 3/12/21 2:55 AM, Lee Jones wrote: > Fixes the following W=1 kernel build warning(s): > > drivers/block/mtip32xx/mtip32xx.c: In function ‘mtip_standby_immediate’: > drivers/block/mtip32xx/mtip32xx.c:1216:16: warning: variable ‘start’ set but not used [-Wunused-but-set-variable] Has it been verified that the compiler is wrong, or in other words that this patch does not suppress a useful warning? Thanks, Bart.
On Tue, 06 Apr 2021, Bart Van Assche wrote: > On 3/12/21 2:55 AM, Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > > > drivers/block/mtip32xx/mtip32xx.c: In function ‘mtip_standby_immediate’: > > drivers/block/mtip32xx/mtip32xx.c:1216:16: warning: variable ‘start’ set but not used [-Wunused-but-set-variable] > > Has it been verified that the compiler is wrong, or in other words that > this patch does not suppress a useful warning? Neither is true. 'start' is used, but only when debug is enabled.
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 3be0dbc674bd0..bc485f1623361 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -1213,7 +1213,7 @@ static int mtip_standby_immediate(struct mtip_port *port) { int rv; struct host_to_dev_fis fis; - unsigned long start; + unsigned long __maybe_unused start; unsigned int timeout; /* Build the FIS. */
Fixes the following W=1 kernel build warning(s): drivers/block/mtip32xx/mtip32xx.c: In function ‘mtip_standby_immediate’: drivers/block/mtip32xx/mtip32xx.c:1216:16: warning: variable ‘start’ set but not used [-Wunused-but-set-variable] Cc: Jens Axboe <axboe@kernel.dk> Cc: linux-block@vger.kernel.org Signed-off-by: Lee Jones <lee.jones@linaro.org> --- drivers/block/mtip32xx/mtip32xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)