[PATCH v2 09/10 linux-next] cdrom: remove unnecessary status
From: Fabian Frederick
Date: Mon Nov 10 2014 - 15:23:29 EST
cdrom_number_of_slots returns nslots and doesn't need status
variable. Just remove it and test cdrom_read_mech_status().
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
drivers/cdrom/cdrom.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index d397591..9a6fa8f 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1343,7 +1343,6 @@ out_free:
*/
int cdrom_number_of_slots(struct cdrom_device_info *cdi)
{
- int status;
int nslots = 1;
struct cdrom_changer_info *info;
@@ -1355,7 +1354,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi)
if (!info)
return -ENOMEM;
- if ((status = cdrom_read_mech_status(cdi, info)) == 0)
+ if (!cdrom_read_mech_status(cdi, info))
nslots = info->hdr.nslots;
kfree(info);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/