From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753422AbcHADn2 (ORCPT ); Sun, 31 Jul 2016 23:43:28 -0400 Received: from outbound.smtp.vt.edu ([198.82.183.121]:47506 "EHLO omr1.cc.vt.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750767AbcHADnW (ORCPT ); Sun, 31 Jul 2016 23:43:22 -0400 X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6+dev To: Tejun Heo cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] silence warning in drivers/ata/libata-scsi.c when building W=1 From: Valdis Kletnieks Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 31 Jul 2016 23:28:34 -0400 Message-ID: <8997.1470022114@turing-police.cc.vt.edu> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 {