Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2871558ybb; Sun, 22 Mar 2020 09:40:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvX+cISMD0+q3boPhn0mi40YJI8UXCQinwWdJX4lQ0EDIsE72gv7+wm5WhY7iVgYTw3N+pg X-Received: by 2002:a05:6830:22d9:: with SMTP id q25mr316710otc.164.1584895246753; Sun, 22 Mar 2020 09:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584895246; cv=none; d=google.com; s=arc-20160816; b=fgiETr0xqS7Am8FxraWHftSkudLCELNkT6hCyEKFnUPTZHFsLAk9DbgpYcnPXYBDJh G/cwqNBZ002xm8MOPG5BGX1ro5UQeKzYRC+qDbnOCV1YrygMFyi+mdXWFR6L6SCoophF gijEzZ8ga/O1UAxJFIZnJP8IePJ/04pw01/Ck0awRAhDJI6K0BX3Z79GQh8aOc3Mgj9o 15ge1FW+NQXHzu74nuY/yaJjDfPCdGN2B+8Y3PCbpzhuk9S3udiPc7rdU9R5SwXBc/8c hpvl41hAaRcqUF7KjsM1yhSQ9qOTeizfLWAIDqMtyXyteoCHtCQI4kJhzsvn297C9+Hh cv6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=hoOEe12QB17YjFRvC25S/DJKHogKVzn+midIME0zX4k=; b=z3sqyHFlBv4DJfirkdN3emGoVnOZmEhMX/ma/J1WZ285L3++aHFEN2DMjhF85ueR1f WS4BdoyDTvcaup5gAUaoQFuO2NfLDXGxDI0UKLQcxCVDRMKxZYbobRJQcNUTPoJopWaJ /XI8uG9xFe8WiCg4aIxCygrw49iy4VMbuvZZmFd2Zdn0Kmrn+ZRDnG8C0fFq2tuDjaFD AIs++Wjk44Th2+aRA8539GecnC23YrsAXVgOJ2NFqCC57dGraAYrbPmhIIodY87o0C7X 4uhJ9n5NxGoic1m/CpQCmkQGulfwvMtEjZ0mmnECbfeJbFtSrkS1An1PllQ/M3T0zEJg BI5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si6526124oia.62.2020.03.22.09.40.35; Sun, 22 Mar 2020 09:40:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgCVQkI (ORCPT + 99 others); Sun, 22 Mar 2020 12:40:08 -0400 Received: from smtprelay0030.hostedemail.com ([216.40.44.30]:43884 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725881AbgCVQkH (ORCPT ); Sun, 22 Mar 2020 12:40:07 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id AFA5B180178EE; Sun, 22 Mar 2020 16:40:05 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1542:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:3138:3139:3140:3141:3142:3354:3865:3867:3868:3870:3872:4321:4559:4605:5007:6119:6261:7903:8603:10004:11026:11473:11658:11914:12043:12296:12297:12438:12555:12895:12986:13894:14181:14394:14721:21080:21212:21451:21627:30054,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: body50_1dd702395da2b X-Filterd-Recvd-Size: 3629 Received: from joe-laptop.perches.com (unknown [47.151.143.254]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Sun, 22 Mar 2020 16:40:04 +0000 (UTC) From: Joe Perches To: Ryusuke Konishi Cc: linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] nilfs2: Convert __nilfs_msg to integrate the level and format Date: Sun, 22 Mar 2020 09:38:10 -0700 Message-Id: <1d5b32e77f71e41ab7884ab57f1ef9755198b710.1584894497.git.joe@perches.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reduce object size a bit by removing the KERN_ as a separate argument and adding it to the format string. Reduce overall object size by about ~.5% (x86-64 defconfig w/ nilfs2) old: $ size -t fs/nilfs2/built-in.a | tail -1 191738 8676 44 200458 30f0a (TOTALS) new: $ size -t fs/nilfs2/built-in.a | tail -1 190971 8676 44 199691 30c0b (TOTALS) Signed-off-by: Joe Perches --- fs/nilfs2/nilfs.h | 9 ++++----- fs/nilfs2/super.c | 16 +++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index 42395b..979a410 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h @@ -289,9 +289,8 @@ static inline int nilfs_mark_inode_dirty_sync(struct inode *inode) /* super.c */ extern struct inode *nilfs_alloc_inode(struct super_block *); -extern __printf(3, 4) -void __nilfs_msg(struct super_block *sb, const char *level, - const char *fmt, ...); +__printf(2, 3) +void __nilfs_msg(struct super_block *sb, const char *fmt, ...); extern __printf(3, 4) void __nilfs_error(struct super_block *sb, const char *function, const char *fmt, ...); @@ -299,7 +298,7 @@ void __nilfs_error(struct super_block *sb, const char *function, #ifdef CONFIG_PRINTK #define nilfs_msg(sb, level, fmt, ...) \ - __nilfs_msg(sb, level, fmt, ##__VA_ARGS__) + __nilfs_msg(sb, level fmt, ##__VA_ARGS__) #define nilfs_error(sb, fmt, ...) \ __nilfs_error(sb, __func__, fmt, ##__VA_ARGS__) @@ -307,7 +306,7 @@ void __nilfs_error(struct super_block *sb, const char *function, #define nilfs_msg(sb, level, fmt, ...) \ do { \ - no_printk(fmt, ##__VA_ARGS__); \ + no_printk(level fmt, ##__VA_ARGS__); \ (void)(sb); \ } while (0) #define nilfs_error(sb, fmt, ...) \ diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 5729ee..fef482 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -62,19 +62,25 @@ struct kmem_cache *nilfs_btree_path_cache; static int nilfs_setup_super(struct super_block *sb, int is_mount); static int nilfs_remount(struct super_block *sb, int *flags, char *data); -void __nilfs_msg(struct super_block *sb, const char *level, const char *fmt, - ...) +void __nilfs_msg(struct super_block *sb, const char *fmt, ...) { struct va_format vaf; va_list args; + int level; va_start(args, fmt); - vaf.fmt = fmt; + + level = printk_get_level(fmt); + vaf.fmt = printk_skip_level(fmt); vaf.va = &args; + if (sb) - printk("%sNILFS (%s): %pV\n", level, sb->s_id, &vaf); + printk("%c%cNILFS (%s): %pV\n", + KERN_SOH_ASCII, level, sb->s_id, &vaf); else - printk("%sNILFS: %pV\n", level, &vaf); + printk("%c%cNILFS: %pV\n", + KERN_SOH_ASCII, level, &vaf); + va_end(args); } -- 2.24.0