Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2440099pxj; Sat, 22 May 2021 23:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxJNcrt4LCoIXnv+0sJBTaaqaU+JEvHS67/X8YB4jVSW6rXIxUt1YdWm0h3zDhCC/VaWMd X-Received: by 2002:aa7:d455:: with SMTP id q21mr19379128edr.2.1621753173377; Sat, 22 May 2021 23:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621753173; cv=none; d=google.com; s=arc-20160816; b=F4baR3JUwENw6mETl0LyH5nXm69c+RlJu1WYNxyn547B0gsLhCEp3TPsIj8UNbAScA JFzAhGpuL9q3TXDELXaElJo5QF0pmtYYUjQPqWuaUCBOLWwhL51GI97hsYojOV9ECCuy xBSZaw26/1PxuN7nd9McUYBJVPZNvQhneCwEOy5iWpnvAvti/T3Ufxd0hFJM1GDVTZS1 6O1C0B/TO/+iZ+Q2In1ja9lEvXq8LgxIX9o9Gy7owO3cOmlVJsKqA3eg5mMeRiXAjqgx zmvkjTIwHz2z0vsJxzG75maFXOTUMfo9yv0GAYKHJFAWMSSZk0jjCHQ8NehhB+43cO6V UQdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=HMX5cCxr8zo6EQr9+8oF0evNXSkAVI2XnnMpC52wLcM=; b=Tt5EHcIUMyVc6ctk7n8dFusFhateR4yoVcU0QFCHHKar9tIIf8B6SaGmMCEjTWIh15 gFbuhelPLE5I9bhwF7AEWP2ZbvaskKZS7LH5iZbGqqdxDegMEcXkzPrZKmkHYq7msuqz RcKYcv+T+MHGlkKq9qBHSXB5XaXg2f5abYIgAqSwPywzhrRGOsQreuOr06TYUo5YxKf1 JTf+e9RKoTNX67IYGYlMwcoQPcUqPTlev9CrmaV8rMGW7PdZ9ZRV7ZkuRdeEHFfhRQGT 1hnTnOljG2whAEf90E9chiCFMsyMrerb0TzRf6afjgieYQfxThjO47DGR2/gP28LBqe4 bkYw== 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 de2si9470960edb.152.2021.05.22.23.59.10; Sat, 22 May 2021 23:59:33 -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 S231637AbhEWGrB (ORCPT + 99 others); Sun, 23 May 2021 02:47:01 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4589 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231621AbhEWGrB (ORCPT ); Sun, 23 May 2021 02:47:01 -0400 Received: from dggems703-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FnrPb72gnzkX9d; Sun, 23 May 2021 14:42:43 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggems703-chm.china.huawei.com (10.3.19.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Sun, 23 May 2021 14:45:33 +0800 Received: from localhost (10.174.179.215) by dggema769-chm.china.huawei.com (10.1.198.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sun, 23 May 2021 14:45:32 +0800 From: YueHaibing To: CC: , , YueHaibing Subject: [PATCH -next] mm/compaction: use DEVICE_ATTR_WO macro Date: Sun, 23 May 2021 14:45:21 +0800 Message-ID: <20210523064521.32912-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggema769-chm.china.huawei.com (10.1.198.211) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEVICE_ATTR_WO helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: YueHaibing --- mm/compaction.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 7d41b58fb17c..b7fb991dee1b 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -2722,9 +2722,9 @@ int sysctl_compaction_handler(struct ctl_table *table, int write, } #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) -static ssize_t sysfs_compact_node(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t compact_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) { int nid = dev->id; @@ -2737,7 +2737,7 @@ static ssize_t sysfs_compact_node(struct device *dev, return count; } -static DEVICE_ATTR(compact, 0200, NULL, sysfs_compact_node); +static DEVICE_ATTR_WO(compact); int compaction_register_node(struct node *node) { -- 2.17.1