Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5520193rwl; Tue, 11 Apr 2023 06:40:06 -0700 (PDT) X-Google-Smtp-Source: AKy350bPwGb9X5D8WBf3AwNyFRAKW9EuAZrA9NdQiDuGp7HXHyx1AuYbxoYs9I996obR068ytqxE X-Received: by 2002:a17:906:65d4:b0:932:fc34:88f with SMTP id z20-20020a17090665d400b00932fc34088fmr11408961ejn.11.1681220406485; Tue, 11 Apr 2023 06:40:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681220406; cv=none; d=google.com; s=arc-20160816; b=vrbRCyxNBwI7nBVKL6wZH3xna+lWtg7fnChkvCWiPQQxlwnYeTJJ5vXRQjReq3wKeo GFnmYnSCtbjQi8r1KVggRsL7cUlJ1dpfJ1bODwNCv+a+t4YUQox9tcQSaWBDavwFHGMR SAZKanmSD6GmQT6yQj+hNeaAKH/l/WZ2NwPlsw9pj+u/1soRwomWNWDrdc1PGDzx/oyP ih3ExxbyzMbkotk9gJA1i9lkZDzQzpY3ya8SzpRH8yIiI6DSUc6hah1/O57er//WbpwZ NIX8sQD6ittrYE1epQrV/KHW4P9CYRodfqmoAYh/d5QCAM9s4Vii4JCwh8OjnppxluBP 7eJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=tru9Y6AosokoRhQyCmLCLxfWQVPa5Y+XlvVaD+YVIK4=; b=BXw4arK5kOQTe1x5UVpF8kZWTrxrjPSsWnHuSKNysWYb600ZYCKucWCgRSyr8R/4va bDq0trGNeeOuF3cMBA81GiXDenT5RX5AJdjrp1h/Px6AbKLibJ1WCFYJ6gGjEqHEpNei s38zrYo83QiZB/oPbLBkwmLlgrAK+EVLD9lk1uHJ4dA4H0vbmyz3CwbvpxfVCJucN4hr XCzvKbwfojXGHL73S7EudMpclnHm9w7mFDmTKEjv+GmFnlPaDq5cpcWsZOasNovBW2aU 7Ojrk4Ale9vo1UhwOgMgooR0lJwe+Kn+gyJbjIf2DclRjUJUIPK+63XqfQpZNd3VAMqe ZlTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn9-20020a1709070d0900b00947c4925900si12675192ejc.348.2023.04.11.06.39.41; Tue, 11 Apr 2023 06:40:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229499AbjDKNi5 (ORCPT + 99 others); Tue, 11 Apr 2023 09:38:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbjDKNiw (ORCPT ); Tue, 11 Apr 2023 09:38:52 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 573D419AB for ; Tue, 11 Apr 2023 06:38:51 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="327715774" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="327715774" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 06:38:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="691148175" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="691148175" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP; 11 Apr 2023 06:38:16 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pmECN-00FHXp-0Z; Tue, 11 Apr 2023 16:38:15 +0300 Date: Tue, 11 Apr 2023 16:38:14 +0300 From: Andy Shevchenko To: =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= Cc: Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org, =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= Subject: Re: [RFC PATCH] checkpatch: Support __initconst combined with struct definition Message-ID: References: <20230301094320.15954-1-bjorn@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230301094320.15954-1-bjorn@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=1.0 required=5.0 tests=SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 01, 2023 at 10:43:20AM +0100, Bj?rn T?pel wrote: > From: Bj?rn T?pel > > Checkpatch sometimes report a false positive for __initconst. E.g., for the > following snippet: > > | static const struct strspn_test { > | const char str[16]; > | const char accept[16]; > | const char reject[16]; > | unsigned a; > | unsigned r; > | } tests[] __initconst = { > | { "foobar", "", "", 0, 6 }, > | { "abba", "abc", "ABBA", 4, 4 }, > | { "abba", "a", "b", 1, 1 }, > | { "", "abc", "abc", 0, 0}, > | }; > > checkpatch would report: > > | ERROR: Use of __initconst requires a separate use of const > | #190: FILE: ./test_string.c:190: > | + } tests[] __initconst = { > > Improve the reporting by trying harder to find the 'const'. Joe, what do you think about this? -- With Best Regards, Andy Shevchenko