summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-06-16 06:44:17 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-23 06:00:02 +0300
commit80068f82284a3bbb2763a2280027daa95da4f73d (patch)
tree29069650f63691bab84d4276a13b8335209b9349 /drivers/scsi
parentffa636470aefc41a634025e958b32b006d59a29a (diff)
downloadlinux-80068f82284a3bbb2763a2280027daa95da4f73d.tar.xz
scsi: qedf: Use DEVICE_ATTR_RO() macro
Use DEVICE_ATTR_RO() macro helper instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Link: https://lore.kernel.org/r/20210616034419.725-3-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qedf/qedf_attr.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/qedf/qedf_attr.c b/drivers/scsi/qedf/qedf_attr.c
index d995f72a6759..461c0c9180c4 100644
--- a/drivers/scsi/qedf/qedf_attr.c
+++ b/drivers/scsi/qedf/qedf_attr.c
@@ -24,9 +24,8 @@ static struct qedf_ctx *qedf_get_base_qedf(struct qedf_ctx *qedf)
return lport_priv(base_lport);
}
-static ssize_t
-qedf_fcoe_mac_show(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t fcoe_mac_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct fc_lport *lport = shost_priv(class_to_shost(dev));
u32 port_id;
@@ -42,9 +41,8 @@ qedf_fcoe_mac_show(struct device *dev,
return scnprintf(buf, PAGE_SIZE, "%pM\n", fcoe_mac);
}
-static ssize_t
-qedf_fka_period_show(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t fka_period_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct fc_lport *lport = shost_priv(class_to_shost(dev));
struct qedf_ctx *qedf = lport_priv(lport);
@@ -59,8 +57,8 @@ qedf_fka_period_show(struct device *dev,
return scnprintf(buf, PAGE_SIZE, "%d\n", fka_period);
}
-static DEVICE_ATTR(fcoe_mac, S_IRUGO, qedf_fcoe_mac_show, NULL);
-static DEVICE_ATTR(fka_period, S_IRUGO, qedf_fka_period_show, NULL);
+static DEVICE_ATTR_RO(fcoe_mac);
+static DEVICE_ATTR_RO(fka_period);
struct device_attribute *qedf_host_attrs[] = {
&dev_attr_fcoe_mac,