Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

USB: core: Replace an empty statement with a debug message

This patch adds a dev_dbg() message to usb_create_sysfs_intf_files().
The message is not expected ever to appear; it's real purpose is to
satisfy the __must_check attribute on device_create_file() without
triggering a compiler warning about an empty statement.

In fact we don't really care if the sysfs attribute file doesn't get
created. The interface string descriptor is purely informational and
hardly ever present.

Suggested-by: NeilBrown <neilb@suse.de>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.2004221618500.11262-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
a6cd27e9 27b0387b

+4 -2
+4 -2
drivers/usb/core/sysfs.c
··· 1262 1262 1263 1263 if (!alt->string && !(udev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) 1264 1264 alt->string = usb_cache_string(udev, alt->desc.iInterface); 1265 - if (alt->string && device_create_file(&intf->dev, &dev_attr_interface)) 1266 - ; /* We don't actually care if the function fails. */ 1265 + if (alt->string && device_create_file(&intf->dev, &dev_attr_interface)) { 1266 + /* This is not a serious error */ 1267 + dev_dbg(&intf->dev, "interface string descriptor file not created\n"); 1268 + } 1267 1269 intf->sysfs_files_created = 1; 1268 1270 } 1269 1271