Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1399136pxf; Fri, 26 Mar 2021 07:11:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOv9nNLYzBL0+oqZKDf3qT7AIoxS9Oi/S4OyCYpO7GC04q5xljW17IfLTR+p085VpHd3Yh X-Received: by 2002:a17:906:a44a:: with SMTP id cb10mr15230988ejb.424.1616767907299; Fri, 26 Mar 2021 07:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616767907; cv=none; d=google.com; s=arc-20160816; b=qwXmPM/zg01yIUv7viNA3ptnFiMUW7479cAXbj/ssgInrc4uGYkpgGUVkVwzPmW60L 6LnULGq3Wg+W7V/hbwcgYEnBKKZ2hkMWkUHiZ1rwZNsXnGfg1wJCEGTtDlBdPRp64/84 vjaYZtgu51HboSix7uj6/86rtaEdlxFqe3jMQdbGmN2Zrt/Ha8cr9PyDfsY9YynVgAdH X7ogiG9VgJC+xqt/chgJsdAKEeXmF3FoOOn7+FlHoc/xvgxXfx61S7AAywYYAKBQkkkm zUxxohJrEPUozzgZvGYKTzk/2yAd8j/4PNTx6HtxkRW83FFoyGkvxsSwDKaWrxbvWE2v iihA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sF6xbMNs3cKY8ZUH/BZFs5pp7kCdOZayoV5wUnMjVRs=; b=qswiRsHupR915Bmg+qid+yVhtRyO5WJNgBtIsUTxD/YXODEc5TUjiZBydl9Z+rrhVa 3h39xpmYM3Plq1SOlfSpgv/j+ksfzWlefX+p7ur8G9uw//oT2A8xBG+sXsCuhKNDZ5ca UnqN7WIp9g/7raOtjzqhK9KT4gSN40UDW0OD/Ct3U4tPzrz0xsUUh9416THt/NMRT8r4 1NtfOuXfqEyAeMoWArkPwhycykFzqaHSBZswRt2nHQA8auJwSv41/uIIsgiKgurBmiir O3D1GqjzRo4/jOX1lHRS5z8RRkFiUeEEmNyoJXn6GmXe17Gyb2M/zmemUrg99omj7Tpp odsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1/X9Emcr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m21si7005286ejx.725.2021.03.26.07.11.24; Fri, 26 Mar 2021 07:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1/X9Emcr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbhCZOHW (ORCPT + 99 others); Fri, 26 Mar 2021 10:07:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:44016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbhCZOG6 (ORCPT ); Fri, 26 Mar 2021 10:06:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9725961A24; Fri, 26 Mar 2021 14:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616767618; bh=Zs7G2VZRCMsfXdjZurww9AAYubVChEXpje6NACEqXak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1/X9EmcrFBsei8WYjtN8gNxxS/y/bjAUgBd97Z5l3if/9+5FmKFG4GGQcoEC7npfE We+vmY76D0R/Xp50ZOSXahxlvMmNoPeBcCnDmz88bn+yT/1DcfDqg/LihgEET5WCRe 6tH3XYLAZRHo7ST9EcW3z8hMrimlQ/ihAMgXaZT8= Date: Fri, 26 Mar 2021 15:06:55 +0100 From: Greg KH To: Fabio Aiuto Cc: Dan Carpenter , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/15] staging: rtl8723bs: put parentheses on macros with complex values in include/basic_types.h Message-ID: References: <2c7c198ccef194b06921bc476eda7d5102ab70dc.1616748885.git.fabioaiuto83@gmail.com> <20210326100408.GE1717@kadam> <20210326111241.GD1452@agape.jhs> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210326111241.GD1452@agape.jhs> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 12:12:42PM +0100, Fabio Aiuto wrote: > On Fri, Mar 26, 2021 at 01:04:08PM +0300, Dan Carpenter wrote: > > On Fri, Mar 26, 2021 at 10:09:11AM +0100, Fabio Aiuto wrote: > > > fix the following checkpatch warnings: > > > > > > ERROR: Macros with complex values should be enclosed in parentheses > > > 154: FILE: drivers/staging/rtl8723bs/include/basic_types.h:154: > > > +#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ > > > -- > > > ERROR: Macros with multiple statements should be enclosed in > > > a do - while loop > > > 161: FILE: drivers/staging/rtl8723bs/include/basic_types.h:161: > > > +#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ > > > -- > > > ERROR: Macros with complex values should be enclosed in parentheses > > > 168: FILE: drivers/staging/rtl8723bs/include/basic_types.h:168: > > > +#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \ > > > > > > parentheses solution preferred for all fixes and made macros more > > > readables > > > > > > Signed-off-by: Fabio Aiuto > > > --- > > > .../staging/rtl8723bs/include/basic_types.h | 30 +++++++++++-------- > > > 1 file changed, 18 insertions(+), 12 deletions(-) > > > > > > diff --git a/drivers/staging/rtl8723bs/include/basic_types.h b/drivers/staging/rtl8723bs/include/basic_types.h > > > index 76304086107a..5054c2e3384c 100644 > > > --- a/drivers/staging/rtl8723bs/include/basic_types.h > > > +++ b/drivers/staging/rtl8723bs/include/basic_types.h > > > @@ -152,24 +152,30 @@ > > > /* Set subfield of little-endian 4-byte value to specified value. */ > > > /* */ > > > #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ > > > - *((u32 *)(__pstart)) = \ > > > - ( \ > > > - LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ > > > - ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ > > > + (\ > > > + *((u32 *)(__pstart)) = \ > > > + ( \ > > > + LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ > > > + ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ > > > + )\ > > > ) > > > > > > > These macros are terrible and this makes it uglier. Better to just > > ignore checkpatch until we can figure out a way to re-write this > > properly. > > > > regards, > > dan carpenter > > > > I see, will drop the patch for now. Please resend a v2 set of this series so I know what to apply here... thanks, greg k-h