Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1544085yba; Thu, 4 Apr 2019 12:58:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwL906ba1WjnKhHZznRxPtbeQa8QpCvNBhIyU8LpLrOFpbtiOCaeylEFLA/YWInrrc+Aw0A X-Received: by 2002:a63:e050:: with SMTP id n16mr7475827pgj.210.1554407938878; Thu, 04 Apr 2019 12:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554407938; cv=none; d=google.com; s=arc-20160816; b=DVpBZ1aoY649OitQphZwfMZKRlPXhf1d1BuRj7wpd1x2rXBHyZfFr0Q5/ODRJbTD2r 28OKc6MS1VlqT/ehvC5rfI+FZUJUlvsAs180m8YswIKyi9GRzsEUY94jOn4PrvXIaxNr Lsxwk+R0J86gFlo6rO+miko7unhQBm0U2DDo8sMQ3CDQWm+NZLq738F6/9rQ917PgL7i JGjjxl7i9twUrFGx8JoUZYyptFJhjc8PXy8YkPKPOGWzUFRmCWRqB8wAxe4+C6bkNJYw 1BsjP+gAm4H9DDZEiCcGUI56cHvCkFt4BmehNWeAd4W18nz92/L+S0mWWVPI+12mdT76 9ziQ== 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:to :from:date:dkim-signature; bh=c/A5eqw6yK50rkMqQZj0f5rzX42DjVihBEh/+r4Pt9U=; b=d1AuojjfFAXH28UQcHW/AyxvEJb6Z/1yTL6P/SIezRBi7A+Imd208DltAXQZEWViK7 CF/L2zbNIKZClRBMRaHrfBZSzXAhs2B21RmO8ExixxqQ+8j0UBq16tZ08EJts9el9Vcl G+AC2gx4W6FjE4V3dFWLMyxMFCJkf8O6nIb+yaql76siEycERvAbgpvyIxMHW74CFclE KoQb/JociAHBN8n+YDsceb9b2LTy/BlHGWMQUSBb9kIyJSPPTNKrRTLXyN1oQGAAHnFi speYJWyVQWMYlGQPMSQaC3d3BSL26mr3e7C4Yl2W7Bsh/eyi52CrA10lmsm3rMy3GxL7 PuMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="dn6g/exY"; 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 n18si17268225pgb.91.2019.04.04.12.58.43; Thu, 04 Apr 2019 12:58:58 -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="dn6g/exY"; 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 S1730709AbfDDT4j (ORCPT + 99 others); Thu, 4 Apr 2019 15:56:39 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:42846 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728699AbfDDT4i (ORCPT ); Thu, 4 Apr 2019 15:56:38 -0400 Received: by mail-ot1-f67.google.com with SMTP id 103so3497399otd.9 for ; Thu, 04 Apr 2019 12:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=c/A5eqw6yK50rkMqQZj0f5rzX42DjVihBEh/+r4Pt9U=; b=dn6g/exYvuaO7XVehkz3CI55p8Ns9EU3gRKt2uJut1kv1GtrEEm+8uf2XtTlVnaJkO 2sDziMX/xi3i6IeYAGtpvHJwydXjENZK3J3z7FT5NtA/4NGxnLRm0PNRNOccVwUKCyWG A9sd2GJknATAt1SA0XY0MVaiRgEPoyzM/qfz045wvRldzE+EV5wU088GmThk5OMfNcMy rcG6q7IIH49u9R7FTz2pSlBamWJ4dac1oX1TF6znIW0oKc+cYuC3OdqqYPE/piambtWg LLg214TYih7q4a7/gZDLjl1PRaZ+I5VhgwAQ88DRSh1ihMZ2diKPvW4+0dvqeMlYEutV 4GaA== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=c/A5eqw6yK50rkMqQZj0f5rzX42DjVihBEh/+r4Pt9U=; b=Ad5X9yCZ3CnDnnGzgS7rowvfXSiczfXeJ5ffztNgs6squKsLVCDXRqhODT9XG9qtSl 3BBxL49Da/gUW35WNPI50lD+9fijSjqWmqmdP1kui+g2vYpuw3TnuP3XNbYvour2fsQ5 ZqFCMZsyLUW5ngW0BAk+Ka/zdxlyzBZFBBF9Tpz1JTg/BaHXTaxd3RdViDdCWrQpMTwD Um8y5+Tu1f2KLk2TJqU1Pf7E+mjDIqzqnM8C2rNWKJaJ4J8Qa3sIu6EuoctwQeY/FSIh D88aKyGzujRdUrNNpd6HoeED8I1FuBzM6Y6TUozgMZaFgxaBO6MWZ6c/ScEKjwcpm8lW KZAw== X-Gm-Message-State: APjAAAXF5Ggr8Rbhj9Uy1q8EgYMpV0MSOfffT22Nr7F69wqtvHEe/Xjf Kcr9J1TTYYIbmts4mGczvlyhVGhJbnA= X-Received: by 2002:a05:6830:2094:: with SMTP id y20mr5418720otq.316.1554407797709; Thu, 04 Apr 2019 12:56:37 -0700 (PDT) Received: from madhuleo ([2605:6000:1023:606d:7549:4e85:9095:b601]) by smtp.gmail.com with ESMTPSA id y9sm7648653otk.20.2019.04.04.12.56.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 12:56:37 -0700 (PDT) Date: Thu, 4 Apr 2019 14:56:35 -0500 From: Madhumthia Prabakaran To: Dan Carpenter , gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Staging: rtlwifi: Remove unwanted parentheses Message-ID: <20190404195633.GA7215@madhuleo> References: <20190403223851.22524-1-madhumithabiw@gmail.com> <20190404090900.GH32590@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190404090900.GH32590@kadam> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 04, 2019 at 12:09:00PM +0300, Dan Carpenter wrote: > You should probably update the subject line because now it's not just > about parentheses any more. > > [PATCH v2] Staging: rtlwifi: clean up crc16_ccitt() > > So the one thing per patch rule is a little bit about selling your > patch. We never allow "Clean up whole_file.c" but we do sometimes allow > "Clean up a function()" so long as the patch description sells it in > the right way. > > Blah blah function does "BIT(0) << i" instead of "BIT(i)". Using !! > is slightly shorter than "foo ? 1 : 0". Blah blah, etc. Thanks for feedback! > > On Wed, Apr 03, 2019 at 05:38:51PM -0500, Madhumitha Prabakaran wrote: > > @@ -351,13 +351,13 @@ static u16 crc16_ccitt(u8 data, u16 crc) > > else > > result |= BIT(0); > > > > - crc_bit11 = ((crc & BIT(11)) ? 1 : 0) ^ shift_in; > > + crc_bit11 = !!(crc & BIT(11)) ^ shift_in; > > if (crc_bit11 == 0) > > result &= (~BIT(12)); > ^ ^ > I thought your Coccinelle script was going to complain about these > parentheses. Probably the &= confuses it? There are a couple others > in the same function. I didn't included assignment operators in the earlier Coccinelle script. However, I edited it now. > > regards, > dan carpenter