From patchwork Thu Jul 21 07:40:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101992 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp296091qga; Thu, 21 Jul 2016 00:44:15 -0700 (PDT) X-Received: by 10.98.111.133 with SMTP id k127mr3884064pfc.90.1469087054934; Thu, 21 Jul 2016 00:44:14 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si8229573pab.167.2016.07.21.00.44.14; Thu, 21 Jul 2016 00:44:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751736AbcGUHoK (ORCPT + 29 others); Thu, 21 Jul 2016 03:44:10 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:55834 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbcGUHoI (ORCPT ); Thu, 21 Jul 2016 03:44:08 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0Lz2g4-1bCxP40I2i-014Ghw; Thu, 21 Jul 2016 09:43:58 +0200 From: Arnd Bergmann To: Tejun Heo Cc: Arnd Bergmann , Hannes Reinecke , Tom Yan , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] libata: add parentheses to avoid a gcc warning Date: Thu, 21 Jul 2016 09:40:06 +0200 Message-Id: <20160721074023.1522219-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:tcduoTjAdpmRsJTlzwLww8RKTZaMiC9HQ5PvRwpBxAMx+2pODeS wI/Rk/l6Phbf9QeXo7MmZdQJftXWYLoJIT7Vxv7QA3+DXhkHFGXer8F4OnX7qRgGAd8HZ8g ++yDLdVHgkFZFDTHVJEP4fQ2jIocQZA5P5e852Jc51K+kqDZD+ZQfUSk1f2sNo5efglsL34 Bl2+1kML2vz7wiEGA4IBw== X-UI-Out-Filterresults: notjunk:1; V01:K0:HJnFERtiPKE=:/Lu6PDM/ae+sDAGftMOeCU E6OsZypoBzN+osnXljr6cv+R5/6xQ0arF47rvGKejccJ9Ytdm7ec69VLieFHZ4npwhydGbZy1 8CMFNcEOoIoeV/CIwrSEVPtzv8lwtTb8eNVQmf0tehyEHlBoch6EtXKIqv64t7DyVMR076pEA oBAbalnlil5ujJsGoxNjexv9xJE8kx4hFwHQSbIdcRMkqa+M9/Mfb+OOMPM0sBpoJ5kKMToeT rPrAvgBGIAViEKW04CykJwVpyYi6EVewUySOcXGy6zPWmkF8OGfkvaZNIvLjRulB8q3FjSdnc yXIw/dM3CNqUAHfs/QnTG6OTBuLrwRIH+6GOW1JECkIPATXyzKBHJWIkBqTHnx3jGg1A6fqFb tg+sT026kfWb5cgeEj4i/vqQwa9FeH8kO/GLdSxO2cHYWHDdfqVYGEnQjAodKBDd6XvJ3qicN qjnNm86ncjC4wIBhW0ULLEqhbQHo3F17qNiMJq0qOTwPsVh6Y3Mn4HyvIue3f+RoN0/Y4dFxZ /JAw4sAvJeuJAkdlll6LWCRMvvPl9HwbNU49Qr9HDptxnJJjELqbn0ObbsEXsYzd+CH5GzHuU yJV3EJH8+yQCijL8qumRv3PhckJI8giR8+MlqfaJbnMOKjleB26m7vDMO/SbVeCD6TqaYNXkX 4tvH/1vOKHp5SmFY5pkqEp4OWFMvqeqDeXORDavYWDsrylFGJ0M7IAG0cN8BU+sn/LaE= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-6.1 warns about possibly ambiguous code that was newly added to libata: drivers/ata/libata-scsi.c: In function 'ata_mselect_caching': drivers/ata/libata-scsi.c:3637:28: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses] drivers/ata/libata-scsi.c: In function 'ata_mselect_control': drivers/ata/libata-scsi.c:3702:28: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses] The code is fine, and it's not really ambigous to human readers, but let's shut up the warning anyway by adding the parentheses that gcc suggests. Signed-off-by: Arnd Bergmann Fixes: 9b7844a8c34a ("libata-scsi: fix read-only bits checking in ata_mselect_*()") --- drivers/ata/libata-scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 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 {