nvme: add device name to warning in uuid_show()
PATCH 1/1 nvme: add device name to warning in uuid_show()
This provides more context to users.
Old message:
[ 00.000000] No UUID available providing old NGUID
New message:
[ 00.000000] block nvme0n1: No UUID available providing old NGUID
--- drivers/nvme/host/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/nvme/host/core.c +1 -2
@@ -3285,8 +3285,7 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,* we have no UUID set */ if (uuid_is_null (&ids->uuid)) { -printk_ratelimited (KERN_WARNING -"No UUID available providing old NGUID\n" ); +dev_warn_ratelimited (dev,"No UUID available providing old NGUID\n" );return sysfs_emit (buf,"%pU\n" , ids->nguid); }return sysfs_emit (buf,"%pU\n" , &ids->uuid);
base-commit: e71e60cd74df9386c3f684c54888f2367050b831
Signature · 1 line
2.36.1
Keith Busch
maintainerdrivers/nvme/host/core.c static ssize_t uuid_show(struct device *dev, struct device_attribute *attr, · line 3289
Quoted 5 lines · Thomas Weißschuh
drivers/nvme/host/core.c +1
-2if (uuid_is_null (&ids->uuid)) { -printk_ratelimited (KERN_WARNING -"No UUID available providing old NGUID\n" ); +dev_warn_ratelimited (dev,"No UUID available providing old NGUID\n" );return sysfs_emit (buf,"%pU\n" , ids->nguid);
The line split was correct to prevent this overly long line. But otherwise, this looks good, though I'm wondering why this needs to be printed every time someone reads the attribute.
Quoted 10 lines · Keith Busch
drivers/nvme/host/core.c static ssize_t uuid_show(struct device *dev, struct device_attribute *attr, · line 3289
Quoted 5 lines · Thomas Weißschuh
drivers/nvme/host/core.c +1
-2if (uuid_is_null (&ids->uuid)) { -printk_ratelimited (KERN_WARNING -"No UUID available providing old NGUID\n" ); +dev_warn_ratelimited (dev,"No UUID available providing old NGUID\n" );return sysfs_emit (buf,"%pU\n" , ids->nguid);The line split was correct to prevent this overly long line. But otherwise, this looks good, though I'm wondering why this needs to be printed every time someone reads the attribute.
Sorry about the long line, thought it looks nicer on one line and other (similar) lines in the file are also using up to 100 characters per line. Do you want me to resend it?
No idea why has to be printed every time. A dev_warn_once() would be less spammy.
Thanks,
applied to nvme-5.19 with the small whitespace fixup.