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

Chaitanya Kulkarni chaitanyak at nvidia.com
Mon Jan 15 22:33:00 PST 2024


>   
> +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




More information about the Linux-nvme mailing list