All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ath10k: Remove return statement from a void function
@ 2017-02-21 10:28 ` Marcin Rokicki
  0 siblings, 0 replies; 6+ messages in thread
From: Marcin Rokicki @ 2017-02-21 10:28 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, arend.vanspriel

The empty 'return;' statement in a void function should be
used to return from somewhere else than the end.

Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
---

Changes for v2
 -remove only return statement instead of empty err label
  which can be used in the future

---
 drivers/net/wireless/ath/ath10k/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 59729aa..a22d3c9 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2311,7 +2311,7 @@ static void ath10k_core_register_work(struct work_struct *work)
 	/* TODO: It's probably a good idea to release device from the driver
 	 * but calling device_release_driver() here will cause a deadlock.
 	 */
-	return;
+	;
 }
 
 int ath10k_core_register(struct ath10k *ar, u32 chip_id)
-- 
2.7.4

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

* [PATCH v2] ath10k: Remove return statement from a void function
@ 2017-02-21 10:28 ` Marcin Rokicki
  0 siblings, 0 replies; 6+ messages in thread
From: Marcin Rokicki @ 2017-02-21 10:28 UTC (permalink / raw)
  To: ath10k; +Cc: arend.vanspriel, linux-wireless

The empty 'return;' statement in a void function should be
used to return from somewhere else than the end.

Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
---

Changes for v2
 -remove only return statement instead of empty err label
  which can be used in the future

---
 drivers/net/wireless/ath/ath10k/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 59729aa..a22d3c9 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -2311,7 +2311,7 @@ static void ath10k_core_register_work(struct work_struct *work)
 	/* TODO: It's probably a good idea to release device from the driver
 	 * but calling device_release_driver() here will cause a deadlock.
 	 */
-	return;
+	;
 }
 
 int ath10k_core_register(struct ath10k *ar, u32 chip_id)
-- 
2.7.4


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH v2] ath10k: Remove return statement from a void function
  2017-02-21 10:28 ` Marcin Rokicki
@ 2017-02-22 19:54   ` Arend Van Spriel
  -1 siblings, 0 replies; 6+ messages in thread
From: Arend Van Spriel @ 2017-02-22 19:54 UTC (permalink / raw)
  To: Marcin Rokicki, ath10k; +Cc: linux-wireless



On 21-2-2017 11:28, Marcin Rokicki wrote:
> The empty 'return;' statement in a void function should be
> used to return from somewhere else than the end.
> 
> Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
> ---
> 
> Changes for v2
>  -remove only return statement instead of empty err label
>   which can be used in the future
> 
> ---
>  drivers/net/wireless/ath/ath10k/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 59729aa..a22d3c9 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -2311,7 +2311,7 @@ static void ath10k_core_register_work(struct work_struct *work)
>  	/* TODO: It's probably a good idea to release device from the driver
>  	 * but calling device_release_driver() here will cause a deadlock.
>  	 */
> -	return;
> +	;

Not exactly what I meant. Just drop the whole line include semicolon.

Regards,
Arend

>  }
>  
>  int ath10k_core_register(struct ath10k *ar, u32 chip_id)
> 

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

* Re: [PATCH v2] ath10k: Remove return statement from a void function
@ 2017-02-22 19:54   ` Arend Van Spriel
  0 siblings, 0 replies; 6+ messages in thread
From: Arend Van Spriel @ 2017-02-22 19:54 UTC (permalink / raw)
  To: Marcin Rokicki, ath10k; +Cc: linux-wireless



On 21-2-2017 11:28, Marcin Rokicki wrote:
> The empty 'return;' statement in a void function should be
> used to return from somewhere else than the end.
> 
> Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
> ---
> 
> Changes for v2
>  -remove only return statement instead of empty err label
>   which can be used in the future
> 
> ---
>  drivers/net/wireless/ath/ath10k/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> index 59729aa..a22d3c9 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -2311,7 +2311,7 @@ static void ath10k_core_register_work(struct work_struct *work)
>  	/* TODO: It's probably a good idea to release device from the driver
>  	 * but calling device_release_driver() here will cause a deadlock.
>  	 */
> -	return;
> +	;

Not exactly what I meant. Just drop the whole line include semicolon.

Regards,
Arend

>  }
>  
>  int ath10k_core_register(struct ath10k *ar, u32 chip_id)
> 

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH v2] ath10k: Remove return statement from a void function
  2017-02-22 19:54   ` Arend Van Spriel
@ 2017-02-23 12:54     ` Joe Perches
  -1 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2017-02-23 12:54 UTC (permalink / raw)
  To: Arend Van Spriel, Marcin Rokicki, ath10k; +Cc: linux-wireless

On Wed, 2017-02-22 at 20:54 +0100, Arend Van Spriel wrote:
> 
> On 21-2-2017 11:28, Marcin Rokicki wrote:
> > The empty 'return;' statement in a void function should be
> > used to return from somewhere else than the end.
> > 
> > Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
> > ---
> > 
> > Changes for v2
> >  -remove only return statement instead of empty err label
> >   which can be used in the future
> > 
> > ---
> >  drivers/net/wireless/ath/ath10k/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> > index 59729aa..a22d3c9 100644
> > --- a/drivers/net/wireless/ath/ath10k/core.c
> > +++ b/drivers/net/wireless/ath/ath10k/core.c
> > @@ -2311,7 +2311,7 @@ static void ath10k_core_register_work(struct work_struct *work)
> >  	/* TODO: It's probably a good idea to release device from the driver
> >  	 * but calling device_release_driver() here will cause a deadlock.
> >  	 */
> > -	return;
> > +	;
> 
> Not exactly what I meant. Just drop the whole line include semicolon.

gcc doesn't support a goto label without a
statement immediately before the end-of-function.

ie:

void foo(void)
{
	goto err;
err:
}

fails to compile.

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

* Re: [PATCH v2] ath10k: Remove return statement from a void function
@ 2017-02-23 12:54     ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2017-02-23 12:54 UTC (permalink / raw)
  To: Arend Van Spriel, Marcin Rokicki, ath10k; +Cc: linux-wireless

On Wed, 2017-02-22 at 20:54 +0100, Arend Van Spriel wrote:
> 
> On 21-2-2017 11:28, Marcin Rokicki wrote:
> > The empty 'return;' statement in a void function should be
> > used to return from somewhere else than the end.
> > 
> > Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
> > ---
> > 
> > Changes for v2
> >  -remove only return statement instead of empty err label
> >   which can be used in the future
> > 
> > ---
> >  drivers/net/wireless/ath/ath10k/core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
> > index 59729aa..a22d3c9 100644
> > --- a/drivers/net/wireless/ath/ath10k/core.c
> > +++ b/drivers/net/wireless/ath/ath10k/core.c
> > @@ -2311,7 +2311,7 @@ static void ath10k_core_register_work(struct work_struct *work)
> >  	/* TODO: It's probably a good idea to release device from the driver
> >  	 * but calling device_release_driver() here will cause a deadlock.
> >  	 */
> > -	return;
> > +	;
> 
> Not exactly what I meant. Just drop the whole line include semicolon.

gcc doesn't support a goto label without a
statement immediately before the end-of-function.

ie:

void foo(void)
{
	goto err;
err:
}

fails to compile.


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2017-02-23 12:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21 10:28 [PATCH v2] ath10k: Remove return statement from a void function Marcin Rokicki
2017-02-21 10:28 ` Marcin Rokicki
2017-02-22 19:54 ` Arend Van Spriel
2017-02-22 19:54   ` Arend Van Spriel
2017-02-23 12:54   ` Joe Perches
2017-02-23 12:54     ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.