Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp347950pxj; Thu, 13 May 2021 06:26:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo1PnMmqdoJG24MCCyDcqW5LVLbs0y5gxLhKaeRPFNmKh3lUATCV/hJTwaMIoiFZPH/buN X-Received: by 2002:a05:6402:144d:: with SMTP id d13mr50429101edx.101.1620912364789; Thu, 13 May 2021 06:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620912364; cv=none; d=google.com; s=arc-20160816; b=F3qrH0sPavL+W5CD7y89hXYIlwkNxUWzP0JE+abu32nVspil7RnmF76s2BHwKdKuSg pS/Sf+VQA6f8jWHKj42+oNDRurWW/ZUNclnDEnj530tm4w55/gvQkCyt7Xx4TCqotkdI iNIjA6m5SrzwWlaZw6hYEKV3V9BfHm88Vc6LjC0zcUZmywgtWlIL3phywCZ5o8mqzIII Em78124CqNrK4LrfW2cDqVOhq+jPZTgBCFz1LuHbOamDhPzJ+DDE3CT2K6f78qMHvd4x xuZah0pu7+S45Nvoytbm9MyawJnTLXNn/Brvw59Z5hmQ8OZYmf93gX5tspt1V2ukxW+H lTDg== 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=529U3Iynmh97xaea8kiyw4vZIch5Xlqs5hVima5KDt4=; b=aGwySNnA4PGoJX1aGO3t2z4bALlyNsRxsQ40mQOE2vJJEwUP8qRhUS1gXrxkeaBxoD zVM0igZfGKfETmTZ4yNKxbGw4g4Z3DQL3/0G/7Sbvmd5hQQIQWbSC+bFMs2qOsfSswWS qS49n6N5j7/mEmW5ISDyUVResd8K7XtGYrnYIKhBhcdQMa26oW67dbHHelFtGCW14wrG deWs6giUzzSpfJ/+NcEvmoiMGfZMf5dTjVRe7h8Su9giOTfuu16adUDUCv9wGjDCCSFS Ph2fTnT/3OHSkpVhVrSTiDwgBm+m8eJeMqmHzgfsqnkLLir3VLKNXzXiChc/iyPTLGld OUYw== 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 t12si2946088eje.621.2021.05.13.06.25.40; Thu, 13 May 2021 06:26:04 -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 S234068AbhEMNZM (ORCPT + 99 others); Thu, 13 May 2021 09:25:12 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:2307 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234071AbhEMNYE (ORCPT ); Thu, 13 May 2021 09:24:04 -0400 Received: from dggeml702-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Fgsfz12jwz19P14; Thu, 13 May 2021 21:18:35 +0800 (CST) Received: from dggpemm500016.china.huawei.com (7.185.36.25) by dggeml702-chm.china.huawei.com (10.3.17.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 13 May 2021 21:22:51 +0800 Received: from [10.67.108.157] (10.67.108.157) by dggpemm500016.china.huawei.com (7.185.36.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 13 May 2021 21:22:51 +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: <017d9fae-328f-e93f-095e-bdfa0cc2f2ff@huawei.com> Date: Thu, 13 May 2021 21:22:44 +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"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.108.157] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500016.china.huawei.com (7.185.36.25) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > . > .