From: Tejun Heo <tj@kernel.org>
To: tom.ty89@gmail.com
Cc: sergei.shtylyov@cogentembedded.com, linux-ide@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH v2 2/2] libata-scsi: better style in ata_msense_caching()
Date: Tue, 12 Jul 2016 10:53:58 -0400 [thread overview]
Message-ID: <20160712145358.GF3190@htj.duckdns.org> (raw)
In-Reply-To: <5784f087.465c620a.e5292.ffffbf31@mx.google.com>
On Tue, Jul 12, 2016 at 09:28:23PM +0800, tom.ty89@gmail.com wrote:
> From: Tom Yan <tom.ty89@gmail.com>
>
> Signed-off-by: Tom Yan <tom.ty89@gmail.com>
>
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index bfec66f..6f7c626 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -2424,10 +2424,13 @@ static void modecpy(u8 *dest, const u8 *src, int n, bool changeable)
> static unsigned int ata_msense_caching(u16 *id, u8 *buf, bool changeable)
> {
> modecpy(buf, def_cache_mpage, sizeof(def_cache_mpage), changeable);
> - if (changeable || ata_id_wcache_enabled(id))
> - buf[2] |= (1 << 2); /* write cache enable */
> - if (!changeable && !ata_id_rahead_enabled(id))
> - buf[12] |= (1 << 5); /* disable read ahead */
> + if (changeable) {
> + buf[2] |= 1 << 2; /* ata_mselect_caching() */
> + }
> + else {
> + buf[2] |= ata_id_wcache_enabled(id) << 2; /* write cache enable */
> + buf[12] |= !ata_id_rahead_enabled(id) << 5; /* disable read ahead */
> + }
Again, why is this better?
Thanks.
--
tejun
prev parent reply other threads:[~2016-07-12 14:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160712132823.1765-1-me>
2016-07-12 13:28 ` [PATCH v2 2/2] libata-scsi: better style in ata_msense_caching() tom.ty89
2016-07-12 13:33 ` Sergei Shtylyov
2016-07-12 14:53 ` Tejun Heo [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=20160712145358.GF3190@htj.duckdns.org \
--to=tj@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=tom.ty89@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).