Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2886150pxf; Sun, 28 Mar 2021 05:11:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+IJDHvSyBCRhbOtp4iMNX6T+BTrETTpFr60ESmYifZoNLJYXvjySrZErt1QYtdm51Eevz X-Received: by 2002:a05:6402:110b:: with SMTP id u11mr24991998edv.356.1616933504478; Sun, 28 Mar 2021 05:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616933504; cv=none; d=google.com; s=arc-20160816; b=d+B2mGNcFJBBApcKcLQuAHDwpMvKyXY8mQV4WeGPBCmuO/CaM8maH6hRoHqhAY1qGg 0Q3BGVzZb7A/WK+S4WAiEfJCV9YYx9hYfcv9gURGtZKGU7iZLixW9Cap/Wbj1VJ3aX7u fhO/3qaP6L1Cz9EXhrmrvTjk/7oIE2omJaQUNu7iU9ZMcflfuRmUwzBdbuImZxoLQP+H EVx8d0Y+LJd/gBe1Oocfvm2URSadp9TNXXu/2/FkVhqhA561toAr6dwGKsUOwKaWNI6M FeKZHd9cueUlpJBPkV589zc0cIHgl6JOPSWF5wwmRp9/92CConWxFh0m7IBV7plt8b8y mKPg== 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=oGiwxEtZEhuleD88Zlr5i6ZOOtV9ovlxIQIHpMMR9JE=; b=C1mrWRpmjyCW0MOvc5o4nRcYATSUyHWrVdjIIuajtpU7P10evUsrZa8qUHtgTUdGR8 ANNM8xY/3zZ6vbO6sOKCgY0KQd37+uFn4+HZdCyM9HQw3HptgWzs5pK5AFAFC61KyiTW qL38kdwEM4VZ4KRR3omaLOeZ1sC7nxFf9xAM2e9AH81ac0kEXMgRFKJwvV6lzMZA9QrG xExI1NEkh+/tpDAfyl5pgralfNGZ1r6N/yf2ZsEUZve25MyBvjgvSA3g5mHHkP4Toswq pVvOr/n65LFTwIhJga31VO6/PRwiIKX5Ct6XarYVb1Rv0cqN7izVeeQwe70oCboxvsIT tnPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kloGpqS8; 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 a8si10766667ejt.44.2021.03.28.05.11.21; Sun, 28 Mar 2021 05:11:44 -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=kloGpqS8; 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 S231300AbhC1MJI (ORCPT + 99 others); Sun, 28 Mar 2021 08:09:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:44658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbhC1MIr (ORCPT ); Sun, 28 Mar 2021 08:08:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 14DA160232; Sun, 28 Mar 2021 12:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616933324; bh=XtGZd3bNPgaiElFYXcnf/Q4Cl7Hd4Zr72qj0OGHshHc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kloGpqS8f+lUXnoy68FFx4ShbX17+KVIjoxKaDPIHU/MTk+b4ZvfRX/gRHj+UmEFR vWsZrfZRndy1YBpihWnTX9THblMlWEjMtLutIkpZK/GyDesLONhn5emot4DQ6qmzjK BkRk/zhorWnu992x9+/gr72f7HdjmmI3cG1oD4yI= Date: Sun, 28 Mar 2021 14:08:41 +0200 From: Greg KH To: Fabio Aiuto Cc: dan.carpenter@oracle.com, david.laight@aculab.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 09/20] staging: rtl8723bs: put parentheses on macros with complex values in include/rtw_debug.h Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 27, 2021 at 03:24:08PM +0100, Fabio Aiuto wrote: > fix the following checkpatch warning: > > ERROR: Macros starting with if should be enclosed by a > do - while loop to avoid possible if/else logic defects > + #define RT_PRINT_DATA(_Comp, _Level, > _TitleString, _HexData, _HexDataLen) \ > > Signed-off-by: Fabio Aiuto > --- > drivers/staging/rtl8723bs/include/rtw_debug.h | 28 ++++++++++--------- > 1 file changed, 15 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h > index d1c557818305..b00f8a6c4312 100644 > --- a/drivers/staging/rtl8723bs/include/rtw_debug.h > +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h > @@ -236,19 +236,21 @@ > #if defined(_dbgdump) > #undef RT_PRINT_DATA > #define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \ > - if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \ > - { \ > - int __i; \ > - u8 *ptr = (u8 *)_HexData; \ > - _dbgdump("%s", DRIVER_PREFIX); \ > - _dbgdump(_TitleString); \ > - for (__i = 0; __i < (int)_HexDataLen; __i++) \ > - { \ > - _dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \ > - if (((__i + 1) % 16) == 0) _dbgdump("\n"); \ > - } \ > - _dbgdump("\n"); \ > - } This whole nightmare needs to just be deleted and any callers of it need to use the in-kernel functions for this instead. thanks, greg k-h