From: Boaz Harrosh <bharrosh@panasas.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Christoph Hellwig <hch@infradead.org>,
Jens Axboe <jens.axboe@oracle.com>, Jeff Garzik <jeff@garzik.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 4/24][RFC] firewire & ieee1394: Simple convert to new scsi_eh_cpy_sense.
Date: Mon, 04 Feb 2008 19:04:56 +0200 [thread overview]
Message-ID: <47A745B8.8090806@panasas.com> (raw)
In-Reply-To: <47A73F37.7090704@s5r6.in-berlin.de>
On Mon, Feb 04 2008 at 18:37 +0200, Stefan Richter <stefanr@s5r6.in-berlin.de> wrote:
> Boaz Harrosh wrote:
>> --- a/drivers/ieee1394/sbp2.c
>> +++ b/drivers/ieee1394/sbp2.c
>> @@ -1672,8 +1673,11 @@ static int sbp2_send_command(struct sbp2_lu *lu, struct scsi_cmnd *SCpnt,
>> * Translates SBP-2 status into SCSI sense data for check conditions
>> */
>> static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status,
>> - unchar *sense_data)
>> + struct scsi_cmnd *SCpnt)
>> {
>> + u8 sense_data[16];
>> +
>> + memset(sense_data, 0, sizeof(sense_data));
>> /* OK, it's pretty ugly... ;-) */
>> sense_data[0] = 0x70;
>> sense_data[1] = 0x0;
>> @@ -1691,6 +1695,7 @@ static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status,
>> sense_data[13] = sbp2_status[11];
>> sense_data[14] = sbp2_status[20];
>> sense_data[15] = sbp2_status[21];
>> + scsi_eh_cpy_sense(SCpnt, sense_data, sizeof(sense_data));
>>
>> return sbp2_status[8] & 0x3f;
>> }
>
> You don't need the memset.
>
OK I see what you mean now, they are all used. Thanks.
> Also, here and in drivers/firewire/fw-sbp2.c, the SCSI sense data could
> AFAICS be rewritten in-place in sbp2_status. But I don't know if this
> is a worthwhile optimization; it would reduce readability.
Right, it's a very unlikely code path. readability is more important
here.
I will fix both places. Maybe I can use also here what Jeff suggested in the
other mail. We'll see how it goes.
Boaz
prev parent reply other threads:[~2008-02-04 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-04 15:56 [PATCH 4/24][RFC] firewire & ieee1394: Simple convert to new scsi_eh_cpy_sense Boaz Harrosh
2008-02-04 16:37 ` Stefan Richter
2008-02-04 17:04 ` Boaz Harrosh [this message]
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=47A745B8.8090806@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hch@infradead.org \
--cc=jeff@garzik.org \
--cc=jens.axboe@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=stefanr@s5r6.in-berlin.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.