LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Borislav Petkov <petkovbb@googlemail.com>
To: <bzolnier@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Borislav Petkov <petkovbb@gmail.com>
Subject: [PATCH 5/5] ide-cd: fix remaining checkpatch.pl issues
Date: Wed, 27 Feb 2008 19:20:49 +0100	[thread overview]
Message-ID: <1204136449-9490-6-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1204136449-9490-1-git-send-email-petkovbb@gmail.com>

Some of them are:
WARNING: braces {} are not necessary for single statement blocks
CHECK: multiple assignments should be avoided
WARNING: printk() should include KERN_ facility level
WARNING: no space between function name and open parenthesis '('

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
 drivers/ide/ide-cd.c |   46 ++++++++++++++++++++++------------------------
 1 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 84415cd..30cf097 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -136,8 +136,7 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq,
 	return log;
 }
 
-static
-void cdrom_analyze_sense_data(ide_drive_t *drive,
+static void cdrom_analyze_sense_data(ide_drive_t *drive,
 			      struct request *failed_command,
 			      struct request_sense *sense)
 {
@@ -186,9 +185,9 @@ void cdrom_analyze_sense_data(ide_drive_t *drive,
 			if (valid < 0)
 				valid = 0;
 			if (sector < get_capacity(info->disk) &&
-				drive->probed_capacity - sector < 4 * 75) {
+				drive->probed_capacity - sector < 4 * 75)
+
 				set_capacity(info->disk, sector);
-			}
 		}
 	}
 
@@ -219,7 +218,8 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
 
 	rq->data = sense;
 	rq->cmd[0] = GPCMD_REQUEST_SENSE;
-	rq->cmd[4] = rq->data_len = 18;
+	rq->cmd[4]   = 18;
+	rq->data_len = 18;
 
 	rq->cmd_type = REQ_TYPE_SENSE;
 
@@ -310,7 +310,8 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 	sense_key = err >> 4;
 
 	if (rq == NULL) {
-		printk("%s: missing rq in cdrom_decode_status\n", drive->name);
+		printk(KERN_ERR "%s: missing rq in cdrom_decode_status\n",
+			drive->name);
 		return 1;
 	}
 
@@ -379,7 +380,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 				cdrom_saw_media_change(drive);
 
 				/* fail the request. */
-				printk("%s: tray open\n", drive->name);
+				printk(KERN_ERR "%s: tray open\n", drive->name);
 				do_end_request = 1;
 			} else {
 				struct cdrom_info *info = drive->driver_data;
@@ -411,7 +412,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 			}
 		} else if (sense_key == UNIT_ATTENTION) {
 			/* media change. */
-			cdrom_saw_media_change (drive);
+			cdrom_saw_media_change(drive);
 
 			/*
 			 * Arrange to retry the request but be sure to give up
@@ -780,11 +781,10 @@ static ide_startstop_t cdrom_seek_intr(ide_drive_t *drive)
 
 	info->cd_flags |= IDE_CD_FLAG_SEEKING;
 
-	if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER)) {
-		if (--retry == 0) {
-				drive->dsc_overlap = 0;
-		}
-	}
+	if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER))
+		if (--retry == 0)
+			drive->dsc_overlap = 0;
+
 	return ide_stopped;
 }
 
@@ -1216,8 +1216,8 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
 /*
  * cdrom driver request routine.
  */
-static ide_startstop_t
-ide_do_rw_cdrom(ide_drive_t *drive, struct request *rq, sector_t block)
+static ide_startstop_t ide_do_rw_cdrom(ide_drive_t *drive, struct request *rq,
+					sector_t block)
 {
 	ide_startstop_t action;
 	struct cdrom_info *info = drive->driver_data;
@@ -1275,8 +1275,7 @@ ide_do_rw_cdrom(ide_drive_t *drive, struct request *rq, sector_t block)
  * subsequent request sense command. The pointer can also be NULL, in which case
  * no sense information is returned.
  */
-static
-void msf_from_bcd(struct atapi_msf *msf)
+static void msf_from_bcd(struct atapi_msf *msf)
 {
 	msf->minute = BCD2BIN(msf->minute);
 	msf->second = BCD2BIN(msf->second);
@@ -1491,7 +1490,8 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
 
 		toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
 	} else {
-		ms_tmp.hdr.first_track = ms_tmp.hdr.last_track = CDROM_LEADOUT;
+		ms_tmp.hdr.last_track = CDROM_LEADOUT;
+		ms_tmp.hdr.first_track = ms_tmp.hdr.last_track;
 		toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */
 	}
 
@@ -1605,8 +1605,7 @@ static int ide_cdrom_register(ide_drive_t *drive, int nslots)
 	return register_cdrom(devinfo);
 }
 
-static
-int ide_cdrom_probe_capabilities(ide_drive_t *drive)
+static int ide_cdrom_probe_capabilities(ide_drive_t *drive)
 {
 	struct cdrom_info *cd = drive->driver_data;
 	struct cdrom_device_info *cdi = &cd->devinfo;
@@ -1796,8 +1795,8 @@ static sector_t ide_cdrom_capacity(ide_drive_t *drive)
 	return capacity * sectors_per_frame;
 }
 
-static int proc_idecd_read_capacity
-	(char *page, char **start, off_t off, int count, int *eof, void *data)
+static int proc_idecd_read_capacity(char *page, char **start, off_t off,
+					int count, int *eof, void *data)
 {
 	ide_drive_t *drive = data;
 	int len;
@@ -1877,8 +1876,7 @@ static unsigned int ide_cd_flags(struct hd_driveid *id)
 	return 0;
 }
 
-static
-int ide_cdrom_setup(ide_drive_t *drive)
+static int ide_cdrom_setup(ide_drive_t *drive)
 {
 	struct cdrom_info *cd = drive->driver_data;
 	struct cdrom_device_info *cdi = &cd->devinfo;
-- 
1.5.4.1


  parent reply	other threads:[~2008-02-27 18:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 18:20 [PATCH 0/5] ide-cd: trivial fixes Borislav Petkov
2008-02-27 18:20 ` [PATCH 1/5] ide-cd: include proper headers Borislav Petkov
2008-02-27 18:20 ` [PATCH 2/5] ide-cd: put all proc-related code at one place Borislav Petkov
2008-02-27 18:20 ` [PATCH 3/5] ide-cd: fixup comments Borislav Petkov
2008-02-27 21:18   ` Bartlomiej Zolnierkiewicz
2008-02-27 18:20 ` [PATCH 4/5] ide-cd: shorten lines longer than 80 columns Borislav Petkov
2008-02-27 21:18   ` Bartlomiej Zolnierkiewicz
2008-02-27 22:15     ` Borislav Petkov
2008-02-27 23:01       ` Bartlomiej Zolnierkiewicz
2008-02-27 23:15         ` Bartlomiej Zolnierkiewicz
2008-02-28  6:16         ` Borislav Petkov
2008-02-27 18:20 ` Borislav Petkov [this message]
2008-02-27 21:18   ` [PATCH 5/5] ide-cd: fix remaining checkpatch.pl issues Bartlomiej Zolnierkiewicz
2008-02-27 21:18 ` [PATCH 0/5] ide-cd: trivial fixes Bartlomiej Zolnierkiewicz
2008-02-27 22:18   ` Borislav Petkov
2008-02-27 22:48     ` Bartlomiej Zolnierkiewicz
2008-02-28  5:52       ` Borislav Petkov

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=1204136449-9490-6-git-send-email-petkovbb@gmail.com \
    --to=petkovbb@googlemail.com \
    --cc=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petkovbb@gmail.com \
    --subject='Re: [PATCH 5/5] ide-cd: fix remaining checkpatch.pl issues' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).