Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2442763pxj; Sun, 23 May 2021 00:04:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw46bSVEmroDzVeNcVXIE537s8TSypgtRs3CJFb5pu06ZfE5habVFcx/z+PVtMFtVSI32PZ X-Received: by 2002:a05:6402:10c9:: with SMTP id p9mr19641624edu.268.1621753448324; Sun, 23 May 2021 00:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621753448; cv=none; d=google.com; s=arc-20160816; b=wLEWiQ9QE7bFurqF8E8lBLXCis8GvIET+DS9R/4EWyjTdJt2gH/QKmOK4YWMECMHIz VmVuuYRDeVkMLnduaNNgo2dBmFdZLR5csbDiRjKNdPFdHxJYyj6Xjxp1lpB8nvm5EK4X KrkhOjk7lBIDaFVMTSRPFPcWx4iQVT+bTD+YT5v0ZLCBhl0tfQE7bMRFcaPH2XNVmmTt A5+5e4BgbDURw/DWFJn9bD7Xr+fkZaAVcH1rQ704n6Z9S7+uQbUQGHjfRm+fmjiBiidL S200RHquorn6Gj1hLAHoQlBQss5pE4R3dxXCEBjuGSStPBugvj0pkGKRHusd4Kzmy2yx h0uQ== 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=WGFOAQ0UI/E/kjnZ6+K9G7Z58Pj3ezh7dHhiGhYtMwc=; b=PVpZHB7VwwhhfXsIAHofpGUcCnjWtMQ6f8k2Rh95FV212mKIKTdzjhKTiSm1lAZMv5 Wjerbi8gOzOOeSBPGr/kw0TDqBMN9nAOpi5SszEcQ/Aos671sdkZlbLLYiiNiopbsR7k UUJAl3FhP/gSVtvr9hlGJTVWNrftDmDGpSh2DWNB/zNstEhedQ/BlJ0jUYOjEEPEBOZE KvHz4AhPr+iSzFEBCGpeZs0zgpyma1dguNavPqKGBcGJq8SHJNqIJTHodoXuPh0NUph/ VFkc/QajOEfm+cOc9QuxnM2C2LHWicSc79oHryCPE0F23akPk+1k6sWFwqzotKzkNGjE zhbA== 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 t17si9432860eju.389.2021.05.23.00.03.45; Sun, 23 May 2021 00:04:08 -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 S231621AbhEWHDy (ORCPT + 99 others); Sun, 23 May 2021 03:03:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:3658 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbhEWHDy (ORCPT ); Sun, 23 May 2021 03:03:54 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Fnrnh22sgzmYZJ; Sun, 23 May 2021 15:00:08 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggems706-chm.china.huawei.com (10.3.19.183) 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 15:02:26 +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 15:02:26 +0800 From: YueHaibing To: , , , CC: , Subject: [PATCH -next] xen/pcpu: Use DEVICE_ATTR_RW macro Date: Sun, 23 May 2021 15:02:14 +0800 Message-ID: <20210523070214.34948-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: dggems704-chm.china.huawei.com (10.3.19.181) 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_RW helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: YueHaibing --- drivers/xen/pcpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c index 1bcdd5227771..47aa3a1ccaf5 100644 --- a/drivers/xen/pcpu.c +++ b/drivers/xen/pcpu.c @@ -92,7 +92,7 @@ static int xen_pcpu_up(uint32_t cpu_id) return HYPERVISOR_platform_op(&op); } -static ssize_t show_online(struct device *dev, +static ssize_t online_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -101,7 +101,7 @@ static ssize_t show_online(struct device *dev, return sprintf(buf, "%u\n", !!(cpu->flags & XEN_PCPU_FLAGS_ONLINE)); } -static ssize_t __ref store_online(struct device *dev, +static ssize_t __ref online_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -130,7 +130,7 @@ static ssize_t __ref store_online(struct device *dev, ret = count; return ret; } -static DEVICE_ATTR(online, S_IRUGO | S_IWUSR, show_online, store_online); +static DEVICE_ATTR_RW(online); static struct attribute *pcpu_dev_attrs[] = { &dev_attr_online.attr, -- 2.17.1