From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F13471E9B37 for ; Fri, 20 Feb 2026 11:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771588039; cv=none; b=FhiA9p8atZ2lYWIam4kF7Imt2jG5lYzsaO84hf4J9yUU0evBBQbBz6AbK3RXIYsGXAPtAA87DDH8Efo6WktdKvWHm5HbvZBO+fuIsYHdhWWBOFD2ih88w9wVSYqEbor1H1BPXCQQdF+wBhdLAR5RFgUHZup7o8WlDlkuRPxcMV8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771588039; c=relaxed/simple; bh=gamF4O54lIu1TtGj0/6PdwI4mb+zMaE27IQp0p9IJgk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LYb9lJJcW2Rt/ZKJHi8QTF1gSzY0YLUIn/7zmisUDExVjfojIrBjAYO+zk0DzUOTI3C+xWOH+LgnaXLW5n1+SxbcxFT09uOMCKK9pr2HDjRvmEzEVUrCoJ6cN7o+6WOwRgkJ3FuByuXZQMsElK12d7g80DD/vfdbmKe8D9coM04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=dAWnzlIR; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=MRvQlYrz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=dAWnzlIR; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=MRvQlYrz; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="dAWnzlIR"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="MRvQlYrz"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="dAWnzlIR"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="MRvQlYrz" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2E0833E6F4; Fri, 20 Feb 2026 11:47:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1771588036; h=from:from:reply-to: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=to6a4yG5PiIi4SLgvFo4Iz6xxLwRG/rmKfMW4ZLFef8=; b=dAWnzlIR5IcrGOwUWv1KCqlpNQm/NyQCDYP+ifSij/JtWWXRAF7hz5g5cRrc6ktCwtCX+w Qqfm/GXFvr5el4wO5WphcCwrGZ8JBCWKcTBB+eCqCaGGVhx57RZEHC4HB8TH6xAWSIn8gu ReUH43lHBdj4U2cgPDPvDVeIBHJizIQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1771588036; h=from:from:reply-to: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=to6a4yG5PiIi4SLgvFo4Iz6xxLwRG/rmKfMW4ZLFef8=; b=MRvQlYrzKLWgNprBFkFl1mBcFAHIApzR+Oq813n7qMAukyn5BUfkz0DMI51rsh4CY3qSJK RuPEvTRrdPOPmbCw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1771588036; h=from:from:reply-to: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=to6a4yG5PiIi4SLgvFo4Iz6xxLwRG/rmKfMW4ZLFef8=; b=dAWnzlIR5IcrGOwUWv1KCqlpNQm/NyQCDYP+ifSij/JtWWXRAF7hz5g5cRrc6ktCwtCX+w Qqfm/GXFvr5el4wO5WphcCwrGZ8JBCWKcTBB+eCqCaGGVhx57RZEHC4HB8TH6xAWSIn8gu ReUH43lHBdj4U2cgPDPvDVeIBHJizIQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1771588036; h=from:from:reply-to: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=to6a4yG5PiIi4SLgvFo4Iz6xxLwRG/rmKfMW4ZLFef8=; b=MRvQlYrzKLWgNprBFkFl1mBcFAHIApzR+Oq813n7qMAukyn5BUfkz0DMI51rsh4CY3qSJK RuPEvTRrdPOPmbCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 89CE63EA65; Fri, 20 Feb 2026 11:47:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id pWlUHsNJmGmOcAAAD6G6ig (envelope-from ); Fri, 20 Feb 2026 11:47:15 +0000 Date: Fri, 20 Feb 2026 12:47:12 +0100 From: Petr Vorel To: linux-kernel@vger.kernel.org Cc: Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Kory Maincent , Tom Rini , Simon Glass , Kuan-Wei Chiu Subject: Re: [PATCH 2/2] checkpatch: Add --conf-dir option Message-ID: <20260220114712.GA383689@pevik> Reply-To: Petr Vorel References: <20260202144221.76765-1-pvorel@suse.cz> <20260202144221.76765-2-pvorel@suse.cz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260202144221.76765-2-pvorel@suse.cz> X-Spam-Score: -2.00 X-Spam-Level: X-Spamd-Result: default: False [-2.00 / 50.00]; BAYES_HAM(-3.00)[99.99%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; HAS_REPLYTO(0.30)[pvorel@suse.cz]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TAGGED_RCPT(0.00)[]; RCPT_COUNT_SEVEN(0.00)[9]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[canonical.com,perches.com,gmail.com,bootlin.com,konsulko.com]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; REPLYTO_EQ_FROM(0.00)[] X-Spam-Flag: NO Hi, gently ping about the patchset. We can keep the functionality out of tree, but I suppose more project which use checkpatch.pl would benefit from it. Kind regards, Petr > This allows to directly use project configuration file for projects > which vendored checkpatch.pl (e.g. LTP or u-boot). > Options from the configuration file has been read before processing > command line options with Getopt::Long since the start (000d1cc1829f9) > because options read from config file needs to be unshifted from command > line arguments (@ARGV) before processing with Getopt::Long. Therefore > parse --conf-dir with direct reading @ARGV. > Signed-off-by: Petr Vorel > --- > @ARGV can be probably processed cleaner. > Kind regards, > Petr > scripts/checkpatch.pl | 31 +++++++++++++++++++++++++++++-- > 1 file changed, 29 insertions(+), 2 deletions(-) > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 8fffdf9e7f85f..7e19287d452d8 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -58,6 +58,7 @@ my @ignore = (); > my $help = 0; > my $configuration_file = ".checkpatch.conf"; > my $def_configuration_dirs = ".:$ENV{HOME}:.scripts"; > +my $configuration_dir = ""; > my $max_line_length = 100; > my $ignore_perl_version = 0; > my $minimum_perl_version = 5.10.0; > @@ -144,12 +145,14 @@ Options: > is a terminal ('auto'). Default is 'auto'. > --kconfig-prefix=WORD use WORD as a prefix for Kconfig symbols (default > ${CONFIG_}) > + --conf-dir=DIR directory with $configuration_file configuration file > + (default:$def_configuration_dirs) > -h, --help, --version display this help and exit > When FILE is - read standard input. > Script searches for a configuration file $configuration_file in path: > -$def_configuration_dirs > +$def_configuration_dirs (can be overwritten by --conf-dir) > EOM > exit($exitcode); > @@ -241,7 +244,31 @@ sub list_types { > exit($exitcode); > } > -my $conf = which_conf($configuration_file, $def_configuration_dirs); > +# parse --conf-dir before the other options > +my @argv; > +while (@ARGV) { > + my $arg = shift @ARGV; > + if ($arg eq '--conf-dir') { > + $configuration_dir = shift @ARGV; > + die "--conf-dir requires value" unless ($configuration_dir); > + } elsif ($arg =~ /^--conf-dir=(.+)$/) { > + $configuration_dir = $1; > + die "--conf-dir requires value" unless ($configuration_dir); > + } else { > + push @argv, $arg; > + } > +} > +@ARGV = @argv; > + > +my $conf; > +if ($configuration_dir) { > + die "Dir. $configuration_dir does not exist" unless (-d $configuration_dir); > + $conf = "$configuration_dir/$configuration_file"; > + die "File $conf does not exist" unless (-f $conf); > +} else { > + $conf = which_conf($configuration_file, $def_configuration_dirs); > +} > + > if (-f $conf) { > my @conf_args; > open(my $conffile, '<', "$conf")