From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: Joe Perches <joe@perches.com>, Jens Axboe <axboe@kernel.dk>,
Fabian Frederick <fabf@skynet.be>
Subject: [PATCH v2 09/10 linux-next] cdrom: remove unnecessary status
Date: Mon, 10 Nov 2014 21:21:54 +0100 [thread overview]
Message-ID: <1415650916-9975-10-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1415650916-9975-1-git-send-email-fabf@skynet.be>
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@skynet.be>
---
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
next prev parent reply other threads:[~2014-11-10 20:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-10 20:21 [PATCH v2 00/10 linux-next] cdrom: sysctl export + clean-up Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 01/10 linux-next] cdrom: include linux/uaccess.h instead of asm/uaccess.h Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 02/10 linux-next] cdrom: use static const char * const where possible Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 03/10 linux-next] cdrom: fix spaces required errors Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 04/10 linux-next] cdrom: move EXPORT_SYMBOL after functions Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 05/10 linux-next] cdrom: remove bool comparison/assignment to 0/1 Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 06/10 linux-next] cdrom: use bool for true/false initialized variable Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 07/10 linux-next] cdrom: export sysctl code Fabian Frederick
2014-11-10 20:21 ` [PATCH v2 08/10 linux-next] cdrom: fix init_cdrom_command in dvd_do_auth Fabian Frederick
2014-11-10 20:21 ` Fabian Frederick [this message]
2014-11-10 20:24 ` [PATCH v2 10/10 linux-next] cdrom: uniformize lba command initialization Fabian Frederick
2014-11-10 20:54 ` [PATCH v2 00/10 linux-next] cdrom: sysctl export + clean-up Joe Perches
2014-11-10 22:21 ` Jens Axboe
2014-11-10 22:24 ` Joe Perches
2014-11-10 22:20 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1415650916-9975-10-git-send-email-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=axboe@kernel.dk \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®