Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2076649pxj; Sat, 5 Jun 2021 11:53:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0O+XSwDsH1mTcNJluMiKB10zBExUE1wKdOImYfQLZPhmqDmrm3uwb/ed50syGyJYNveES X-Received: by 2002:a17:906:390f:: with SMTP id f15mr10405726eje.270.1622919225482; Sat, 05 Jun 2021 11:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622919225; cv=none; d=google.com; s=arc-20160816; b=vfdrNDAEo4N7xa39JK3Xv/QISl9zFOsCjjPZSbrETfbPWK35tftKz7B7iJV94fI8N1 MPVAAmKSppps8GOK8TYIsUTg+ZeFAiyJeyBFXo4ydh5FMu2Krx5yZre3GVpS83JLYA21 OC6iKnxVW4iP0YB0Qb1qwyWEJX1diSa+sjd3KkwbpLrjYP3Dhug6JR6Y52AeyJQrU+Gj PzyQXqj4oXnN41+NzKDTEu0oBsLAwndMjdeQXq5/yYjIWAVphf6dw/go1iKnEO8BqZAn 4SODTjwww2MBS8AxCPGRKQr3XNer5aaE08HcY+avdGvQVTUwBi+SQOYs9US+3hI/sZoL 5u5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=K544+bNS+6YnucDQtme7yDcIFREF3VsnD8E67A6m5oo=; b=NvvWlqnTRR1iv3QD9jbUCcSos3IrcwAsaO6YpaPlud7fy9tgAofV4KxTiAklnjAbll chyczCUqO1r4aHVlBvVkKG1zupbdY++DGjyGAdjhpO43NNfJH8iP/n1UlD2JcoPHO7HY GG7V3M6khdTX396KTAPLe9uNYN7fNvtSm7eLhI5wrHp4DUi96VCYS7gSPANlhMkmIX2z /kKEhx7ziu61d2PafRLxxh/2wSUor2mH0uIPP+dRSNK7LBVxmFujyELruP3f3oPsMCiL AFc/6aZSMDVKcaR7JWPIN0BK94jTDOtJ7vFF/RvW125WJGB3uQz/3gWqJTMLtq4Tt1WV F3/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j10si8071199ejd.87.2021.06.05.11.53.22; Sat, 05 Jun 2021 11:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbhFESyW (ORCPT + 99 others); Sat, 5 Jun 2021 14:54:22 -0400 Received: from smtprelay0106.hostedemail.com ([216.40.44.106]:57466 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229978AbhFESyV (ORCPT ); Sat, 5 Jun 2021 14:54:21 -0400 Received: from omf03.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 7F4E4100E7B40; Sat, 5 Jun 2021 18:52:32 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA id CD57813D94; Sat, 5 Jun 2021 18:52:31 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: Fix check for embedded filename From: Joe Perches To: Dwaipayan Ray Cc: linux-kernel , Lukas Bulwahn Date: Sat, 05 Jun 2021 11:52:30 -0700 In-Reply-To: References: <20210605161219.26421-1-dwaipayanray1@gmail.com> <294bb4a2c3f5f8cf4a744cf59bfd37562653afb9.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: CD57813D94 X-Spam-Status: No, score=-2.90 X-Stat-Signature: edki3jwmtncxxoccdudddjoeenr31p6x X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18xFUiZ5VOIoFu1VXZyB63cvufUd4cccLc= X-HE-Tag: 1622919151-130688 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2021-06-06 at 00:14 +0530, Dwaipayan Ray wrote: > On Sun, Jun 6, 2021 at 12:03 AM Joe Perches wrote: > > On Sat, 2021-06-05 at 23:03 +0530, Dwaipayan Ray wrote: > > > On Sat, Jun 5, 2021 at 10:51 PM Joe Perches wrote: > > > > On Sat, 2021-06-05 at 21:42 +0530, Dwaipayan Ray wrote: > > > > > When checkpatch is run on file contents piped through stdin, > > > > > it may generate false EMBEDDED_FILENAME warnings if the > > > > > --file flag is used. > > > > > > > > I think this is a "don't do that" scenario and this change > > > > is not necessary. > > > > > > > > > > Okay then. I will drop this. > > > Sorry for the noise. > > > > I think you want something like this: > > --- > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > > @@ -331,6 +331,7 @@ help(0) if ($help); > > > > ?die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix)); > > ?die "$P: --verbose cannot be used with --terse\n" if ($verbose && $terse); > > +die "$P: -f/--file requires at least one filename\n" if ($file && $#ARGV < 0); > > > > ?if ($color =~ /^[01]$/) { > > ????????$color = !$color; > > > > Yes, that's nice. > Most of the checks don't work with piped input when --file > is specified. So disabling it will avoid any confusion. > > I can send in a patch if it's okay with you. Fine by me. You noticed, your patch...