Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbbHPFap (ORCPT ); Sun, 16 Aug 2015 01:30:45 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:36615 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbbHPFam (ORCPT ); Sun, 16 Aug 2015 01:30:42 -0400 From: =?UTF-8?q?Rapha=C3=ABl=20Beamonte?= To: Johnny Kim Cc: =?UTF-8?q?Rapha=C3=ABl=20Beamonte?= , Rachel Kim , Dean Lee , Chris Park , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] staging: wilc1000: code style: fix macro with multiple statements Date: Sun, 16 Aug 2015 01:30:12 -0400 Message-Id: <641be2615e97db253a306c766a48c2afccf338d7.1439702894.git.raphael.beamonte@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1542 Lines: 45 Macros with multiple statements should be enclosed in a do - while loop Signed-off-by: Raphaƫl Beamonte --- drivers/staging/wilc1000/wilc_exported_buf.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c index 5294578..45c2c7e 100644 --- a/drivers/staging/wilc1000/wilc_exported_buf.c +++ b/drivers/staging/wilc1000/wilc_exported_buf.c @@ -12,11 +12,13 @@ void *exported_ ## name = NULL; #define MALLOC_WILC_BUFFER(name, size) \ - exported_ ## name = kmalloc(size, GFP_KERNEL); \ - if (!exported_ ## name) { \ - printk("fail to alloc: %s memory\n", exported_ ## name); \ - return -ENOBUFS; \ - } + do { \ + exported_ ## name = kmalloc(size, GFP_KERNEL); \ + if (!exported_ ## name) { \ + printk("fail to alloc: %s memory\n", exported_ ## name); \ + return -ENOBUFS; \ + } + } while (0) #define FREE_WILC_BUFFER(name) \ kfree(exported_ ## name); @@ -73,4 +75,4 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_AUTHOR("Tony Cho"); MODULE_DESCRIPTION("WILC1xxx Memory Manager"); pure_initcall(wilc_module_init); -module_exit(wilc_module_deinit); \ No newline at end of file +module_exit(wilc_module_deinit); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/