mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: Steffen Maier <maier@linux.vnet.ibm.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>,
	Linux SCSI Mailinglist <linux-scsi@vger.kernel.org>,
	Tejun Heo <tj@kernel.org>,
	Bart Van Assche <Bart.VanAssche@sandisk.com>,
	Oliver Neukum <oneukum@suse.com>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [PATCH] scsi: use set_host_byte instead of open-coding it
Date: Wed, 11 Oct 2017 15:25:52 +0200	[thread overview]
Message-ID: <20171011132552.tqfrg6ccqny2bzn2@linux-x5ow.site> (raw)
In-Reply-To: <ceff38de-c8f7-9279-4769-5fcaa239ec7a@linux.vnet.ibm.com>

On Wed, Oct 11, 2017 at 03:05:40PM +0200, Steffen Maier wrote:
> Maybe I misunderstand, but doesn't set_host_byte only set the host byte but
> leave the other 3 parts untouched in c->result?
> 
> static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
> {
> 	cmd->result = (cmd->result & 0xff00ffff) | (status << 16);
> }
> 
> In contrast, assigning something to c->result resets all parts.
> If so, the semantic patch would introduce a subtle semantic change.
> Unless it's guaranteed that in all the touched cases, c->result always has 0
> for status, message, and driver byte before calling set_host_byte().

Yes it does, another case I'll have to add to my coccinelle spatch, thanks for
reminding me (and I'm also doing it for set_msg_byte() and set_driver_byte(),
the status byte will be done manually probably).

> 
> Bart's suggestion also sounds nice.

Yes I'm working on implementing it currently.

> 
> FYI: Originally, I only thought about using set_host_byte in that one place
> fix of yours; I did not expect a full framework rework.

Oh well:
$ git diff --stat master..
[..]
 80 files changed, 589 insertions(+), 540 deletions(-)

Byte,
	Johannes

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

      reply	other threads:[~2017-10-11 13:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 15:29 Johannes Thumshirn
2017-10-10 16:02 ` Bart Van Assche
2017-10-11 13:05 ` Steffen Maier
2017-10-11 13:25   ` Johannes Thumshirn [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=20171011132552.tqfrg6ccqny2bzn2@linux-x5ow.site \
    --to=jthumshirn@suse.de \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=maier@linux.vnet.ibm.com \
    --cc=martin.petersen@oracle.com \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tj@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®