Thread (4 messages) 4 messages, 2 authors, 2021-06-16

Re: [PATCH -next] ide-cd: fix warning: variable 'stat' set but not used

From: libaokun (A) <hidden>
Date: 2021-06-15 02:44:29
Also in: lkml

ping

在 2021/5/29 14:17, Baokun Li 写道:
quoted hunk ↗ jump to hunk
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/ide/ide-cd_ioctl.c: In function 'ide_cdrom_select_speed':
drivers/ide/ide-cd_ioctl.c:212:6: warning:
  variable ‘stat’ set but not used [-Wunused-but-set-variable]

It never used since introduction.

Signed-off-by: Baokun Li <redacted>
---
  drivers/ide/ide-cd_ioctl.c | 2 ++
  1 file changed, 2 insertions(+)
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c
index 011eab9c69b7..8d0a52123349 100644
--- a/drivers/ide/ide-cd_ioctl.c
+++ b/drivers/ide/ide-cd_ioctl.c
@@ -231,6 +231,8 @@ int ide_cdrom_select_speed(struct cdrom_device_info *cdi, int speed)
  	}
  
  	stat = ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, NULL, 0, 0);
+	if (stat)
+		return stat;
  
  	if (!ide_cdrom_get_capabilities(drive, buf)) {
  		ide_cdrom_update_speed(drive, buf);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help