These were mainly reported by scripts/checkpatch.pl

Signed-off-by: Simao Gomes Viana <[email protected]>
---
 drivers/cdrom/cdrom.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index f1c02d4d5583..6ff8da08230c 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1093,7 +1093,7 @@ int open_for_data(struct cdrom_device_info *cdi)
 
                        /* Ok, the door should be closed now.. Check again */
                        ret = cdo->drive_status(cdi, CDSL_CURRENT);
-                       if ((ret == CDS_NO_DISC) || (ret==CDS_TRAY_OPEN)) {
+                       if (ret == CDS_NO_DISC || ret == CDS_TRAY_OPEN) {
                                cd_dbg(CD_OPEN, "bummer. the tray is still not 
closed.\n");
                                cd_dbg(CD_OPEN, "tray might not contain a 
medium\n");
                                ret = -ENOMEDIUM;
@@ -1242,8 +1242,7 @@ static int check_for_audio_disc(struct cdrom_device_info 
*cdi,
                if (ret == CDS_TRAY_OPEN) {
                        cd_dbg(CD_OPEN, "the tray is open...\n");
                        /* can/may i close it? */
-                       if (CDROM_CAN(CDC_CLOSE_TRAY) &&
-                           cdi->options & CDO_AUTO_CLOSE) {
+                       if (CDROM_CAN(CDC_CLOSE_TRAY) && cdi->options & 
CDO_AUTO_CLOSE) {
                                cd_dbg(CD_OPEN, "trying to close the tray\n");
                                ret = cdo->tray_move(cdi, 0);
                                if (ret) {
@@ -1471,11 +1470,10 @@ static int cdrom_select_disc(struct cdrom_device_info 
*cdi, int slot)
        kfree(info);
 
        if (cdi->use_count > 1 || cdi->keeplocked) {
-               if (slot == CDSL_CURRENT) {
-                       return curslot;
-               } else {
+               if (slot == CDSL_CURRENT)
+                       return curslot;
+               else
                        return -EBUSY;
-               }
        }
 
        /* Specifying CDSL_CURRENT will attempt to load the currnet slot,
@@ -3015,13 +3013,12 @@ static int cdrom_get_next_writable(struct 
cdrom_device_info *cdi,
 
 use_last_written:
        ret = cdrom_get_last_written(cdi, next_writable);
-       if (ret) {
+       if (ret)
                *next_writable = 0;
-               return ret;
-       } else {
+       else
                *next_writable += 7;
-               return 0;
-       }
+
+       return ret;
 }
 
 static noinline int mmc_ioctl_cdrom_read_data(struct cdrom_device_info *cdi,
-- 
2.27.0

Reply via email to