From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935294AbdAJPEy (ORCPT ); Tue, 10 Jan 2017 10:04:54 -0500 Received: from s3.sipsolutions.net ([5.9.151.49]:52120 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755403AbdAJPEh (ORCPT ); Tue, 10 Jan 2017 10:04:37 -0500 Message-ID: <1484060672.1014.1.camel@sipsolutions.net> Subject: Re: [PATCH] checkpatch: don't warn on every struct without const_structs file From: Johannes Berg To: Joe Perches , Andrew Morton Cc: linux-kernel@vger.kernel.org Date: Tue, 10 Jan 2017 16:04:32 +0100 In-Reply-To: <1484060517.2106.38.camel@perches.com> References: <20170110140318.737-1-johannes@sipsolutions.net> <1484060517.2106.38.camel@perches.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-01-10 at 07:01 -0800, Joe Perches wrote: > On Tue, 2017-01-10 at 15:03 +0100, Johannes Berg wrote: > > From: Johannes Berg > > > > The script says that it won't warn: > > "No structs that should be const will be found [...]" > > > > but then that doesn't work and it warns on every single struct > > instead, since the regular expression ends up empty. Fix that > > by checking that it's not empty first. > > nak. > > How does const_structs end up empty for you? I copied checkpatch elsewhere and ran it. Regardless, the current code is utterly stupid - it prints a warning that it won't flag any structs, and then proceeds to flag all structs. If you must, send a patch to abort() [whatever the perl equivalent is] when the file can't be found, but as it is, the code is just idiotic. johannes