Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2070853pxj; Sat, 5 Jun 2021 11:39:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU/8RO+u2TumwxKZ0SvxMElljKbj1e+Qph8AkXsT0yHDyK77taD8bMzhSZGU5YagEdTiwZ X-Received: by 2002:a17:907:7713:: with SMTP id kw19mr9969150ejc.249.1622918386257; Sat, 05 Jun 2021 11:39:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622918386; cv=none; d=google.com; s=arc-20160816; b=fVQM0gX6UTeaGkyiSu/A7vwYbbuJGLySTpUJ7ZqayDwqAVMHjnO2zOZ1EToBZ5lJMr ryOy02AEh0P2fErRy2UOpcDUjqaUg1drJQ9XlFSjjA2maNU1wXyH6qs5OLZCiaIJMGAM Ff4FXszFIA9Bw2leOhVA+Mld6vWuLE54j67iARISSo/xv3ffW4nIiY4I1Ztn6IgbCz8M JQLyijuxTQCJELriGm0uwlo1eO3lWAz+YzzegsbN1vEpjZawIrfsXDv1HiTsLdJlrcK7 eJURP3b9eCr5DzHlVaw+tToYCTnpD5rE2Gv+YgTLw0o58sNOn28g8Ox3dPqxyVOM2laj vlkw== 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=TKKaJykNbAhTZQ676bczWbB76wDopAsX9jsqZCCG1Is=; b=MW/IHFmRxEDiBj5Xe5Dm7qkd6MJYxXIvjMnXeha/mlEGPbldAyHkudwXUlbokiSqeW wkABeuysf2WoUX3QLHwKMxkeZwqJM/V5gtlE+E7ej+1pCkbqId6VPT2bGl50SVEGheum CeZ/74TFKUAayH/bldbwixYgEVuIlVxXlK/eOFasTOmtG63ipgPfLbf908zVq5mWH1uh GpmiGFPMSQSW4LdJ68M5CJ2jg3uJiG6ceYJHL8ERhD8xWKomMeWGdXI9G4uo5UXBFw7V Hi3fv0XwdsqmLjRgxtxRrpA+uHa70cw3nEjLMO8cq+0l+Gk0AFWf5sLktrHQ1vQckS62 RdZg== 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 s6si8522771ejm.200.2021.06.05.11.39.23; Sat, 05 Jun 2021 11:39:46 -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 S229998AbhFESfj (ORCPT + 99 others); Sat, 5 Jun 2021 14:35:39 -0400 Received: from smtprelay0135.hostedemail.com ([216.40.44.135]:38042 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229994AbhFESfh (ORCPT ); Sat, 5 Jun 2021 14:35:37 -0400 Received: from omf05.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id A8334837F24D; Sat, 5 Jun 2021 18:33:47 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf05.hostedemail.com (Postfix) with ESMTPA id EC46BB2793; Sat, 5 Jun 2021 18:33:46 +0000 (UTC) Message-ID: <294bb4a2c3f5f8cf4a744cf59bfd37562653afb9.camel@perches.com> 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:33:45 -0700 In-Reply-To: References: <20210605161219.26421-1-dwaipayanray1@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: EC46BB2793 X-Spam-Status: No, score=-2.90 X-Stat-Signature: b5yzkn4qgyapqtuzt5tzciuzubqacscb X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19AREj44sKeK8Ez8ZCbYDzApueB4bwl2YQ= X-HE-Tag: 1622918026-594305 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dad87c3686326..582f8e07d32d5 100755 --- 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;