public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: common: fix all alignment warnings in usb-otg-fsm.c
@ 2026-03-28 17:33 Stanisław Maciej Molsa
  2026-03-29  6:20 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Stanisław Maciej Molsa @ 2026-03-28 17:33 UTC (permalink / raw)
  To: peter.chen; +Cc: gregkh, linux-usb

Hi Peter,

This is my first small contribution to the USB subsystem.

Fixed all "Alignment should match open parenthesis" warnings in
usb-otg-fsm.c, as
reported by checkpatch.pl

Signed-off-by: Stanisław Maciej Molsa <stanislawmolsa@gmail.com>
---
 drivers/usb/common/usb-otg-fsm.c | 42 ++++++++++++++++----------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
index e11803225775..5dcaa6c2057f 100644
--- a/drivers/usb/common/usb-otg-fsm.c
+++ b/drivers/usb/common/usb-otg-fsm.c
@@ -32,7 +32,7 @@ static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
 
 	if (fsm->protocol != protocol) {
 		VDBG("Changing role fsm->protocol= %d; new protocol= %d\n",
-			fsm->protocol, protocol);
+		     fsm->protocol, protocol);
 		/* stop old protocol */
 		if (fsm->protocol == PROTO_HOST)
 			ret = otg_start_host(fsm, 0);
@@ -139,14 +139,14 @@ static void otg_hnp_polling_work(struct work_struct *work)
 	*fsm->host_req_flag = 0;
 	/* Get host request flag from connected USB device */
 	retval = usb_control_msg(udev,
-				usb_rcvctrlpipe(udev, 0),
-				USB_REQ_GET_STATUS,
-				USB_DIR_IN | USB_RECIP_DEVICE,
-				0,
-				OTG_STS_SELECTOR,
-				fsm->host_req_flag,
-				1,
-				USB_CTRL_GET_TIMEOUT);
+				 usb_rcvctrlpipe(udev, 0),
+				 USB_REQ_GET_STATUS,
+				 USB_DIR_IN | USB_RECIP_DEVICE,
+				 0,
+				 OTG_STS_SELECTOR,
+				 fsm->host_req_flag,
+				 1,
+				 USB_CTRL_GET_TIMEOUT);
 	if (retval != 1) {
 		dev_err(&udev->dev, "Get one byte OTG status failed\n");
 		return;
@@ -156,7 +156,7 @@ static void otg_hnp_polling_work(struct work_struct *work)
 	if (flag == 0) {
 		/* Continue HNP polling */
 		schedule_delayed_work(&fsm->hnp_polling_work,
-					msecs_to_jiffies(T_HOST_REQ_POLL));
+				      msecs_to_jiffies(T_HOST_REQ_POLL));
 		return;
 	} else if (flag != HOST_REQUEST_FLAG) {
 		dev_err(&udev->dev, "host request flag %d is invalid\n", flag);
@@ -168,11 +168,11 @@ static void otg_hnp_polling_work(struct work_struct *work)
 		/* Set b_hnp_enable */
 		if (!fsm->otg->host->b_hnp_enable) {
 			retval = usb_control_msg(udev,
-					usb_sndctrlpipe(udev, 0),
-					USB_REQ_SET_FEATURE, 0,
-					USB_DEVICE_B_HNP_ENABLE,
-					0, NULL, 0,
-					USB_CTRL_SET_TIMEOUT);
+						 usb_sndctrlpipe(udev, 0),
+						 USB_REQ_SET_FEATURE, 0,
+						 USB_DEVICE_B_HNP_ENABLE,
+						 0, NULL, 0,
+						 USB_CTRL_SET_TIMEOUT);
 			if (retval >= 0)
 				fsm->otg->host->b_hnp_enable = 1;
 		}
@@ -199,7 +199,7 @@ static void otg_start_hnp_polling(struct otg_fsm *fsm)
 	}
 
 	schedule_delayed_work(&fsm->hnp_polling_work,
-					msecs_to_jiffies(T_HOST_REQ_POLL));
+			      msecs_to_jiffies(T_HOST_REQ_POLL));
 }
 
 /* Called when entering a state */
@@ -249,7 +249,7 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
 		otg_loc_sof(fsm, 1);
 		otg_set_protocol(fsm, PROTO_HOST);
 		usb_bus_start_enum(fsm->otg->host,
-				fsm->otg->host->otg_port);
+				   fsm->otg->host->otg_port);
 		otg_start_hnp_polling(fsm);
 		break;
 	case OTG_STATE_A_IDLE:
@@ -349,7 +349,7 @@ int otg_statemachine(struct otg_fsm *fsm)
 		else if (fsm->b_sess_vld && fsm->otg->gadget)
 			otg_set_state(fsm, OTG_STATE_B_PERIPHERAL);
 		else if ((fsm->b_bus_req || fsm->adp_change || fsm->power_up) &&
-				fsm->b_ssend_srp && fsm->b_se0_srp)
+			 fsm->b_ssend_srp && fsm->b_se0_srp)
 			otg_set_state(fsm, OTG_STATE_B_SRP_INIT);
 		break;
 	case OTG_STATE_B_SRP_INIT:
@@ -383,14 +383,14 @@ int otg_statemachine(struct otg_fsm *fsm)
 		if (fsm->id)
 			otg_set_state(fsm, OTG_STATE_B_IDLE);
 		else if (!fsm->a_bus_drop && (fsm->a_bus_req ||
-			  fsm->a_srp_det || fsm->adp_change || fsm->power_up))
+					      fsm->a_srp_det || fsm->adp_change || fsm->power_up))
 			otg_set_state(fsm, OTG_STATE_A_WAIT_VRISE);
 		break;
 	case OTG_STATE_A_WAIT_VRISE:
 		if (fsm->a_vbus_vld)
 			otg_set_state(fsm, OTG_STATE_A_WAIT_BCON);
 		else if (fsm->id || fsm->a_bus_drop ||
-				fsm->a_wait_vrise_tmout)
+			 fsm->a_wait_vrise_tmout)
 			otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
 		break;
 	case OTG_STATE_A_WAIT_BCON:
@@ -405,7 +405,7 @@ int otg_statemachine(struct otg_fsm *fsm)
 		if (fsm->id || fsm->a_bus_drop)
 			otg_set_state(fsm, OTG_STATE_A_WAIT_VFALL);
 		else if ((!fsm->a_bus_req || fsm->a_suspend_req_inf) &&
-				fsm->otg->host->b_hnp_enable)
+			 fsm->otg->host->b_hnp_enable)
 			otg_set_state(fsm, OTG_STATE_A_SUSPEND);
 		else if (!fsm->b_conn)
 			otg_set_state(fsm, OTG_STATE_A_WAIT_BCON);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: common: fix all alignment warnings in usb-otg-fsm.c
  2026-03-28 17:33 [PATCH] usb: common: fix all alignment warnings in usb-otg-fsm.c Stanisław Maciej Molsa
@ 2026-03-29  6:20 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-03-29  6:20 UTC (permalink / raw)
  To: Stanisław Maciej Molsa; +Cc: peter.chen, linux-usb

On Sat, Mar 28, 2026 at 05:33:03PM +0000, Stanisław Maciej Molsa wrote:
> Hi Peter,
> 
> This is my first small contribution to the USB subsystem.

No need for this here.

> 
> Fixed all "Alignment should match open parenthesis" warnings in
> usb-otg-fsm.c, as
> reported by checkpatch.pl
> 
> Signed-off-by: Stanisław Maciej Molsa <stanislawmolsa@gmail.com>
> ---
>  drivers/usb/common/usb-otg-fsm.c | 42 ++++++++++++++++----------------
>  1 file changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
> index e11803225775..5dcaa6c2057f 100644
> --- a/drivers/usb/common/usb-otg-fsm.c
> +++ b/drivers/usb/common/usb-otg-fsm.c
> @@ -32,7 +32,7 @@ static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
>  
>  	if (fsm->protocol != protocol) {
>  		VDBG("Changing role fsm->protocol= %d; new protocol= %d\n",
> -			fsm->protocol, protocol);
> +		     fsm->protocol, protocol);

Please do not do coding style changes EXCEPT in subsystems that
specifically ask for them to be done in (like drivers/staging/),
otherwise there will be nothing but constant churn in the kernel tree.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-29  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-28 17:33 [PATCH] usb: common: fix all alignment warnings in usb-otg-fsm.c Stanisław Maciej Molsa
2026-03-29  6:20 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox