diff mbox series

[3/3] staging: Thunderbolt: ctl.c: Fixed comment coding style issues

Message ID 20220625084913.603556-4-gabriel@gvisoc.com (mailing list archive)
State New, archived
Headers show
Series [1/3] staging: Thunderbolt: ctl.c: Fixed 2 literal style coding issues | expand

Commit Message

Gabriel Viso Carrera June 25, 2022, 8:49 a.m. UTC
Fixed a couple of comment aligment & formatting coding style issues.

Signed-off-by: Gabriel Viso Carrera <gabriel@gvisoc.com>
---
 drivers/thunderbolt/ctl.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Joe Perches June 25, 2022, 9:37 a.m. UTC | #1
On Sat, 2022-06-25 at 18:49 +1000, Gabriel Viso Carrera wrote:
> Fixed a couple of comment aligment & formatting coding style issues.

trivia:

> diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
[]
> @@ -402,11 +403,11 @@ static bool tb_ctl_handle_event(struct tb_ctl *ctl, enum tb_cfg_pkg_type type,
>  static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
>  {
>  	tb_ring_rx(pkg->ctl->rx, &pkg->frame); /*
> -					     * We ignore failures during stop.
> -					     * All rx packets are referenced
> -					     * from ctl->rx_packets, so we do
> -					     * not loose them.
> -					     */
> +						* We ignore failures during stop.
> +						* All rx packets are referenced
> +						* from ctl->rx_packets, so we do
> +						* not loose them.
> +						*/

I'd indent this only 1 level and put it before the call
(and fix the loose/lose typo)

{
	/* We ignore failures during stop.
	 * All rx packets are referenced from ctl->rx_packets,
	 * so we do not lose them.
	 */
	tb_ring_rx(pkg->ctl->rx, &pkg->frame);
}
Gabriel Viso Carrera June 29, 2022, 6:54 a.m. UTC | #2
On Sat, Jun 25, 2022 at 02:37:54AM -0700, Joe Perches wrote:
[]
> 
> I'd indent this only 1 level and put it before the call
> (and fix the loose/lose typo)
> 
> {
> 	/* We ignore failures during stop.
> 	 * All rx packets are referenced from ctl->rx_packets,
> 	 * so we do not lose them.
> 	 */
> 	tb_ring_rx(pkg->ctl->rx, &pkg->frame);
> }
> 

Fair enough. Not sure on how to proceed, as these were my 
first patches ever sent, and I don't want to make anyone 
work more than the strictly necessary. 

- Should I submit an additional patch intended to be applied 
on top of 3/3?
- Should I sumbit a whole new 3/3, addressing the whole comment
issues all at once?
- Should I just wait on the outcome and proceed from there?

Advice would be appreciated.

Anyway, I will be sending some patches over other files for 
the time being, paying more attention to the details.

Thanks,
~Gabriel
Greg KH June 29, 2022, 7:02 a.m. UTC | #3
On Wed, Jun 29, 2022 at 04:54:53PM +1000, Gabriel Viso Carrera wrote:
> On Sat, Jun 25, 2022 at 02:37:54AM -0700, Joe Perches wrote:
> []
> > 
> > I'd indent this only 1 level and put it before the call
> > (and fix the loose/lose typo)
> > 
> > {
> > 	/* We ignore failures during stop.
> > 	 * All rx packets are referenced from ctl->rx_packets,
> > 	 * so we do not lose them.
> > 	 */
> > 	tb_ring_rx(pkg->ctl->rx, &pkg->frame);
> > }
> > 
> 
> Fair enough. Not sure on how to proceed, as these were my 
> first patches ever sent, and I don't want to make anyone 
> work more than the strictly necessary. 

If you are just learning how to do all of this, I strongly recommend you
stick to drivers/staging/* which is much more forgiving and welcoming
for basic coding style cleanups.  After you get some experience there,
then go out into other subsystems.  Many subsystems do not like coding
style fixes as it causes conflicts with other development that is
happening.

thanks,

greg k-h
Gabriel Viso Carrera June 29, 2022, 7:47 a.m. UTC | #4
On Wed, Jun 29, 2022 at 09:02:52AM +0200, Greg KH wrote:
> If you are just learning how to do all of this, I strongly recommend you
> stick to drivers/staging/* which is much more forgiving and welcoming
> for basic coding style cleanups.  After you get some experience there,
> then go out into other subsystems.  Many subsystems do not like coding
> style fixes as it causes conflicts with other development that is
> happening.
> 
> thanks,
> 
> greg k-h

I am doing these patches as my first step, yes.
Will do as suggested, thanks for that. 

~Gabriel
diff mbox series

Patch

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 6c973fdf7b36..5c6c62867b9c 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -276,7 +276,8 @@  static void tb_cfg_print_error(struct tb_ctl *ctl,
 	switch (res->tb_error) {
 	case TB_CFG_ERROR_PORT_NOT_CONNECTED:
 		/* Port is not connected. This can happen during surprise
-		 * removal. Do not warn. */
+		 * removal. Do not warn.
+		 */
 		return;
 	case TB_CFG_ERROR_INVALID_CONFIG_SPACE:
 		/*
@@ -402,11 +403,11 @@  static bool tb_ctl_handle_event(struct tb_ctl *ctl, enum tb_cfg_pkg_type type,
 static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
 {
 	tb_ring_rx(pkg->ctl->rx, &pkg->frame); /*
-					     * We ignore failures during stop.
-					     * All rx packets are referenced
-					     * from ctl->rx_packets, so we do
-					     * not loose them.
-					     */
+						* We ignore failures during stop.
+						* All rx packets are referenced
+						* from ctl->rx_packets, so we do
+						* not loose them.
+						*/
 }
 
 static int tb_async_error(const struct ctl_pkg *pkg)