Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp670308pxj; Thu, 13 May 2021 14:09:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysQuH3yiVh63OeX2vCG3cduJup5/+eWqQqSj+Crgo7MAImfuBvo9ZfRMxxuk6LW5Vg6f3R X-Received: by 2002:a05:6638:cad:: with SMTP id x13mr40454643jad.40.1620940143731; Thu, 13 May 2021 14:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620940143; cv=none; d=google.com; s=arc-20160816; b=j2bwzN6k5N0VMRwGmkoV89Kjy9zb3A3P8AUNSSba6b9ZEbwn99omtlv04VkUSz9THf U4gEYOasUogZU5Rf4Oi2aWE9B9bdND3xJ7xevwkGH7PZwXVnA3RfJbLp024hbpJEO3j9 +sy/RbnVNlDTeEmvZVUEFQTFctbZNwWqYzppWyv3E4SYiQEiilZFHcqaT6kVBVGx2J5l pLIctuBHY0Ept/J7vie4i5YO3ct81zVgJA9f7EIeNPlrwVqwKyef3ZjhKBhYEDvzqPux FINZeO/0OPiltWvDpJucP9AclztXEZ3cf/uk1rxGiU4fLT0wxEwNr+VBaI4k5pJm5ock m/mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=PWJPJ/L3eYh05BXnQYIpwwqCUD2r/zWsBE2R5c4+Tq4=; b=o9fdFeRI+lxJ9Gw9gfomI2QU/EwN1ZRdce427WiIq0+7e4koxqLtXmKjWCDnlEhIUy FCfT4parCgXhb0V680m/HLkHSsZvCS3/e4RU6i5obEB7ziJZIVh0oM05ZGfhqSfXyCh8 J/IEK6gyHHPjWHtBMO4fQa2NIp9gV0M9hfXqH4CeHitwb4g6Gj4upxe0hvZBiTB4EXA2 rq/Nef9sui7GJYa74w2zF9RHG5UEQyDu1cL5q22ZKVyk3zbRU5f10lgAgciUx73/Rf9e +Ug2ydDsCq+1Avu8bmagFz9Fpu670IfN7ic3weN1sXsDABDndupGBAohWZQ5LxXVkbe1 9fXA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si6042974jat.70.2021.05.13.14.07.37; Thu, 13 May 2021 14:09:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234219AbhEMNvB (ORCPT + 99 others); Thu, 13 May 2021 09:51:01 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:2479 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234161AbhEMNu7 (ORCPT ); Thu, 13 May 2021 09:50:59 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FgtHv15tSzBthk; Thu, 13 May 2021 21:47:07 +0800 (CST) Received: from [10.67.108.157] (10.67.108.157) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Thu, 13 May 2021 21:49:40 +0800 Subject: Re: [PATCH -next] drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO To: Greg Kroah-Hartman CC: Wang Weiyang , , References: <20210513110716.25791-1-gongruiqi1@huawei.com> From: Gong Ruiqi Message-ID: Date: Thu, 13 May 2021 21:49:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.108.157] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (Resend for the correct format. Apology from a TB amateur.) On 2021/05/13 19:26, Greg Kroah-Hartman wrote: > On Thu, May 13, 2021 at 07:07:16PM +0800, Ruiqi Gong wrote: >> The Sparse tool reports as follows: >> >> drivers/base/node.c:239:1: warning: >> symbol 'dev_attr_line_size' was not declared. Should it be static? >> drivers/base/node.c:240:1: warning: >> symbol 'dev_attr_indexing' was not declared. Should it be static? >> >> These symbols (and several others) are defined by DEVICE_ATTR_RO(name) in >> CACHE_ATTR(name, fmt), and all of them are not used outside of node.c. So let's >> mark DEVICE_ATTR_RO(name) static to solve these complains from Sparse. > > Why not fix them all at once? Why only one here? Sorry for not making it clear enough. Actually the patch does fix them all. Those symbols reported by Sparse are generated when two of the following macros are expanded: CACHE_ATTR(size, "%llu") CACHE_ATTR(line_size, "%u") CACHE_ATTR(indexing, "%u") CACHE_ATTR(write_policy, "%u") So one fix of the CACHE_ATTR's definition fixs them all. > > thanks, > > greg k-h > . > .