From patchwork Fri Jun 15 22:36:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10467787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4DD14601C2 for ; Fri, 15 Jun 2018 22:37:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 338F32624C for ; Fri, 15 Jun 2018 22:37:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 276E828EAC; Fri, 15 Jun 2018 22:37:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCBC62624C for ; Fri, 15 Jun 2018 22:37:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756730AbeFOWhF (ORCPT ); Fri, 15 Jun 2018 18:37:05 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:10000 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756583AbeFOWhE (ORCPT ); Fri, 15 Jun 2018 18:37:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1529102225; x=1560638225; h=from:to:cc:subject:date:message-id; bh=lJuT57A86cE27FtLD2LCfzCofP0VvbNf0NwdzixKXdo=; b=YJZ3pnSlzqX36bU7fMLsJzCT3yGJeWP8fQpwse+lolnH6ygro3NQ61kz SbX9PDFJJ86XyQdYaByw94uvLfaNI6zaIZeDPaG7PKnvUEFu6KeereHDo /E13QJyimhxV2rAz+O/BUOQs8Kstk7Wt95kq6SxZH8IU25xyWFUCGNqK8 cp4s14h+QJLs9mTpiA00TRtn3yX86OLg9XT5iiWrgSGugJLmBMB3dxjFp e2Um1yqZTJqoCOorHUyY2k/cLzU+DRpkokoNpPUZiUfZPgsCCt0W7ijxP PjxTnOGlk+oS8FPeCksgk0O4cOxlKgm+Ho74TiRn1ayRIwtYYDvf/8VmH A==; X-IronPort-AV: E=Sophos;i="5.51,228,1526313600"; d="scan'208";a="81646777" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 16 Jun 2018 06:37:01 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 15 Jun 2018 15:27:08 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 15 Jun 2018 15:37:00 -0700 From: Bart Van Assche To: Chris Mason Cc: Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, Bart Van Assche , Jeff Mahoney Subject: [PATCH] btrfs: Fix a C compliance issue Date: Fri, 15 Jun 2018 15:36:59 -0700 Message-Id: <20180615223659.32420-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The C programming language does not allow to use preprocessor statements inside macro arguments (pr_info() is defined as a macro). Hence rework the pr_info() statement in btrfs_print_mod_info() such that it becomes compliant. This patch allows tools like sparse to analyze the BTRFS source code. Fixes: 62e855771dac ("btrfs: convert printk(KERN_* to use pr_* calls") Signed-off-by: Bart Van Assche Cc: Jeff Mahoney Cc: David Sterba --- fs/btrfs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 81107ad49f3a..dd4980df5b8e 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2369,7 +2369,7 @@ static __cold void btrfs_interface_exit(void) static void __init btrfs_print_mod_info(void) { - pr_info("Btrfs loaded, crc32c=%s" + static const char fmt[] = KERN_INFO "Btrfs loaded, crc32c=%s" #ifdef CONFIG_BTRFS_DEBUG ", debug=on" #endif @@ -2382,8 +2382,8 @@ static void __init btrfs_print_mod_info(void) #ifdef CONFIG_BTRFS_FS_REF_VERIFY ", ref-verify=on" #endif - "\n", - crc32c_impl()); + "\n"; + printk(fmt, crc32c_impl()); } static int __init init_btrfs_fs(void)