Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp547748pxj; Thu, 13 May 2021 10:56:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym9XGzmm5e065mKqcJZc1V+/rMcwZH9NQhPVdyOuNIVFzEVTTiIOs64g6Ksp8EH2LV3iJH X-Received: by 2002:a9d:1d45:: with SMTP id m63mr15356350otm.302.1620928561570; Thu, 13 May 2021 10:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620928561; cv=none; d=google.com; s=arc-20160816; b=XgY64kKuH2ljQPNdEc44+rORUiOcXe0CrorEfcWzA3zOCzmhv62LfLeMZMlPDC8mpw lDPy8T674zF7tOPJLBwW46mDc1WE7LynFi/TTkiNLtmIgzuVhSla3+ikbxAwWkRkW9Pv LgWEwZPocFPLhHY3lz16/JRk59t3mh2Gb4zM2Ove182E70fK6XPGWA4fw8RqmdkUvD6p mj63nUYeztg/4PU1STSC6p9US/Xx+80brhIZ5DvlMd9Sn0LP8Jo/dHa9YT7mMfJoSIUo BJknFl7nnqP99+VKfhzeszexfMhJH+K0hPx/Xz1bo6/U+cXXRWaEQfSwTd6LDPWFhDP4 WfIA== 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 :message-id:date:subject:cc:to:from; bh=zfSlbtg586njBY2hM52i8Mw12aO7XMpKds5Xmy7n4Mc=; b=g+NebLvw6aNrbWEddGVGQIqqltt9NfV033QvdvUarY3mQPtiz+40XZWqGdTVMcAXPB xtb/WJM6Ntn5VwZsnxNC2r3peOH8DO58nrhyLY8pQj4SAMZgK69lr3NOc/ZO0GQ4q2lm BTk0NdbUKbEjCYMWC693MGKGQ/R/DC9lBW+cULfQQDy6WETUpn6DsJSjTkRY3uu1C9xB d0dnWmxYTPfhTG7HpYfRPrmV/NXwZC9pdr181g2rfsiWOYMbfro0nwExCyZJv0igIIe0 wfsgCOV1VZ7K57ldwb4Kzs+yyRjB+mp2UwncdO0blaHblAqwcjlDvCGlokNG5+ajAZz+ RrbA== 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 x21si4081984ooc.50.2021.05.13.10.55.48; Thu, 13 May 2021 10:56:01 -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 S233296AbhEMLRN (ORCPT + 99 others); Thu, 13 May 2021 07:17:13 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:2473 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233253AbhEMLQz (ORCPT ); Thu, 13 May 2021 07:16:55 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Fgpt111JszBv4Z; Thu, 13 May 2021 19:12:57 +0800 (CST) Received: from huawei.com (10.67.174.117) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Thu, 13 May 2021 19:15:29 +0800 From: Ruiqi Gong To: , Greg Kroah-Hartman CC: Wang Weiyang , , Subject: [PATCH -next] drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO Date: Thu, 13 May 2021 19:07:16 +0800 Message-ID: <20210513110716.25791-1-gongruiqi1@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.174.117] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reported-by: Hulk Robot Signed-off-by: Ruiqi Gong --- drivers/base/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index f449dbb2c746..27f251c2742a 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -233,7 +233,7 @@ static ssize_t name##_show(struct device *dev, \ return sysfs_emit(buf, fmt "\n", \ to_cache_info(dev)->cache_attrs.name); \ } \ -DEVICE_ATTR_RO(name); +static DEVICE_ATTR_RO(name); CACHE_ATTR(size, "%llu") CACHE_ATTR(line_size, "%u")