From patchwork Tue Mar 22 21:40:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CB88C4332F for ; Tue, 22 Mar 2022 21:40:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1B446B0087; Tue, 22 Mar 2022 17:40:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF2E36B0099; Tue, 22 Mar 2022 17:40:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE2566B009A; Tue, 22 Mar 2022 17:40:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 939456B0087 for ; Tue, 22 Mar 2022 17:40:08 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5A75CA4DA0 for ; Tue, 22 Mar 2022 21:40:08 +0000 (UTC) X-FDA: 79273340496.23.2265167 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf17.hostedemail.com (Postfix) with ESMTP id D727040027 for ; Tue, 22 Mar 2022 21:40:07 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D91A8B81DB1; Tue, 22 Mar 2022 21:40:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B83CC340EC; Tue, 22 Mar 2022 21:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985205; bh=KKk2x1Qh9+LAcEVgwchDKX9W0sw8zLTq+JS0aVNeOxg=; h=Date:To:From:In-Reply-To:Subject:From; b=r4KU2W6OIDfP8YxqZqSkQ8QSLurC76UrkRQKj7L8F88PlEG8ANvcjMsbZQ8Oolvpv KgS7YIJnQ4wAvsy7FoEESCMmmqQaVCeIvx6Ac9Z5IweQp4xld0l0KhvqdJCMdkB7QF vrsMq4f6msQrXimeMG3r347fUNumRxlfnZZR7dQ8= Date: Tue, 22 Mar 2022 14:40:04 -0700 To: hughd@google.com,linmiaohe@huawei.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 031/227] mm: shmem: use helper macro __ATTR_RW Message-Id: <20220322214005.7B83CC340EC@smtp.kernel.org> X-Stat-Signature: rmfyfeh43dqwhodutypmsw1g6zmoahjz Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=r4KU2W6O; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D727040027 X-HE-Tag: 1647985207-207464 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Miaohe Lin Subject: mm: shmem: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define shmem_enabled_attr to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220312082252.55586-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Hugh Dickins Signed-off-by: Andrew Morton --- mm/shmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/mm/shmem.c~mm-shmem-use-helper-macro-__attr_rw +++ a/mm/shmem.c @@ -3965,8 +3965,7 @@ static ssize_t shmem_enabled_store(struc return count; } -struct kobj_attribute shmem_enabled_attr = - __ATTR(shmem_enabled, 0644, shmem_enabled_show, shmem_enabled_store); +struct kobj_attribute shmem_enabled_attr = __ATTR_RW(shmem_enabled); #endif /* CONFIG_TRANSPARENT_HUGEPAGE && CONFIG_SYSFS */ #else /* !CONFIG_SHMEM */