Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp119222imm; Fri, 21 Sep 2018 11:18:53 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbd0Ne5n7DvFEjBpCMFV3gFPWaiaSqVBEPvcBxZ9xpWGn/NO7zO4XIflHC35oEvfPnCCYXC X-Received: by 2002:a17:902:784a:: with SMTP id e10-v6mr7726714pln.197.1537553933477; Fri, 21 Sep 2018 11:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537553933; cv=none; d=google.com; s=arc-20160816; b=D8M5gk2L9hYWBPDtNesvI0awEa3kBVu+TaK/YiheNcEdZy6Xd389otgBExS48GQjIJ ht+9Uyfvsi60HPFqARRJr1Yji8xvU8lzyxA874+CgWNEEsbvAGU1O1W5NfOmGLXifc1w TMQ0UKZM+ePSiUoWeyvgIAFpsaqDpajC/IfDXgh5vfntQrkVA4gvJyLS58M2oJQgOHq5 oh4+0OZZXdn6M6cwEY25ICnYWRv0C8IcFqZspRwxywPPFONbV/QcHXykPnxvDzAIb347 DvACqZ8aSWw5Nq9x7YhCMtNJRcf3/nBBvT/o6g2S5r7xleldcDJMkv66aDhmtj/hyojN rH5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7lcZ9HEXpdOtLhJgsGrRqskTh+Z8npjUEAOzsae1hi4=; b=AJ4yBB0669zmy6VIG7F5ImNmMHJf+V5H3NB16AAH/ayr7pQgJFUIjiGSz3UDPf/Iw3 4EH4i/2phDfJhvPfWc7yyAsaB4Q+SJjzYiqsoviNaLdPiLolY/hYiI/4a+zZQZM3RdR9 +vyoT7adKb53bgWfOZS3XhFfYmdf+khNZ2oXe5i6rsivXHLegjsx/wRUk/jKPMUOKEP0 sm1HWxzC6L7Osb1mYpnD5nGi+FE5hVkTsRWjCIFoJf7cX8eS5k2btQLvI0iT59mozAYd QZ+HGxRvlY14hB5mf2TuGVL7Qxs+yC1hF2PPnU9j3oy8rwZ8lCNXhwhHusE5kxehchEd QxEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I8mIR2pE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d130-v6si26523424pga.657.2018.09.21.11.18.37; Fri, 21 Sep 2018 11:18:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I8mIR2pE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391211AbeIVAHy (ORCPT + 99 others); Fri, 21 Sep 2018 20:07:54 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:53214 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732114AbeIVAHy (ORCPT ); Fri, 21 Sep 2018 20:07:54 -0400 Received: by mail-wm1-f65.google.com with SMTP id y139-v6so3946909wmc.2; Fri, 21 Sep 2018 11:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7lcZ9HEXpdOtLhJgsGrRqskTh+Z8npjUEAOzsae1hi4=; b=I8mIR2pEeWheBgxD4CE52nljC4jHCrjAm6Gy5vbp4+nSxwjxIWZIHJNP/q3PDQQyxF NK3Be2FZc2UVUI6uRuntuz7C6YoZ0QygU/37oeMJKArH6CWqa+Z5pojcg2biShz2jygx thLAZ7ThmwZY1JNLMikdZDn8+THL/1InfJNnKYg8WxWLtvIC7mIVAK0blGrlDTCIe9Ga h+0GVZSmnnhAdtT1bTq09HrgyzEj1xnzvGHMVQPyiH8Mb0dIY6lJWHH5M0qS4+qbImAM 5QrkLmrQICk2OE0WYvQan5s5uWroG7tgLSpTercWPFVhGnAhmJCF+WwSanQ4DzkXXPlM DNhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7lcZ9HEXpdOtLhJgsGrRqskTh+Z8npjUEAOzsae1hi4=; b=ah+KHu9l74YSHC3sRtzrp3bbGOh81jf0vgbDR4CKUHMrCNehm3ycECJfyddeezdyog 8xnBlJ1aPxBSo+H7IQmBiqe8noWDlo8CP6T6Ni9ntFN98ceD/iFlF1+LAXqP3yfWgGRm kDcVdlAfJbK3yzI3TJvcFxIcyO09UroCb9VyrcDqBfwf2PrER4/TT4QFTD3XVBOQe0xL kbmOc+7BCz4HLs1quA57RP3tXfHN958kDT3380FlEhVfWCFSnvZ9Q/Jx0DQ7nWEBpU2s fZh3jO2L3UvzlNp+Gbzstq1KHaP/e1hXaCslY4bk8LFsTnFgSq3lioP4H4tuIFaHT9Qu FFvg== X-Gm-Message-State: APzg51DTba4p5Y8O91GP5OjN0C5iR/tg8D+uzrLvN9lQ648EPiHBwZvh SUW27Aga2H6WaF00qg5+iIg= X-Received: by 2002:a1c:889:: with SMTP id 131-v6mr5886798wmi.142.1537553869050; Fri, 21 Sep 2018 11:17:49 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id h73-v6sm13641477wma.11.2018.09.21.11.17.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Sep 2018 11:17:48 -0700 (PDT) Date: Fri, 21 Sep 2018 11:17:46 -0700 From: Nathan Chancellor To: Khalid Aziz Cc: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: FlashPoint: Remove unnecessary parentheses Message-ID: <20180921181746.GA5415@flashbox> References: <20180920211032.21840-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2018 at 09:19:40AM -0600, Khalid Aziz wrote: > On 09/20/2018 03:10 PM, Nathan Chancellor wrote: > > Clang warns when multiple pairs of parentheses are used for a single > > conditional statement. > > > > In file included from drivers/scsi/BusLogic.c:57: > > drivers/scsi/FlashPoint.c:2947:34: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] > > if ((currSCCB->Sccb_scsistat == SELECT_SN_ST)) { > > ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ > > drivers/scsi/FlashPoint.c:2947:34: note: remove extraneous parentheses around the comparison to silence this warning > > if ((currSCCB->Sccb_scsistat == SELECT_SN_ST)) { > > ~ ^ ~ > > drivers/scsi/FlashPoint.c:2947:34: note: use '=' to turn this equality comparison into an assignment > > if ((currSCCB->Sccb_scsistat == SELECT_SN_ST)) { > > ^~ > > = > > drivers/scsi/FlashPoint.c:2956:39: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] > > else if ((currSCCB->Sccb_scsistat == > > ~~~~~~~~~~~~~~~~~~~~~~~~^~ > > drivers/scsi/FlashPoint.c:2956:39: note: remove extraneous parentheses around the comparison to silence this warning > > else if ((currSCCB->Sccb_scsistat == > > ~ ^ > > drivers/scsi/FlashPoint.c:2956:39: note: use '=' to turn this equality comparison into an assignment > > else if ((currSCCB->Sccb_scsistat == > > ^~ > > = > > 2 warnings generated. > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/156 > > Signed-off-by: Nathan Chancellor > > --- > > drivers/scsi/FlashPoint.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > There are more places in this file with extraneous parentheses, for example: > > 952 if ((RD_HARPOON(ioport + hp_vendor_id_1) != ORION_VEND_1)) > 953 return (int)FAILURE; > 954 > 955 if ((RD_HARPOON(ioport + hp_device_id_0) != ORION_DEV_0)) > 956 return (int)FAILURE; > 957 > 958 if ((RD_HARPOON(ioport + hp_device_id_1) != ORION_DEV_1)) > > Wonder why the compiler does not complain about these, but this patch is > good for now. I will clean up the rest in another patch. > > James, Martin, please pull this patch into the scsi tree. > > Acked-by: Khalid Aziz Hi Khalid, Clang only warns about this construct when the left hand is a variable because it thinks that an assignment may have been intended so macros and functions don't trigger it. Thank you for the review, I appreciate it, Nathan