[PATCH v2 1/6] treewide: don't mix goto labels and statements on same line

Ahmad Fatoum a.fatoum at pengutronix.de
Fri May 19 03:01:15 PDT 2023


Coding style across the project is not to indent goto labels and
to not mix them with code on the same line. Let's fix the few outliers
that are there.

No functional change.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
v1 -> v2:
  - new patch
---
 common/state/state.c             | 12 ++++++++----
 common/state/state_variables.c   |  9 ++++++---
 drivers/usb/gadget/udc/fsl_udc.c |  3 ++-
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/common/state/state.c b/common/state/state.c
index cabe285fbdf3..040835702b66 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -333,8 +333,10 @@ static int state_convert_node_variable(struct state *state,
 		goto out;
 
 	return 0;
- out_free:free(name);
- out:	return ret;
+out_free:
+	free(name);
+out:
+	return ret;
 }
 
 struct device_node *state_to_node(struct state *state,
@@ -361,7 +363,8 @@ struct device_node *state_to_node(struct state *state,
 	}
 
 	return root;
- out:	of_delete_node(root);
+out:
+	of_delete_node(root);
 	return ERR_PTR(ret);
 }
 
@@ -561,7 +564,8 @@ static int of_state_fixup(struct device_node *root, void *ctx)
 
 	return 0;
 
- out:	of_delete_node(new_node);
+out:
+	of_delete_node(new_node);
 	return ret;
 }
 
diff --git a/common/state/state_variables.c b/common/state/state_variables.c
index cb85f3a92602..77946206cd02 100644
--- a/common/state/state_variables.c
+++ b/common/state/state_variables.c
@@ -263,7 +263,8 @@ static struct state_variable *state_enum32_create(struct state *state,
 	}
 
 	return &enum32->var;
- out:	for (i--; i >= 0; i--)
+out:
+	for (i--; i >= 0; i--)
 		free((char *)enum32->names[i]);
 	free(enum32->names);
 	free(enum32);
@@ -329,7 +330,8 @@ static struct state_variable *state_mac_create(struct state *state,
 	}
 
 	return &mac->var;
- out:	free(mac);
+out:
+	free(mac);
 	return ERR_PTR(ret);
 }
 
@@ -444,7 +446,8 @@ static struct state_variable *state_string_create(struct state *state,
 	}
 
 	return &string->var;
- out:	free(string);
+out:
+	free(string);
 	return ERR_PTR(ret);
 }
 
diff --git a/drivers/usb/gadget/udc/fsl_udc.c b/drivers/usb/gadget/udc/fsl_udc.c
index 6a1d4304df1e..81e051a073c0 100644
--- a/drivers/usb/gadget/udc/fsl_udc.c
+++ b/drivers/usb/gadget/udc/fsl_udc.c
@@ -980,7 +980,8 @@ static int fsl_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)
 	done(ep, req, -ECONNRESET);
 
 	/* Enable EP */
-out:	epctrl = readl(&dr_regs->endptctrl[ep_num]);
+out:
+	epctrl = readl(&dr_regs->endptctrl[ep_num]);
 	if (ep_is_in(ep))
 		epctrl |= EPCTRL_TX_ENABLE;
 	else
-- 
2.39.2




More information about the barebox mailing list