From: "André Moreira" <andrem.33333@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
"André Moreira" <andrem.33333@gmail.com>
Subject: [PATCH] usb: core: hub: fix coding style and prefer unsigned int
Date: Wed, 24 Jun 2026 03:17:34 -0300 [thread overview]
Message-ID: <20260624061734.28479-1-andrem.33333@gmail.com> (raw)
Fix indentation issues and clear checkpatch warnings by replacing
bare uses of 'unsigned' with 'unsigned int' throughout the file.
Signed-off-by: André Moreira <andrem.33333@gmail.com>
---
drivers/usb/core/hub.c | 52 +++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 24960ba9caa91..a75db12506388 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -410,7 +410,7 @@ static int get_hub_descriptor(struct usb_device *hdev,
struct usb_hub_descriptor *desc)
{
int i, ret, size;
- unsigned dtype;
+ unsigned int dtype;
if (hub_is_superspeed(hdev)) {
dtype = USB_DT_SS_HUB;
@@ -506,15 +506,15 @@ static void led_work(struct work_struct *work)
struct usb_hub *hub =
container_of(work, struct usb_hub, leds.work);
struct usb_device *hdev = hub->hdev;
- unsigned i;
- unsigned changed = 0;
+ unsigned int i;
+ unsigned int changed = 0;
int cursor = -1;
if (hdev->state != USB_STATE_CONFIGURED || hub->quiescing)
return;
for (i = 0; i < hdev->maxchild; i++) {
- unsigned selector, mode;
+ unsigned int selector, mode;
/* 30%-50% duty cycle */
@@ -774,7 +774,7 @@ static void hub_irq(struct urb *urb)
{
struct usb_hub *hub = urb->context;
int status = urb->status;
- unsigned i;
+ unsigned int i;
unsigned long bits;
switch (status) {
@@ -1084,7 +1084,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
int port1;
int status;
bool need_debounce_delay = false;
- unsigned delay;
+ unsigned int delay;
/* Continue a partial initialization */
if (type == HUB_INIT2 || type == HUB_INIT3) {
@@ -1457,9 +1457,9 @@ static int hub_configure(struct usb_hub *hub,
unsigned int pipe;
int maxp, ret, i;
char *message = "out of memory";
- unsigned unit_load;
- unsigned full_load;
- unsigned maxchild;
+ unsigned int unit_load;
+ unsigned int full_load;
+ unsigned int maxchild;
hub->buffer = kmalloc_obj(*hub->buffer);
if (!hub->buffer) {
@@ -1792,7 +1792,7 @@ void hub_put(struct usb_hub *hub)
kref_put(&hub->kref, hub_release);
}
-static unsigned highspeed_hubs;
+static unsigned int highspeed_hubs;
static void hub_disconnect(struct usb_interface *intf)
{
@@ -1859,7 +1859,7 @@ static bool hub_descriptor_is_sane(struct usb_host_interface *desc)
if (!usb_endpoint_is_int_in(&desc->endpoint[0].desc))
return false;
- return true;
+ return true;
}
static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
@@ -2047,7 +2047,7 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
* Allow user programs to claim ports on a hub. When a device is attached
* to one of these "claimed" ports, the program will "own" the device.
*/
-static int find_port_owner(struct usb_device *hdev, unsigned port1,
+static int find_port_owner(struct usb_device *hdev, unsigned int port1,
struct usb_dev_state ***ppowner)
{
struct usb_hub *hub = usb_hub_to_struct_hub(hdev);
@@ -3263,7 +3263,7 @@ static void usb_unlock_port(struct usb_port *port_dev)
#ifdef CONFIG_PM
/* Check if a port is suspended(USB2.0 port) or in U3 state(USB3.0 port) */
-static int port_is_suspended(struct usb_hub *hub, unsigned portstatus)
+static int port_is_suspended(struct usb_hub *hub, unsigned int portstatus)
{
int ret = 0;
@@ -3441,7 +3441,7 @@ static int usb_disable_remote_wakeup(struct usb_device *udev)
}
/* Count of wakeup-enabled devices at or below udev */
-unsigned usb_wakeup_enabled_descendants(struct usb_device *udev)
+unsigned int usb_wakeup_enabled_descendants(struct usb_device *udev)
{
struct usb_hub *hub = usb_hub_to_struct_hub(udev);
@@ -3959,7 +3959,7 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg)
{
struct usb_hub *hub = usb_get_intfdata(intf);
struct usb_device *hdev = hub->hdev;
- unsigned port1;
+ unsigned int port1;
/*
* Warn if children aren't already suspended.
@@ -4697,7 +4697,7 @@ int hub_port_debounce(struct usb_hub *hub, int port1, bool must_be_connected)
{
int ret;
u16 portchange, portstatus;
- unsigned connection = 0xffff;
+ unsigned int connection = 0xffff;
int total_time, stable_time = 0;
struct usb_port *port_dev = hub->ports[port1 - 1];
@@ -4906,7 +4906,7 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
struct usb_port *port_dev = hub->ports[port1 - 1];
int retries, operations, retval, i;
- unsigned delay = HUB_SHORT_RESET_TIME;
+ unsigned int delay = HUB_SHORT_RESET_TIME;
enum usb_device_speed oldspeed = udev->speed;
const char *speed;
int devnum = udev->devnum;
@@ -5269,7 +5269,7 @@ hub_power_remaining(struct usb_hub *hub)
for (port1 = 1; port1 <= hdev->maxchild; ++port1) {
struct usb_port *port_dev = hub->ports[port1 - 1];
struct usb_device *udev = port_dev->child;
- unsigned unit_load;
+ unsigned int unit_load;
int delta;
if (!udev)
@@ -5308,10 +5308,10 @@ static int descriptors_changed(struct usb_device *udev,
struct usb_host_bos *old_bos)
{
int changed = 0;
- unsigned index;
- unsigned serial_len = 0;
- unsigned len;
- unsigned old_length;
+ unsigned int index;
+ unsigned int serial_len = 0;
+ unsigned int len;
+ unsigned int old_length;
int length;
char *buf;
@@ -5392,7 +5392,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus,
{
int status = -ENODEV;
int i;
- unsigned unit_load;
+ unsigned int unit_load;
struct usb_device *hdev = hub->hdev;
struct usb_hcd *hcd = bus_to_hcd(hdev->bus);
struct usb_port *port_dev = hub->ports[port1 - 1];
@@ -6000,14 +6000,14 @@ static void hub_event(struct work_struct *work)
static const struct usb_device_id hub_id_table[] = {
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
- | USB_DEVICE_ID_MATCH_PRODUCT
- | USB_DEVICE_ID_MATCH_INT_CLASS,
+ | USB_DEVICE_ID_MATCH_PRODUCT
+ | USB_DEVICE_ID_MATCH_INT_CLASS,
.idVendor = USB_VENDOR_SMSC,
.idProduct = USB_PRODUCT_USB5534B,
.bInterfaceClass = USB_CLASS_HUB,
.driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
{ .match_flags = USB_DEVICE_ID_MATCH_VENDOR
- | USB_DEVICE_ID_MATCH_PRODUCT,
+ | USB_DEVICE_ID_MATCH_PRODUCT,
.idVendor = USB_VENDOR_CYPRESS,
.idProduct = USB_PRODUCT_CY7C65632,
.driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
--
2.43.0
next reply other threads:[~2026-06-24 6:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 6:17 André Moreira [this message]
2026-06-24 6:28 ` [PATCH] usb: core: hub: fix coding style and prefer unsigned int Andre Moreira
2026-06-24 6:28 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260624061734.28479-1-andrem.33333@gmail.com \
--to=andrem.33333@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox