Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp59333ybt; Tue, 23 Jun 2020 15:16:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7jyJlmigjxdXK/rzmWFtvi4TwT7bmzleq9JE4HorQMvVnkZs6s2XTvUjt5G5htPhEyHz0 X-Received: by 2002:a17:907:20ee:: with SMTP id rh14mr22422782ejb.395.1592950580492; Tue, 23 Jun 2020 15:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592950580; cv=none; d=google.com; s=arc-20160816; b=DSkPf/2K0YD/AC5Y1E2Uua+WQByy5pEWvXpxinat+70FZ9pyg7Ltmb3dfcORznIsBo IY2hj8/16rHGhHltVnbxS/19QYO8OpMBcM/w+/ojkqDVUPjrTfiXeSqWv2UCcFN/MfhS ifSx1b8NTt6bhnrmmuyaWdB9lmZHLlUjWHuEKxSw+sVlNkLGKF7ryJWieNIzJkDXNrjN 5XS0ptV8JJZU2MfAo+cZi0dKcQiKdEC36f5i6vBhAVcOKCtMXossBhAnmzBsMTae9KYT NcyZAu3JwftiSCiXoA7ofFwM8P1XQI9N4f2aSdjLdKOPWrsSZuLBVKKxz2BlvZhfw5n4 mQXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=25Ut+90unfc/17zR5QP1XFu2lQ+gkSVHUM/pNIHUamo=; b=XldxWcRJu3+ARlSZL9q5Ln7ow4/LdZ+Ubm9751LqKBTBk6V1J41eMsPGsOKWOcyOft HJNj6HWzprowgbYKnJYeF6wWxLjCCVhH1/yN6BFgC4VAk+trVva3QDQabTShbEzbbItt q6Fh0MT0DH8WxIH370rDru7VGwSmW80X/2pQ7XPTaaBOgm+E/0msAtNsLXHqDcW3wK1/ S5C0YZLPR51PDzuDNqVOs+KY1HOPxEw/n1ldOhSpDOIe0rSkdR//3L0psDJftHSqBif+ RYcu4SUIdbDantUiVUGTB/Ix3rJR1yis5elKjyysHUIPOWD+X8uCZea8Pt2sTAcCr67j sXxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@isovalent-com.20150623.gappssmtp.com header.s=20150623 header.b=QWwvalzB; 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 du14si7413867ejc.721.2020.06.23.15.15.57; Tue, 23 Jun 2020 15:16:20 -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; dkim=pass header.i=@isovalent-com.20150623.gappssmtp.com header.s=20150623 header.b=QWwvalzB; 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 S2388823AbgFWWPq (ORCPT + 99 others); Tue, 23 Jun 2020 18:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388062AbgFWWPp (ORCPT ); Tue, 23 Jun 2020 18:15:45 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4243FC061573 for ; Tue, 23 Jun 2020 15:15:44 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id h18so173437qvl.3 for ; Tue, 23 Jun 2020 15:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=25Ut+90unfc/17zR5QP1XFu2lQ+gkSVHUM/pNIHUamo=; b=QWwvalzBaMOov3jyg7ZlDqMdpGmOXFv+H0bRVWqpuxO7B0uAWJnCyTQiAOI0tgHwB7 CvT+YGWcpO5uVVcaO8lIaGGXmlyPa+YTDzHlkQWibomUzo/z94EKTGPGF990wWmYtKKa XPfG1ZCjhqKgyMxmd/le6unBuqrUqWTRp72ijuUuRmrg4Iv475uwnTxRt+Jly2YYUD3d bEoFRQPDvKX9FAocXcGZQMfK00U/g4oZH7X8c/2tPg6YXI70xA9xBknE/HtxDQB8u5VS 4oB4YAbW1jDws9NuV1lGwZfvyPo/FJnCJL+E/CjMPM/vBAMjXTgcICmjai8BX9kBHhY+ R07Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=25Ut+90unfc/17zR5QP1XFu2lQ+gkSVHUM/pNIHUamo=; b=qmtVWVu0avLfB2eHHekV5YzV0/xiGKtgn79VG6PJnjcGHnYk9NuToO5H6bOehKc2v9 la/nZzS72EuaeW7pOYcE88fPq8NyyEMFAreAX3/o3oC0VQg6+6tvQOdAQWGyNm6E0Ig3 UszJltcbzIDm4/efPkPAJJYrxEBgmbrxBnW2iWbwK9vYdWooG6LeK6TggSv4FCio1eBK IU6x3Ykv2vA1Ns0dD8kUfnDHjNbk8R0tkHVnRq27ftUMuYmLOgKBoXmFbjiycnzJwTP1 FR0XHv+K3JlH3Zpl9GcvfFg4juU2wJgXJwMY2mgWCTw6ZVN6IiP7BX5qaPZLZzPa/P9c CcgA== X-Gm-Message-State: AOAM533o8UGboLxVwUc6JgQ19KOw6tbLClY2oSPnyElQOoTi88TDncYx 04oTbbOeaTGL+k19kp8Mfs78WP2UBMRCpigKntP59Q== X-Received: by 2002:a05:6214:964:: with SMTP id do4mr29164894qvb.84.1592950543505; Tue, 23 Jun 2020 15:15:43 -0700 (PDT) MIME-Version: 1.0 References: <20200623103740.25876-1-quentin@isovalent.com> <895052df95b2fc85b07e5a493fbb1ff415d8f62c.camel@perches.com> In-Reply-To: <895052df95b2fc85b07e5a493fbb1ff415d8f62c.camel@perches.com> From: Quentin Monnet Date: Tue, 23 Jun 2020 23:15:32 +0100 Message-ID: Subject: Re: [PATCH v2] checkpatch: fix CONST_STRUCT when const_structs.checkpatch is missing To: Joe Perches Cc: Andy Whitcroft , Andrew Morton , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Jun 2020 at 17:48, Joe Perches wrote: > > Hi again. > > On Tue, 2020-06-23 at 11:37 +0100, Quentin Monnet wrote: > > Checkpatch reports warnings when some specific structs are not declared > > as const in the code. The list of structs to consider was initially > > defined in the checkpatch.pl script itself, but it was later moved to a= n > > external file (scripts/const_structs.checkpatch), in commit bf1fa1dae68= e > > ("checkpatch: externalize the structs that should be const"). This > > introduced two minor issues: > [] > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > [] > > @@ -770,7 +770,7 @@ sub read_words { > > next; > > } > > > > - $$wordsRef .=3D '|' if ($$wordsRef ne ""); > > + $$wordsRef .=3D '|' if (defined($$wordsRef) && $$= wordsRef ne ""); > > perl is a weird language and the $$wordsRef ne "" test > isn't required as the append will work even if the > thing being appended to isn't defined. > > You can read the perlsyn docs > http://perldoc.perl.org/perlsyn.html > or > https://stackoverflow.com/questions/2166575/when-is-it-ok-to-use-an-undef= ined-variable-in-perl-with-warnings-enabled I didn't want to touch $typeOtherTypedefs in v2, and I thought I needed that =C2=AB $$wordsRef ne "" =C2=BB for the "read_words(\$typeOtherTypedefs, $typedefsfile)" where the variable was defined but possibly empty? Anyway, thanks for the lore and the links :). > > so perhaps remove the test and improve the additional > $typedefsfile use too Agreed, your version looks better. I'll resubmit a v3 with your suggestions, please feel free to comment and add a "Co-authored-by:" tag if you feel this is appropriate. Thank you, Quentin