All of lore.kernel.org
 help / color / mirror / Atom feed
* fixing warning "else is not generally useful after a break or return"
@ 2018-02-17 12:46 Dafna Hirschfeld
  2018-02-17 13:16 ` [Outreachy kernel] " Julia Lawall
  2018-02-17 13:19 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Dafna Hirschfeld @ 2018-02-17 12:46 UTC (permalink / raw)
  To: outreachy-kernel


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

Hi,
I see this warning "else is not generally useful after a break or return":

#532: FILE: drivers/staging/vt6655/rxtx.c:532:
+                       return buf->duration_a;
+               } else {

So the standard is to remove the "else" line when it is not necessary ? 

In the function s_uFillDataHead 
<https://elixir.bootlin.com/linux/v3.4/source/drivers/staging/vt6655/rxtx.c#L712> there 
are more "else" statements that are redundant, for example this 
<https://elixir.bootlin.com/linux/v3.4/source/drivers/staging/vt6655/rxtx.c#L786> one 
since the "if" it relates to always returns. 

So all redundant "else / else if" should be removed ?

Thanks,
Dafna

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

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

end of thread, other threads:[~2018-02-17 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-17 12:46 fixing warning "else is not generally useful after a break or return" Dafna Hirschfeld
2018-02-17 13:16 ` [Outreachy kernel] " Julia Lawall
2018-02-17 13:19 ` Greg KH

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.