Re: [PATCH V8 1/1] nvme: allow passthru cmd error logging

Chaitanya Kulkarni
2024-01-16T06:33:21Z

>
> +static ssize_t nvme_passthru_err_log_enabled_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + return sysfs_emit(buf, dev->logging_enabled ? "on" : "off");
> +}
> +

Can we use following on the top of this as most of the XXX_show()
functions in the host/sysfs.c are using "\n" ?

diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index 8215abaa68e5..ce021f4995eb 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -38,7 +38,7 @@ static DEVICE_ATTR(rescan_controller, S_IWUSR, NULL,
nvme_sysfs_rescan);
static ssize_t nvme_passthru_err_log_enabled_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
-       return sysfs_emit(buf, dev->logging_enabled ? "on" : "off");
+       return sysfs_emit(buf, dev->logging_enabled ? "on\n" : "off\n");
}

static ssize_t nvme_passthru_err_log_enabled_store(struct device *dev,

-ck