From patchwork Tue Mar 22 21:46:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789243 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 38F41C433F5 for ; Tue, 22 Mar 2022 21:46:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B78DC6B0162; Tue, 22 Mar 2022 17:46:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B27EF6B0163; Tue, 22 Mar 2022 17:46:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EFC96B0164; Tue, 22 Mar 2022 17:46:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id 8D3E96B0162 for ; Tue, 22 Mar 2022 17:46:39 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4E0E68249980 for ; Tue, 22 Mar 2022 21:46:39 +0000 (UTC) X-FDA: 79273356918.31.278BA0D Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf01.hostedemail.com (Postfix) with ESMTP id D598640037 for ; Tue, 22 Mar 2022 21:46:38 +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 D843BB81DAF; Tue, 22 Mar 2022 21:46:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9103FC340EC; Tue, 22 Mar 2022 21:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985596; bh=2ar7RtaI2P01CapefEmmSPNXxQF5PPXBY9ag+WtVuNo=; h=Date:To:From:In-Reply-To:Subject:From; b=tj0T7Qgt7Yo1td1FvuFpRQwoEj2rCVgKNzdfd2FjrAqD35S1Y6NOnI2EDk5wo5c4j 5zKTWg8/HAftsKaciY9PfPx4WuUhMRo4T7mHG5qeTzBLApTvATOzHSJzQMfH+mVV1T Z4cMgWDuj2lFvUCWi8939WO6FGI563s2gJli35u0= Date: Tue, 22 Mar 2022 14:46:35 -0700 To: 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 159/227] mm/ksm: use helper macro __ATTR_RW Message-Id: <20220322214636.9103FC340EC@smtp.kernel.org> X-Rspam-User: X-Stat-Signature: 989fy8khkmwuigwbkn61m4ppuktq6fox Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=tj0T7Qgt; spf=pass (imf01.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-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D598640037 X-HE-Tag: 1647985598-77041 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/ksm: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define KSM_ATTR to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220221115809.26381-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton --- mm/ksm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/mm/ksm.c~mm-ksm-use-helper-macro-__attr_rw +++ a/mm/ksm.c @@ -2829,8 +2829,7 @@ static void wait_while_offlining(void) #define KSM_ATTR_RO(_name) \ static struct kobj_attribute _name##_attr = __ATTR_RO(_name) #define KSM_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 ssize_t sleep_millisecs_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)