Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp486050imn; Tue, 26 Jul 2022 00:48:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uc3Nj7sn42ZuHCBSdnF3PNrGcKFhpCkAsKAI8e+6ekA55NoHxxYNqETCn3CLBc76K0PN0k X-Received: by 2002:a17:907:1b03:b0:6ff:78d4:c140 with SMTP id mp3-20020a1709071b0300b006ff78d4c140mr13317665ejc.554.1658821713446; Tue, 26 Jul 2022 00:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658821713; cv=none; d=google.com; s=arc-20160816; b=Wj0EabGJhL9yhrnJallOI9TyMP9b1xqqsxrZcrjSSQ0jQBbjH56pYgI2LBh3A4xKTv S2v5KN3yT53oJofJzXbguZfpNcCfCwZbNJEQH1tT+4reXXhvvFdukWtHt7nYAbUicPD3 Qxd8RiC0Q3y8v8hm7VNiOxhqYkG1MZh3dFnCwqcPqMHwdlzDPYDHPOIi8hmPPUXk0Cdz QpoFTtijMtU3aAy7Tk2TWPI4dneT41JOCdpvYK2vgTPPcyGEmyIz2ksSuBwB8QoXTrY4 bRKiSoMb3r4aF2yvitZSzhgK2Yf12200N46L8Iw0nxELxzE8YFBi9gFgYDkbejyGvUq4 NBEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=vZH4jjl9hEczVGTLrSclPcz/CNDj3oRXL2GKSqr/f3w=; b=uMeochB11tmlcee/lrkjYKd8B/MSQ9DteYxlFJ7/pB9DM+mGKgBsSHVXP60ISQOgU2 eiBfKmB+lQGETEweJGpibf4lMypCwqibbdXKQsy2oxaWtJ+E1ma5Vm8efjw3XvI5IEUr sxPykMHAyCVVbjk5558M8rhKf9IPyHAN+JEWhrR3vFzoRvgxzIyzUebAxI/QpU2HGK8s Kn91jrtllTJ6etP7QJaYr1FlOz8hhi53cue8ONdSF7meN8jZN6mJ8C8T4CTUFwZh47AR bnZUFgKZjaCm9Ngbyx32Bhs5I3l59262eHqChokHV/bfi8/uYX3oezIN45oPXz33lZ+r KxfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TmAISVPo; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=ahDBgmTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a1709061f0f00b0072b3338c3absi14632502ejj.878.2022.07.26.00.48.09; Tue, 26 Jul 2022 00:48:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TmAISVPo; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=ahDBgmTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238175AbiGZHqI (ORCPT + 99 others); Tue, 26 Jul 2022 03:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237720AbiGZHqH (ORCPT ); Tue, 26 Jul 2022 03:46:07 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26718DEB4; Tue, 26 Jul 2022 00:46:05 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DCAC234DAD; Tue, 26 Jul 2022 07:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658821563; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vZH4jjl9hEczVGTLrSclPcz/CNDj3oRXL2GKSqr/f3w=; b=TmAISVPoxl0qgnHOoRIOpQMSbHUntCPFfwVCYv6pqm7R9yh7GANqMB6r1F4i1GL4NP5OH4 iNiPxMYa+0E5PM42WPgudNmvnO1b7twZvBZBnsEfxSEdJtTLwo6ftbybtUR08Sg92c0hZ1 OcSpgKEWeUO7NqiJe2cLYC54HcfPSjk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658821563; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vZH4jjl9hEczVGTLrSclPcz/CNDj3oRXL2GKSqr/f3w=; b=ahDBgmTLf2zM8fQzwRHzEN2vrTerxWAC9BL8nEsbtm18n6EFZGgAvJBtl1AWtsNcFM1ASs RbrWHuvox7vFYPAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A828813322; Tue, 26 Jul 2022 07:46:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WGRAKLub32JxcgAAMHmgww (envelope-from ); Tue, 26 Jul 2022 07:46:03 +0000 Date: Tue, 26 Jul 2022 09:46:03 +0200 Message-ID: <871qu8tiys.wl-tiwai@suse.de> From: Takashi Iwai To: Namjae Jeon Cc: Takashi Iwai , Joe Perches , linux-fsdevel@vger.kernel.org, Sungjong Seo , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] exfat: Expand exfat_err() and co directly to pr_*() macro In-Reply-To: References: <20220722142916.29435-1-tiwai@suse.de> <20220722142916.29435-4-tiwai@suse.de> <0350c21bcfdc896f2b912363f221958d41ebf1e1.camel@perches.com> <87edyc2r2e.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Jul 2022 09:02:40 +0200, Namjae Jeon wrote: > > 2022-07-23 17:04 GMT+09:00, Takashi Iwai : > > On Sat, 23 Jul 2022 09:42:12 +0200, > > Joe Perches wrote: > >> > >> On Fri, 2022-07-22 at 16:29 +0200, Takashi Iwai wrote: > >> > Currently the error and info messages handled by exfat_err() and co > >> > are tossed to exfat_msg() function that does nothing but passes the > >> > strings with printk() invocation. Not only that this is more overhead > >> > by the indirect calls, but also this makes harder to extend for the > >> > debug print usage; because of the direct printk() call, you cannot > >> > make it for dynamic debug or without debug like the standard helpers > >> > such as pr_debug() or dev_dbg(). > >> > > >> > For addressing the problem, this patch replaces exfat_msg() function > >> > with a macro to expand to pr_*() directly. This allows us to create > >> > exfat_debug() macro that is expanded to pr_debug() (which output can > >> > gracefully suppressed via dyndbg). > >> [] > >> > diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h > >> [] > >> > @@ -508,14 +508,19 @@ void __exfat_fs_error(struct super_block *sb, int > >> > report, const char *fmt, ...) > >> > #define exfat_fs_error_ratelimit(sb, fmt, args...) \ > >> > __exfat_fs_error(sb, __ratelimit(&EXFAT_SB(sb)->ratelimit), \ > >> > fmt, ## args) > >> > -void exfat_msg(struct super_block *sb, const char *lv, const char *fmt, > >> > ...) > >> > - __printf(3, 4) __cold; > >> > + > >> > +/* expand to pr_xxx() with prefix */ > >> > +#define exfat_msg(sb, lv, fmt, ...) \ > >> > + pr_##lv("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__) > >> > + > >> > #define exfat_err(sb, fmt, ...) \ > >> > - exfat_msg(sb, KERN_ERR, fmt, ##__VA_ARGS__) > >> > + exfat_msg(sb, err, fmt, ##__VA_ARGS__) > >> > #define exfat_warn(sb, fmt, ...) \ > >> > - exfat_msg(sb, KERN_WARNING, fmt, ##__VA_ARGS__) > >> > + exfat_msg(sb, warn, fmt, ##__VA_ARGS__) > >> > #define exfat_info(sb, fmt, ...) \ > >> > - exfat_msg(sb, KERN_INFO, fmt, ##__VA_ARGS__) > >> > + exfat_msg(sb, info, fmt, ##__VA_ARGS__) > >> > +#define exfat_debug(sb, fmt, ...) \ > >> > + exfat_msg(sb, debug, fmt, ##__VA_ARGS__) > >> > >> I think this would be clearer using pr_ directly instead > >> of an indirecting macro that uses concatenation of that > >> obscures the actual use of pr_ > >> > >> Either: (and this first option would be my preference) > >> > >> #define exfat_err(sb, fmt, ...) \ > >> pr_err("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__) > >> #define exfat_warn(sb, fmt, ...) \ > >> pr_warn("exFAT-fs (%s): " fmt "\n", (sb)->s_id, ##__VA_ARGS__) > >> etc... > > > > IMO, it's a matter of taste, and I don't mind either way. > > Just let me know. > Joe has already said that he prefers the first. My question was about the preference of the exfat maintainers :) > Will you send v2 patch-set ? Sure. Takashi