Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1452969 > unrolled thread
| Started by | Valdis Kletnieks <Valdis.Kletnieks@vt.edu> |
|---|---|
| First post | 2016-08-01 05:50 +0200 |
| Last post | 2016-08-01 17:10 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] silence warning in drivers/ata/libata-scsi.c when building W=1 Valdis Kletnieks <Valdis.Kletnieks@vt.edu> - 2016-08-01 05:50 +0200
Re: [PATCH] silence warning in drivers/ata/libata-scsi.c when building W=1 Tejun Heo <tj@kernel.org> - 2016-08-01 17:10 +0200
| From | Valdis Kletnieks <Valdis.Kletnieks@vt.edu> |
|---|---|
| Date | 2016-08-01 05:50 +0200 |
| Subject | [PATCH] silence warning in drivers/ata/libata-scsi.c when building W=1 |
| Message-ID | <s1coO-Tv-25@gated-at.bofh.it> |
When building with W=1, we get these warnings:
drivers/ata/libata-scsi.c: In function 'ata_mselect_caching':
drivers/ata/libata-scsi.c:3637:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
~~~~~^~~~~~~~~
drivers/ata/libata-scsi.c: In function 'ata_mselect_control':
drivers/ata/libata-scsi.c:3702:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
~~~~~^~~~~~~~~
So give them the extra () and make things a bit clearer for both the
compiler and programmer...
Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index fa9d16fe295c..8ad4b237f342 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3634,7 +3634,7 @@ static int ata_mselect_caching(struct ata_queued_cmd *qc,
/* Check the first byte */
if (i == 0) {
/* except the WCE bit */
- if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
+ if ((mpage[i + 2] & 0xfb) != (buf[i] & 0xfb)) {
*fp = i;
return -EINVAL;
} else {
@@ -3699,7 +3699,7 @@ static int ata_mselect_control(struct ata_queued_cmd *qc,
/* Check the first byte */
if (i == 0) {
/* except the D_SENSE bit */
- if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
+ if ((mpage[i + 2] & 0xfb) != (buf[i] & 0xfb)) {
*fp = i;
return -EINVAL;
} else {
[toc] | [next] | [standalone]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2016-08-01 17:10 +0200 |
| Subject | Re: [PATCH] silence warning in drivers/ata/libata-scsi.c when building W=1 |
| Message-ID | <s1n0S-7W5-13@gated-at.bofh.it> |
| In reply to | #1452969 |
On Sun, Jul 31, 2016 at 11:28:34PM -0400, Valdis Kletnieks wrote:
> When building with W=1, we get these warnings:
>
> drivers/ata/libata-scsi.c: In function 'ata_mselect_caching':
> drivers/ata/libata-scsi.c:3637:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
> if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
> ~~~~~^~~~~~~~~
> drivers/ata/libata-scsi.c: In function 'ata_mselect_control':
> drivers/ata/libata-scsi.c:3702:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
> if (mpage[i + 2] & 0xfb != buf[i] & 0xfb) {
> ~~~~~^~~~~~~~~
>
> So give them the extra () and make things a bit clearer for both the
> compiler and programmer...
>
> Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
The offending commit got already reverted.
Thanks!
--
tejun
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web