Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp18887pxj; Thu, 13 May 2021 19:34:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFwCd5BeZpK/ztRDGAMm9mfxXraR98Ydhizk0JixD3FLSxWn5HP9IYmd6OK1lELht2q9ie X-Received: by 2002:a92:c0cd:: with SMTP id t13mr29378035ilf.280.1620959641990; Thu, 13 May 2021 19:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620959641; cv=none; d=google.com; s=arc-20160816; b=ssMAj8VGuAbbd8BWQsGkFPxvAhIZOaWgm8Fs+g8uQkj8wFD/V1X4App0aFaZMJzla5 2jt1EABoPFDPxGsLlL/W6bfSZASCgFuf1KOsKm1PCXcMR9c8pyz6i5ZGmkal84o9caR9 IWQaVQsFOTxgqeV33s+RJSMX9qriwbR5HrZr7WB+LTpPYMS7tVDi4IXE+TOKE27xRtpL wBYCkGXGGKvjMh6a3nrazwSsiEzAFzS8UmUkmzfhvA81sDlI+cywM2hpWmC9dd/vSszx Ictby9ptWwUy0lbtmzRlRIipovimMhK5BDP7YpgpXRxRm/6cFq9wnHVQvn3IXV18OHHR X5DQ== 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=lkIiCvgSwmLjwnFfUo01XHHO4BJtyq8LILC4oTEnR8o=; b=X1NwxI46spOJfZQXFSQ5+DW76QdoOHqiuuiH2rASAuAQaDL8gmOWvyCKxmprOnhbUD drUVZdhld/FbDFZGrDs96qtuHsulEN0XmeHoRF3ItwCHMfQx0WqBi9jUs25JDqpLHYeV XICyIkroN430Nwasav4ZE+ZO0P/jrGRu4cb7kVCtNTL+DKtxFNVdoVFjxsmEobfGV+SY nCVlOHJMf6Anih9aeSdd+FnrzyZEsHbw3Bhj/s5uhHNPJaY4A+ZCBQBsrxDYf/RKv2Cy /mHNexu8qYiVd9qjzOP4pGOE2pyy6+/0wb1iFJdGAVRW41fGLupxekL2JXeZqO0zkCN2 yIhg== 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 d7si6689671jak.52.2021.05.13.19.33.36; Thu, 13 May 2021 19:34: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 S230319AbhENCPY (ORCPT + 99 others); Thu, 13 May 2021 22:15:24 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3663 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbhENCPW (ORCPT ); Thu, 13 May 2021 22:15:22 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FhBpm4w9Jz1BMNZ; Fri, 14 May 2021 10:11:28 +0800 (CST) Received: from huawei.com (10.67.174.117) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Fri, 14 May 2021 10:14:02 +0800 From: Ruiqi Gong To: , Greg Kroah-Hartman CC: Wang Weiyang , , Subject: [PATCH -next v2] drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO Date: Fri, 14 May 2021 10:05:48 +0800 Message-ID: <20210514020548.32483-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 Mark DEVICE_ATTR_RO(name) in CACHE_ATTR(name, fmt)'s definition as static to fix the following Sparse tool reports: 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? Where dev_attr_{line_size,indexing} are generated by CACHE_ATTR's expansion. Reported-by: Hulk Robot Signed-off-by: Ruiqi Gong --- v2: Rewrite the commit message 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")