It seems 'min_t' was used before, and looks cleaner, plus white-space stuff. Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx> --- drivers/usb/core/hcd.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 34de475..e6d754e 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -396,8 +396,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) case 0: /* Array of LANGID codes (0x0409 is MSFT-speak for "en-us") */ /* See http://www.usb.org/developers/docs/USB_LANGIDs.pdf */ - if (len > 4) - len = 4; + len = min_t(unsigned, len, sizeof(langids)); memcpy(data, langids, len); return len; case 1: @@ -410,8 +409,8 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) break; case 3: /* Manufacturer */ - snprintf (buf, sizeof buf, "%s %s %s", init_utsname()->sysname, - init_utsname()->release, hcd->driver->description); + snprintf(buf, sizeof buf, "%s %s %s", init_utsname()->sysname, + init_utsname()->release, hcd->driver->description); s = buf; break; default: -- 1.6.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html