From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id AB1A3C42E for ; Thu, 28 Jan 2016 10:43:22 +0100 (CET) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id F3E918E6EF; Thu, 28 Jan 2016 09:43:21 +0000 (UTC) Received: from sopuli.koti.laiskiainen.org (vpn1-4-63.ams2.redhat.com [10.36.4.63]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0S9hK5O010529; Thu, 28 Jan 2016 04:43:21 -0500 To: "Xie, Huawei" , Thomas Monjalon References: <1451872319-30737-1-git-send-email-huawei.xie@intel.com> <9204020.3pEC1ROqZC@xps13> <10119337.4qkYhnRbX6@xps13> From: Panu Matilainen Message-ID: <56A9E2B8.4050703@redhat.com> Date: Thu, 28 Jan 2016 11:43:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2] fix checkpatch errors X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2016 09:43:23 -0000 On 01/28/2016 10:38 AM, Xie, Huawei wrote: > On 1/28/2016 4:06 PM, Thomas Monjalon wrote: >> 2016-01-28 03:09, Xie, Huawei: >>> On 1/28/2016 2:17 AM, Thomas Monjalon wrote: >>>> 2016-01-27 01:26, Huawei Xie: >>>>> v2 changes: >>>>> add missed commit message in v1 >>>>> >>>>> fix the error reported by checkpatch: >>>>> "ERROR: return is not a function, parentheses are not required" >>>>> >>>>> also removed other extra parentheses like: >>>>> "return val == 0" >>>>> "return (rte_mempool_lookup(...))" >>>> How these examples are differents from above checkpatch error? >>> Don't get it. >> Me too ;) >> I don't understand which paren you removed in "return val == 0" >> and why you say "also removed other...", meaning it is different >> from the checkpatch error. > > Got you. I thought your example means DPDK examples. > I mean i also removed paren in "return (val == 0)". But checkpatch > doesn't report "return (logical expression)" as error. I think it is > also not necessary, so removed some of them. That is why i listed them > seperately. > So perhaps there's a reason checkpatch doesn't report it as an error? At least I find the parentheses to increase readability in case of logical expressions, for example return val == 0; return (val == 0); The parentheses kinda force you to notice there's something special going on and its not val that's returned. This "note there's something special here" of course only works if parentheses are not sprinkled around everywhere. - Panu -