Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035225AbdD1ATS (ORCPT ); Thu, 27 Apr 2017 20:19:18 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:34413 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754610AbdD1ATL (ORCPT ); Thu, 27 Apr 2017 20:19:11 -0400 Subject: Re: [PATCH 2/7] staging: rtl8723bs: Wrap multi-line macros in do-while loop To: Justin Vreeland , gregkh@linuxfoundation.org, hadess@hadess.net References: <20170428001000.7241-1-justin@jvreeland.com> <20170428001000.7241-3-justin@jvreeland.com> Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org From: Larry Finger Message-ID: <037b13c4-402f-ffa4-98c1-b282f4de18d5@lwfinger.net> Date: Thu, 27 Apr 2017 19:19:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170428001000.7241-3-justin@jvreeland.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3016 Lines: 112 On 04/27/2017 07:09 PM, Justin Vreeland wrote: > Signed-off-by: Justin Vreeland > --- The patch is OK, but most maintainers require a non-blank commit message. Larry > drivers/staging/rtl8723bs/hal/odm_debug.h | 80 +++++++++++++++++-------------- > 1 file changed, 44 insertions(+), 36 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h > index a89690ea6ba9..f720eafe46fe 100644 > --- a/drivers/staging/rtl8723bs/hal/odm_debug.h > +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h > @@ -105,51 +105,59 @@ > > #if DBG > #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)\ > - if (\ > - (comp & pDM_Odm->DebugComponents) &&\ > - (level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)\ > - ) {\ > - RT_PRINTK fmt;\ > - } > + do {\ > + if (\ > + (comp & pDM_Odm->DebugComponents) &&\ > + (level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)\ > + ) {\ > + RT_PRINTK fmt;\ > + } \ > + } while (0) > > #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)\ > - if (\ > - (comp & pDM_Odm->DebugComponents) &&\ > - (level <= pDM_Odm->DebugLevel)\ > - ) {\ > - RT_PRINTK fmt;\ > - } > + do {\ > + if (\ > + (comp & pDM_Odm->DebugComponents) &&\ > + (level <= pDM_Odm->DebugLevel)\ > + ) {\ > + RT_PRINTK fmt;\ > + } \ > + } while (0) > > #define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\ > - if (!expr) {\ > - DbgPrint("Assertion failed! %s at ......\n", #expr);\ > - DbgPrint(\ > - " ......%s,%s, line =%d\n",\ > - __FILE__,\ > - __func__,\ > - __LINE__\ > - );\ > - RT_PRINTK fmt;\ > - ASSERT(false);\ > - } > + do {\ > + if (!expr) {\ > + DbgPrint("Assertion failed! %s at ......\n", #expr);\ > + DbgPrint(\ > + " ......%s,%s, line =%d\n",\ > + __FILE__,\ > + __func__,\ > + __LINE__\ > + );\ > + RT_PRINTK fmt;\ > + ASSERT(false);\ > + } \ > + } while (0) > #define ODM_dbg_enter() { DbgPrint("==> %s\n", __func__); } > #define ODM_dbg_exit() { DbgPrint("<== %s\n", __func__); } > #define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); } > > #define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\ > - if (\ > - (comp & pDM_Odm->DebugComponents) &&\ > - (level <= pDM_Odm->DebugLevel)\ > - ) {\ > - int __i;\ > - u8 *__ptr = (u8 *)ptr;\ > - DbgPrint("[ODM] ");\ > - DbgPrint(title_str);\ > - DbgPrint(" ");\ > - for (__i = 0; __i < 6; __i++)\ > - DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\ > - DbgPrint("\n");\ > - } > + do {\ > + if (\ > + (comp & pDM_Odm->DebugComponents) &&\ > + (level <= pDM_Odm->DebugLevel)\ > + ) {\ > + int __i;\ > + u8 *__ptr = (u8 *)ptr;\ > + DbgPrint("[ODM] ");\ > + DbgPrint(title_str);\ > + DbgPrint(" ");\ > + for (__i = 0; __i < 6; __i++)\ > + DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\ > + DbgPrint("\n");\ > + } \ > + } while (0) > #else > #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) > #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) >