All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8188eu: core: else is not generally useful after a break or return
@ 2015-02-21 18:16 Hatice ERTÜRK
  2015-02-21 21:34 ` [Outreachy kernel] " Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Hatice ERTÜRK @ 2015-02-21 18:16 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Hatice ERTURK

Fixes checkpatch warnings:

WARNING: else is not generally useful after a break or return

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_recv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index bd79e9e..2b022be 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1779,8 +1779,8 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
 			plist = plist->next;
 		else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
 			return false;
-		else
-			break;
+
+		break;
 	}
 
 	list_del_init(&(prframe->list));
-- 
1.9.1



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

* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: core: else is not generally useful after a break or return
  2015-02-21 18:16 [PATCH] Staging: rtl8188eu: core: else is not generally useful after a break or return Hatice ERTÜRK
@ 2015-02-21 21:34 ` Arnd Bergmann
  2015-02-21 21:47   ` Hatice ERTÜRK
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2015-02-21 21:34 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Hatice ERTÜRK

On Saturday 21 February 2015 20:16:52 Hatice ERTÜRK wrote:
> diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
> index bd79e9e..2b022be 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_recv.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
> @@ -1779,8 +1779,8 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
>                         plist = plist->next;
>                 else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
>                         return false;
> -               else
> -                       break;
> +
> +               break;
>         }
>  

This is not a correct change, you add a 'break' in the case that
the first condition was true, which did not exist earlier.

	Arnd


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

* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: core: else is not generally useful after a break or return
  2015-02-21 21:34 ` [Outreachy kernel] " Arnd Bergmann
@ 2015-02-21 21:47   ` Hatice ERTÜRK
  2015-02-21 21:56     ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Hatice ERTÜRK @ 2015-02-21 21:47 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: haticeerturk27


[-- Attachment #1.1: Type: text/plain, Size: 1057 bytes --]

ok.I'have changed. But it says "else is not generally useful after a break 
or return"

21 Şubat 2015 Cumartesi 23:34:34 UTC+2 tarihinde Arnd Bergmann yazdı:
>
> On Saturday 21 February 2015 20:16:52 Hatice ERTÜRK wrote: 
> > diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
> b/drivers/staging/rtl8188eu/core/rtw_recv.c 
> > index bd79e9e..2b022be 100644 
> > --- a/drivers/staging/rtl8188eu/core/rtw_recv.c 
> > +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c 
> > @@ -1779,8 +1779,8 @@ static int enqueue_reorder_recvframe(struct 
> recv_reorder_ctrl *preorder_ctrl, 
> >                         plist = plist->next; 
> >                 else if (SN_EQUAL(pnextattrib->seq_num, 
> pattrib->seq_num)) 
> >                         return false; 
> > -               else 
> > -                       break; 
> > + 
> > +               break; 
> >         } 
> >   
>
> This is not a correct change, you add a 'break' in the case that 
> the first condition was true, which did not exist earlier. 
>
>         Arnd 
>

[-- Attachment #1.2: Type: text/html, Size: 1715 bytes --]

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

* Re: [Outreachy kernel] [PATCH] Staging: rtl8188eu: core: else is not generally useful after a break or return
  2015-02-21 21:47   ` Hatice ERTÜRK
@ 2015-02-21 21:56     ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2015-02-21 21:56 UTC (permalink / raw)
  To: Hatice ERTÜRK; +Cc: outreachy-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2087 bytes --]

On Sat, 21 Feb 2015, Hatice ERTÜRK wrote:

> ok.I'have changed. But it says "else is not generally useful after a break
> or return"

Checkpatch is not that clever.  It may just look on the line before.  In 
this case the structure is

  if X
  then Y
  else
    if A
    then return
    else C

The transformation proposed by checkpatch is only valid when every branch 
returns.  That is, if Y were a return also.

julia

> 21 Şubat 2015 Cumartesi 23:34:34 UTC+2 tarihinde Arnd Bergmann yazdı:
>       On Saturday 21 February 2015 20:16:52 Hatice ERTÜRK wrote:
>       > diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c
>       b/drivers/staging/rtl8188eu/core/rtw_recv.c
>       > index bd79e9e..2b022be 100644
>       > --- a/drivers/staging/rtl8188eu/core/rtw_recv.c
>       > +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
>       > @@ -1779,8 +1779,8 @@ static int
>       enqueue_reorder_recvframe(struct recv_reorder_ctrl
>       *preorder_ctrl,
>       >                         plist = plist->next;
>       >                 else if (SN_EQUAL(pnextattrib->seq_num,
>       pattrib->seq_num))
>       >                         return false;
>       > -               else
>       > -                       break;
>       > +
>       > +               break;
>       >         }
>       >  
> 
>       This is not a correct change, you add a 'break' in the case that
>       the first condition was true, which did not exist earlier.
> 
>               Arnd
> 
> --
> You received this message because you are subscribed to the Google Groups
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/efcf0928-ffb8-408d-bb30-
> ac6634d72b3c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 

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

end of thread, other threads:[~2015-02-21 21:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-21 18:16 [PATCH] Staging: rtl8188eu: core: else is not generally useful after a break or return Hatice ERTÜRK
2015-02-21 21:34 ` [Outreachy kernel] " Arnd Bergmann
2015-02-21 21:47   ` Hatice ERTÜRK
2015-02-21 21:56     ` Julia Lawall

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.