[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <E717642AF17E744CA95C070CA815AE553C75C8@cceexc23.americas.cpqcorp.net>
Date: Thu, 27 Jul 2006 13:59:44 -0500
From: "Miller, Mike (OS Dev)" <Mike.Miller@...com>
To: "Laura Garcia" <laura@...ola.be>,
"ISS StorageDev" <iss_storagedev@...com>,
"Andrew Morton" <akpm@...l.org>
Cc: <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] cciss: removes uneeded 'pos' and 'size' variables
> -----Original Message-----
> From: Laura Garcia [mailto:laura@...ola.be]
> Sent: Wednesday, July 26, 2006 12:34 PM
> To: ISS StorageDev; Andrew Morton
> Cc: linux-kernel@...r.kernel.org
> Subject: [PATCH] cciss: removes uneeded 'pos' and 'size' variables
>
>
> Signed-off-by: Laura Garcia Liebana <laura@...ola.be>
Acked-by: Mike Miller <mike.miller@...com>
>
> diff -Nru a/drivers/block/cciss.c b/drivers/block/cciss.c
> --- a/drivers/block/cciss.c 2006-07-26 10:25:16.000000000 +0200
> +++ b/drivers/block/cciss.c 2006-07-26 11:27:34.000000000 +0200
> @@ -238,9 +238,8 @@
> static int cciss_proc_get_info(char *buffer, char **start,
> off_t offset,
> int length, int *eof, void *data)
> {
> - off_t pos = 0;
> off_t len = 0;
> - int size, i, ctlr;
> + int i, ctlr;
> ctlr_info_t *h = (ctlr_info_t *) data;
> drive_info_struct *drv;
> unsigned long flags;
> @@ -259,7 +258,7 @@
> h->busy_configuring = 1;
> spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
>
> - size = sprintf(buffer, "%s: HP %s Controller\n"
> + len += sprintf(buffer, "%s: HP %s Controller\n"
> "Board ID: 0x%08lx\n"
> "Firmware Version: %c%c%c%c\n"
> "IRQ: %d\n"
> @@ -277,9 +276,7 @@
> h->num_luns, h->Qdepth, h->commands_outstanding,
> h->maxQsinceinit, h->max_outstanding, h->maxSG);
>
> - pos += size;
> - len += size;
> - cciss_proc_tape_report(ctlr, buffer, &pos, &len);
> + cciss_proc_tape_report(ctlr, buffer, &len);
> for (i = 0; i <= h->highest_lun; i++) {
>
> drv = &h->drv[i];
> @@ -293,12 +290,10 @@
>
> if (drv->raid_level > 5)
> drv->raid_level = RAID_UNKNOWN;
> - size = sprintf(buffer + len, "cciss/c%dd%d:"
> + len += sprintf(buffer + len, "cciss/c%dd%d:"
> "\t%4u.%02uGB\tRAID %s\n",
> ctlr, i, (int)vol_sz, (int)vol_sz_frac,
> raid_label[drv->raid_level]);
> - pos += size;
> - len += size;
> }
>
> *eof = 1;
> diff -Nru a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
> --- a/drivers/block/cciss_scsi.c 2006-07-15
> 23:53:08.000000000 +0200
> +++ b/drivers/block/cciss_scsi.c 2006-07-26
> 11:27:43.000000000 +0200
> @@ -1440,19 +1440,17 @@
> }
>
> static void
> -cciss_proc_tape_report(int ctlr, unsigned char *buffer,
> off_t *pos, off_t *len)
> +cciss_proc_tape_report(int ctlr, unsigned char *buffer, off_t *len)
> {
> unsigned long flags;
> - int size;
>
> - *pos = *pos -1; *len = *len - 1; // cut off the last
> trailing newline
> + *len = *len - 1; // cut off the last trailing newline
>
> CPQ_TAPE_LOCK(ctlr, flags);
> - size = sprintf(buffer + *len,
> + *len += sprintf(buffer + *len,
> "Sequential access devices: %d\n\n",
> ccissscsi[ctlr].ndevices);
> CPQ_TAPE_UNLOCK(ctlr, flags);
> - *pos += size; *len += size;
> }
>
> /* Need at least one of these error handlers to keep
> ../scsi/hosts.c from @@ -1534,6 +1532,6 @@
> #define cciss_scsi_setup(cntl_num)
> #define cciss_unregister_scsi(ctlr)
> #define cciss_register_scsi(ctlr)
> -#define cciss_proc_tape_report(ctlr, buffer, pos, len)
> +#define cciss_proc_tape_report(ctlr, buffer, len)
>
> #endif /* CONFIG_CISS_SCSI_TAPE */
>
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists