Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp109772pxm; Tue, 22 Feb 2022 07:14:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsYlF8sIpLw8Qs0x2pAcuxZUaY07ZWpYtghaxQ+m4RDKrGZtWd1TYBwinnJIcnI4fsU+1g X-Received: by 2002:a50:c29a:0:b0:400:47b6:a928 with SMTP id o26-20020a50c29a000000b0040047b6a928mr26924356edf.144.1645542895704; Tue, 22 Feb 2022 07:14:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645542895; cv=none; d=google.com; s=arc-20160816; b=D4Ys9oOivEfAReGMGrv85eYhs+tyqcMHy/ob4GccASFHDKV5CXtIRClacxVURPxB+i tqWJdvGnGeE7X2XHWt/2/9VVYO4OGP3fVn1zzW1at5LGGZ1m7CG3bgJVyTpyqPA/BxZG vW1c1/E9P9xuMes2FBLZc/XjdPghsGc2ROAHPkz4NwlGF7iGSrktAxLZ9OXoavRDSDIY MTcy+NMyCYXDjdvbl110Yp2SmfMPAL/hezwYSYY5VHyTIFRe7KAp/s6VKHPxXydN7CS+ MuEmMNZNljLPC0S1dqbeuhS6v8Fsb2YFX3mO5pYkSEokz159GySxBLV+nNKrH64MbcfO hesQ== 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=IdBqVo147Qe3tfKCV1ehaFyHYj9u3Uf0LW8qUkb2hCo=; b=JTZVIRCWAJfzBh2LPjdH3n////orXT5c9QyJZSLihWehk2art5eAzGo/i5zSIIase5 o9ESg2dsk9m4r7LYNvo0zeoGmIM3Q/S45rBQbYIJJJwQAM2dZ1nNyvqzOiG0ueaoAGVC uti6UUWJHzpEUyolIqWUFSJYKgJEgM1rnYK4sgL0DmLPJv4LAt6gFKU3e+eQ0XjMmL9s 4YkkcFnylYWtyy9ESgqSOSg6vBIEZaSO7Oym9gBKUb5LK4zdNCn7wTiCH40khNjPo5F4 lIraOMg/EBuc2ulurCPKGO+LPE4srgbeWpOyHOeYpOW6Ds9JCqu794tveV04argzpitU e3yQ== 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a25si6255416eds.402.2022.02.22.07.14.33; Tue, 22 Feb 2022 07:14:55 -0800 (PST) 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231462AbiBVL2n (ORCPT + 99 others); Tue, 22 Feb 2022 06:28:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbiBVL2m (ORCPT ); Tue, 22 Feb 2022 06:28:42 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B31F119F26 for ; Tue, 22 Feb 2022 03:28:17 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4K2xhm2jdHzdZSs; Tue, 22 Feb 2022 19:27:04 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 22 Feb 2022 19:28:14 +0800 From: Miaohe Lin To: , CC: , , Subject: [PATCH] mm/hugetlb: use helper macro __ATTR_RW Date: Tue, 22 Feb 2022 19:27:31 +0800 Message-ID: <20220222112731.33479-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Use helper macro __ATTR_RW to define HSTATE_ATTR to make code more clear. Minor readability improvement. Signed-off-by: Miaohe Lin --- mm/hugetlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 1f0cca036f7f..c0405f3c8413 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3498,8 +3498,7 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed) static struct kobj_attribute _name##_attr = __ATTR_WO(_name) #define HSTATE_ATTR(_name) \ - static struct kobj_attribute _name##_attr = \ - __ATTR(_name, 0644, _name##_show, _name##_store) + static struct kobj_attribute _name##_attr = __ATTR_RW(_name) static struct kobject *hugepages_kobj; static struct kobject *hstate_kobjs[HUGE_MAX_HSTATE]; -- 2.23.0