Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp365182pxj; Fri, 28 May 2021 06:00:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU55ooRR703cTYlWIa9C0jtBuhzIt6hZ3pAOYm9RDICvH1pZPKnxrXpI7gK/suvPVuZ5mi X-Received: by 2002:a17:906:d0d4:: with SMTP id bq20mr8977345ejb.541.1622206811466; Fri, 28 May 2021 06:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622206811; cv=none; d=google.com; s=arc-20160816; b=DqiJb8wvwJ3EDuCFSG3sF25Ryl6BC+m+7ylFlbJvmn6ad6mdJMMrSEXxQm8DGXJgw2 p2UQ+xycIQGTHQhaRp4bvO90SOq8xQYD/5Vx7ZOatiQwslk5D+Uo6mAFtSybl+cLesQI Y/iflChyH9aBzzTmhDzDnvc6dlkOIDzLHc3BsGFnsmrTFfdcNtrRyedSc4xmXN2MPWIb rAm0jxQNVWD2LjLaFizk+LNC+/64+RkyAgKm4uBIyyt3I6R5rCm0HFXNYIgQ9pYR7lZb OErMpSZDNIPpNfZySF4LGbZLXJ9dqRchKDWfUJmSKqJHEIurwOYj1omiYhjIL42duvld NzMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=sv+JLP8zODADB4dEoeVgwwo5PiGk4mnaHAaOJKaxAJE=; b=Jh1AAlN5c56EHbj7seX1a5c5qoZxYWhBlwczWT0zfk3qc7dsktaTnDs4bL6dvL8Zhl d2/nqPakktT39u/fGGfFjrRjzve0NRCGCUQ6GJ4D+yHtKUJciSt4iFnkUOi8S375QChZ aXnf5pt4FaKNEoaF7RZpIbg2A1uYUq3O36JJ4aNAQFpv6XD90I6rGNyo+HiHZyMVm4yp ySK5M9E9Tr30R2zkcLh1/8TASfukjgpoH3cXd6OjdKo09fiQuJTXBa6jY4InDobDHZr/ /6frNX+JVOfkyoYvCzD6B09bDXT0qVCTARbhwJmm5qSIOPy5olJX+lXQ4y2n4pkYXtwp naow== 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 s20si4768431eja.135.2021.05.28.05.59.48; Fri, 28 May 2021 06:00:11 -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 S235365AbhE1M5r (ORCPT + 99 others); Fri, 28 May 2021 08:57:47 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:2397 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234486AbhE1M5o (ORCPT ); Fri, 28 May 2021 08:57:44 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Fs4Mv4WDyz65pS; Fri, 28 May 2021 20:52:27 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 28 May 2021 20:56:06 +0800 Received: from [10.174.179.215] (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; Fri, 28 May 2021 20:56:06 +0800 Subject: Re: [PATCH v2 -next] RDMA/srp: use DEVICE_ATTR_*() macro To: Jason Gunthorpe CC: , , , References: <20210528123039.10668-1-yuehaibing@huawei.com> <20210528123334.GI1096940@ziepe.ca> From: YueHaibing Message-ID: <0a12ba49-b020-2417-3618-2a42ff147838@huawei.com> Date: Fri, 28 May 2021 20:56:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210528123334.GI1096940@ziepe.ca> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit 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 On 2021/5/28 20:33, Jason Gunthorpe wrote: > On Fri, May 28, 2021 at 08:30:39PM +0800, YueHaibing wrote: >> @@ -3040,22 +3040,22 @@ static ssize_t show_allow_ext_sg(struct device *dev, >> return sysfs_emit(buf, "%s\n", target->allow_ext_sg ? "true" : "false"); >> } >> >> -static DEVICE_ATTR(id_ext, S_IRUGO, show_id_ext, NULL); >> -static DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL); >> -static DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); >> -static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); >> -static DEVICE_ATTR(sgid, S_IRUGO, show_sgid, NULL); >> -static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); >> -static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL); >> -static DEVICE_ATTR(req_lim, S_IRUGO, show_req_lim, NULL); >> -static DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); >> -static DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL); >> -static DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL); >> -static DEVICE_ATTR(ch_count, S_IRUGO, show_ch_count, NULL); >> -static DEVICE_ATTR(comp_vector, S_IRUGO, show_comp_vector, NULL); >> -static DEVICE_ATTR(tl_retry_count, S_IRUGO, show_tl_retry_count, NULL); >> -static DEVICE_ATTR(cmd_sg_entries, S_IRUGO, show_cmd_sg_entries, NULL); >> -static DEVICE_ATTR(allow_ext_sg, S_IRUGO, show_allow_ext_sg, NULL); >> +static DEVICE_ATTR_RO(id_ext); >> +static DEVICE_ATTR_RO(ioc_guid); >> +static DEVICE_ATTR_RO(service_id); >> +static DEVICE_ATTR_RO(pkey); >> +static DEVICE_ATTR_RO(sgid); >> +static DEVICE_ATTR_RO(dgid); >> +static DEVICE_ATTR_RO(orig_dgid); >> +static DEVICE_ATTR_RO(req_lim); >> +static DEVICE_ATTR_RO(zero_req_lim); >> +static DEVICE_ATTR_RO(local_ib_port); >> +static DEVICE_ATTR_RO(local_ib_device); >> +static DEVICE_ATTR_RO(ch_count); >> +static DEVICE_ATTR_RO(comp_vector); >> +static DEVICE_ATTR_RO(tl_retry_count); >> +static DEVICE_ATTR_RO(cmd_sg_entries); >> +static DEVICE_ATTR_RO(allow_ext_sg); > > can you also organize this so the ATTR's are placed after their > functions, as is normal? Ok, v3 on the way. > > Thanks, > Jason > . >