From nobody Tue May 7 05:31:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1621753389; cv=none; d=zohomail.com; s=zohoarc; b=hl1aHqjRA0NdgWIG7hc/EVpjXnrpOBz/pOKtruepQaxl3f2I04QFzaXhqjnYCT4LLxwyNIbimraGerhQcXYVF4NHdt0qftCw70Mw6naWc8QyMBuvzzuc9DeWOHfvToJOBD9F3bNdXxHC7mtNbwWIJqWQRdSK9QpdofyWFsk7TJE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621753389; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=WGFOAQ0UI/E/kjnZ6+K9G7Z58Pj3ezh7dHhiGhYtMwc=; b=IL/XtElhRfk7B5/lpSDXEVep+P9FKfPCQrF+iMicmRE1MdqPdERoY9zlhsApkXh1MrsevkZG/kpYxx/uDApRYCoFogEtxkwLJLli06LyJpuF9mDW+pTVMURiAJeTuf7KfFG5OnHcIrGGyDyeCYcHoMqUzN03eEpPjfN9qOX5uts= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1621753389041854.3397038401843; Sun, 23 May 2021 00:03:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.131547.245811 (Exim 4.92) (envelope-from ) id 1lki8E-000079-CR; Sun, 23 May 2021 07:02:38 +0000 Received: by outflank-mailman (output) from mailman id 131547.245811; Sun, 23 May 2021 07:02:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lki8E-00006z-92; Sun, 23 May 2021 07:02:38 +0000 Received: by outflank-mailman (input) for mailman id 131547; Sun, 23 May 2021 07:02:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lki8C-00006q-KZ for xen-devel@lists.xenproject.org; Sun, 23 May 2021 07:02:36 +0000 Received: from szxga06-in.huawei.com (unknown [45.249.212.32]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d04ccc05-d41e-4eaf-9ec5-2584cfdbb027; Sun, 23 May 2021 07:02:31 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d04ccc05-d41e-4eaf-9ec5-2584cfdbb027 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 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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); } =20 -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)); } =20 -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 =3D count; return ret; } -static DEVICE_ATTR(online, S_IRUGO | S_IWUSR, show_online, store_online); +static DEVICE_ATTR_RW(online); =20 static struct attribute *pcpu_dev_attrs[] =3D { &dev_attr_online.attr, --=20 2.17.1