From patchwork Mon Mar 22 10:07:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 72537 X-Patchwork-Delegate: sean@mess.org Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1lOHUH-00A8J8-TX; Mon, 22 Mar 2021 10:08:42 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbhCVKIF (ORCPT + 1 other); Mon, 22 Mar 2021 06:08:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:48328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbhCVKHt (ORCPT ); Mon, 22 Mar 2021 06:07:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5762F61927; Mon, 22 Mar 2021 10:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616407668; bh=dBJFdoNziB9DDUF+HhGIBEOeGt35UbKFOybGBjedZZM=; h=From:To:Cc:Subject:Date:From; b=cw9wmolvpbimbAoDm/q7dJJU0emcIDDNCMqUa6DHKf+84Ox0z1A8+pLkXkBQF2HU0 D3UIetbaQy5rnsj+fuBKNdLxcNPcpBJsSHjSr5V6rTorUCqL+mbzmQHFx8GQ9rlPI4 9x9MBlBxGvevOzMm2PuqaMPuz/+emVaOx2DWHcfL4+BVCbc5bmdgitFybQeyazRd1w wtbG5zxTDX4OjI6DsTV/UjCARmaYdBtFGRKtuGQzSslz+Zjpyuo5u77QyAIYL6Ndfx HOvlm8begnvwl1OnpmVzHf9oQ51pIhPEFpae286AxqEBThQLREVX1sciYOEWC5e5rQ RXc5sdfKwq1LA== From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Sean Young , "Gustavo A. R. Silva" , Qinglang Miao , Oliver Neukum , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] media: flexcop: avoid -Wempty-body warning Date: Mon, 22 Mar 2021 11:07:24 +0100 Message-Id: <20210322100743.3880256-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -3.1 (---) X-LSpam-Report: No, score=-3.1 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no From: Arnd Bergmann Building with 'make W=1' shows many warnings -Wempty-body warnings like drivers/media/common/b2c2/flexcop-misc.c: In function 'flexcop_determine_revision': drivers/media/common/b2c2/flexcop-misc.c:35:85: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 35 | deb_info("this FlexCop has the 6 basic main hardware pid filter.\n"); drivers/media/usb/b2c2/flexcop-usb.c: In function 'flexcop_usb_process_frame': drivers/media/usb/b2c2/flexcop-usb.c:357:79: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 357 | deb_ts("not ts packet %*ph\n", 4, b+2); | ^ drivers/media/common/b2c2/flexcop-misc.c: In function 'flexcop_determine_revision': drivers/media/common/b2c2/flexcop-misc.c:35:85: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 35 | deb_info("this FlexCop has the 6 basic main hardware pid filter.\n"); | ^ Change the empty dprintk() macros to no_printk(), which avoids this warning and adds format string checking. Signed-off-by: Arnd Bergmann --- drivers/media/common/b2c2/flexcop.h | 2 +- drivers/media/pci/b2c2/flexcop-pci.c | 2 +- drivers/media/usb/b2c2/flexcop-usb.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/common/b2c2/flexcop.h b/drivers/media/common/b2c2/flexcop.h index 486fe2380b92..632d7bb9631a 100644 --- a/drivers/media/common/b2c2/flexcop.h +++ b/drivers/media/common/b2c2/flexcop.h @@ -17,7 +17,7 @@ extern int b2c2_flexcop_debug; #define dprintk(level,args...) \ do { if ((b2c2_flexcop_debug & level)) printk(args); } while (0) #else -#define dprintk(level,args...) +#define dprintk(level,args...) no_printk(args) #endif #define deb_info(args...) dprintk(0x01, args) diff --git a/drivers/media/pci/b2c2/flexcop-pci.c b/drivers/media/pci/b2c2/flexcop-pci.c index a9d9520a94c6..83d0ce7fc80e 100644 --- a/drivers/media/pci/b2c2/flexcop-pci.c +++ b/drivers/media/pci/b2c2/flexcop-pci.c @@ -22,7 +22,7 @@ MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog."); do { if ((debug & level)) printk(args); } while (0) #define DEBSTATUS "" #else -#define dprintk(level,args...) +#define dprintk(level,args...) no_printk(args) #define DEBSTATUS " (debugging is not enabled)" #endif diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index e731243267e4..6f8dc96adc08 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -27,8 +27,8 @@ #define DEBSTATUS "" #else -#define dprintk(level, args...) -#define debug_dump(b, l, method) +#define dprintk(level, args...) no_printk(args) +#define debug_dump(b, l, method) do { } while (0) #define DEBSTATUS " (debugging is not enabled)" #endif From patchwork Mon Mar 22 10:07:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 72536 X-Patchwork-Delegate: sean@mess.org Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1lOHUG-00A8J8-W5; Mon, 22 Mar 2021 10:08:41 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbhCVKIG (ORCPT + 1 other); Mon, 22 Mar 2021 06:08:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:48360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbhCVKHz (ORCPT ); Mon, 22 Mar 2021 06:07:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0B23C6196C; Mon, 22 Mar 2021 10:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616407675; bh=QNvSAb0YWXjz9Tz19Zjo9adT2JLPjr6b/zH6SuZQ45A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qK+hSyBYfnTgDBQE+4lAG9iOEi/CnkkmqpzReSZtIsyBLVOopiKDnsuzVu7tkWADW nMHO8Ion61mfwYxuWLEcHZczHomIfGbQf+o2pyVZPkzNTE/c/JkDE6qQAM56w1poQL yr0UliD/S6fJ8hjr1V6oQ+k/+arYP0Id1Fo0xm6RVA0zQGirvYRCTIWpdaXoy/Ck8u SyCEJXjghHPtSAdmO74Cz6n0gEFSgAtZ+nR978a31RAGrVTFZ49hq+C3dPoPNxaMH6 hY7F0WBLZfbDEcIhdIu7eaH+ZzgEf6rDvY3WLlg74J2l1ioPxrPDncoUrK05p4AOZK 8xeT3P1+zSt3Q== From: Arnd Bergmann To: Mauro Carvalho Chehab Cc: Arnd Bergmann , Sean Young , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] media: dvb-usb: avoid -Wempty-body warnings Date: Mon, 22 Mar 2021 11:07:25 +0100 Message-Id: <20210322100743.3880256-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210322100743.3880256-1-arnd@kernel.org> References: <20210322100743.3880256-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -3.1 (---) X-LSpam-Report: No, score=-3.1 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DKIM_VALID_EF=-0.1,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no From: Arnd Bergmann Building with 'make W=1' shows many warnings -Wempty-body warnings like drivers/media/usb/dvb-usb/vp702x-fe.c: In function 'vp702x_fe_set_frontend': drivers/media/usb/dvb-usb/vp702x-fe.c:190:46: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 190 | deb_fe("tuning succeeded.\n"); drivers/media/usb/dvb-usb/dtt200u.c: In function 'dtt200u_rc_query': drivers/media/usb/dvb-usb/dtt200u.c:124:58: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 124 | deb_info("st->data: %*ph\n", 5, st->data); drivers/media/usb/dvb-usb/m920x.c: In function 'm920x_rc_query': drivers/media/usb/dvb-usb/m920x.c:207:58: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 207 | deb("Unknown rc key %02x\n", rc_state[1]); Change the empty dprintk() macros to no_printk(), which avoids this warning and adds format string checking. Signed-off-by: Arnd Bergmann --- drivers/media/usb/dvb-usb/dvb-usb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb/dvb-usb.h b/drivers/media/usb/dvb-usb/dvb-usb.h index 2b8ad2bde8a4..42f4d2fece8b 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb.h +++ b/drivers/media/usb/dvb-usb/dvb-usb.h @@ -38,8 +38,8 @@ } #define DVB_USB_DEBUG_STATUS #else -#define dprintk(args...) -#define debug_dump(b,l,func) +#define dprintk(var,level,args...) no_printk(args) +#define debug_dump(b,l,func) do { } while (0) #define DVB_USB_DEBUG_STATUS " (debugging is not enabled)"