diff mbox series

[net-next,1/5] misdn: avoid -Wempty-body warning

Message ID 20210322104343.948660-1-arnd@kernel.org
State Superseded
Headers show
Series [net-next,1/5] misdn: avoid -Wempty-body warning | expand

Commit Message

Arnd Bergmann March 22, 2021, 10:43 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


gcc warns about a pointless condition:

drivers/isdn/hardware/mISDN/hfcmulti.c: In function 'hfcmulti_interrupt':
drivers/isdn/hardware/mISDN/hfcmulti.c:2752:17: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
 2752 |                 ; /* external IRQ */

Change this as suggested by gcc, which also fits the style of the
other conditions in this function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/isdn/hardware/mISDN/hfcmulti.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.29.2

Comments

Leon Romanovsky March 22, 2021, 10:55 a.m. UTC | #1
On Mon, Mar 22, 2021 at 11:43:31AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>

> 

> gcc warns about a pointless condition:

> 

> drivers/isdn/hardware/mISDN/hfcmulti.c: In function 'hfcmulti_interrupt':

> drivers/isdn/hardware/mISDN/hfcmulti.c:2752:17: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

>  2752 |                 ; /* external IRQ */

> 

> Change this as suggested by gcc, which also fits the style of the

> other conditions in this function.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  drivers/isdn/hardware/mISDN/hfcmulti.c | 5 +++--

>  1 file changed, 3 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c

> index 7013a3f08429..8ab0fde758d2 100644

> --- a/drivers/isdn/hardware/mISDN/hfcmulti.c

> +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c

> @@ -2748,8 +2748,9 @@ hfcmulti_interrupt(int intno, void *dev_id)

>  		if (hc->ctype != HFC_TYPE_E1)

>  			ph_state_irq(hc, r_irq_statech);

>  	}

> -	if (status & V_EXT_IRQSTA)

> -		; /* external IRQ */

> +	if (status & V_EXT_IRQSTA) {

> +		/* external IRQ */

> +	}


Any reason do not delete this hunk?

>  	if (status & V_LOST_STA) {

>  		/* LOST IRQ */

>  		HFC_outb(hc, R_INC_RES_FIFO, V_RES_LOST); /* clear irq! */

> -- 

> 2.29.2

>
Arnd Bergmann March 22, 2021, 11:24 a.m. UTC | #2
On Mon, Mar 22, 2021 at 11:55 AM Leon Romanovsky <leon@kernel.org> wrote:
> On Mon, Mar 22, 2021 at 11:43:31AM +0100, Arnd Bergmann wrote:

> > From: Arnd Bergmann <arnd@arndb.de>

> >

> > gcc warns about a pointless condition:

> >

> > drivers/isdn/hardware/mISDN/hfcmulti.c: In function 'hfcmulti_interrupt':

> > drivers/isdn/hardware/mISDN/hfcmulti.c:2752:17: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

> >  2752 |                 ; /* external IRQ */

> >

> > Change this as suggested by gcc, which also fits the style of the

> > other conditions in this function.

> >

> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> > ---

> >  drivers/isdn/hardware/mISDN/hfcmulti.c | 5 +++--

> >  1 file changed, 3 insertions(+), 2 deletions(-)

> >

> > diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c

> > index 7013a3f08429..8ab0fde758d2 100644

> > --- a/drivers/isdn/hardware/mISDN/hfcmulti.c

> > +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c

> > @@ -2748,8 +2748,9 @@ hfcmulti_interrupt(int intno, void *dev_id)

> >               if (hc->ctype != HFC_TYPE_E1)

> >                       ph_state_irq(hc, r_irq_statech);

> >       }

> > -     if (status & V_EXT_IRQSTA)

> > -             ; /* external IRQ */

> > +     if (status & V_EXT_IRQSTA) {

> > +             /* external IRQ */

> > +     }

>

> Any reason do not delete this hunk?


I don't care either way, I only kept it because it was apparently left there
on purpose by the original author, as seen by the comment.

        Arnd
Stanislaw Gruszka March 22, 2021, 11:31 a.m. UTC | #3
On Mon, Mar 22, 2021 at 11:43:33AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> There are a couple of warnings in this driver when building with W=1:
> 
> drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_power_set_mode':
> drivers/net/wireless/intel/iwlegacy/common.c:1195:60: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
>  1195 |                                 il->chain_noise_data.state);
>       |                                                            ^
> drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_do_scan_abort':
> drivers/net/wireless/intel/iwlegacy/common.c:1343:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
> 
> Change the empty debug macros to no_printk(), which avoids the
> warnings and adds useful format string checks.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Leon Romanovsky March 22, 2021, 12:06 p.m. UTC | #4
On Mon, Mar 22, 2021 at 12:24:20PM +0100, Arnd Bergmann wrote:
> On Mon, Mar 22, 2021 at 11:55 AM Leon Romanovsky <leon@kernel.org> wrote:

> > On Mon, Mar 22, 2021 at 11:43:31AM +0100, Arnd Bergmann wrote:

> > > From: Arnd Bergmann <arnd@arndb.de>

> > >

> > > gcc warns about a pointless condition:

> > >

> > > drivers/isdn/hardware/mISDN/hfcmulti.c: In function 'hfcmulti_interrupt':

> > > drivers/isdn/hardware/mISDN/hfcmulti.c:2752:17: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

> > >  2752 |                 ; /* external IRQ */

> > >

> > > Change this as suggested by gcc, which also fits the style of the

> > > other conditions in this function.

> > >

> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> > > ---

> > >  drivers/isdn/hardware/mISDN/hfcmulti.c | 5 +++--

> > >  1 file changed, 3 insertions(+), 2 deletions(-)

> > >

> > > diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c

> > > index 7013a3f08429..8ab0fde758d2 100644

> > > --- a/drivers/isdn/hardware/mISDN/hfcmulti.c

> > > +++ b/drivers/isdn/hardware/mISDN/hfcmulti.c

> > > @@ -2748,8 +2748,9 @@ hfcmulti_interrupt(int intno, void *dev_id)

> > >               if (hc->ctype != HFC_TYPE_E1)

> > >                       ph_state_irq(hc, r_irq_statech);

> > >       }

> > > -     if (status & V_EXT_IRQSTA)

> > > -             ; /* external IRQ */

> > > +     if (status & V_EXT_IRQSTA) {

> > > +             /* external IRQ */

> > > +     }

> >

> > Any reason do not delete this hunk?

> 

> I don't care either way, I only kept it because it was apparently left there

> on purpose by the original author, as seen by the comment.


I personally would delete it.

Thanks

> 

>         Arnd
Arnd Bergmann March 22, 2021, 12:48 p.m. UTC | #5
On Mon, Mar 22, 2021 at 1:08 PM Leon Romanovsky <leon@kernel.org> wrote:
> On Mon, Mar 22, 2021 at 12:24:20PM +0100, Arnd Bergmann wrote:

> > On Mon, Mar 22, 2021 at 11:55 AM Leon Romanovsky <leon@kernel.org> wrote:

> >

> > I don't care either way, I only kept it because it was apparently left there

> > on purpose by the original author, as seen by the comment.

>

> I personally would delete it.


Ok, I sent a second version now, I hope one of them can get applied.

        Arnd
diff mbox series

Patch

diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 7013a3f08429..8ab0fde758d2 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -2748,8 +2748,9 @@  hfcmulti_interrupt(int intno, void *dev_id)
 		if (hc->ctype != HFC_TYPE_E1)
 			ph_state_irq(hc, r_irq_statech);
 	}
-	if (status & V_EXT_IRQSTA)
-		; /* external IRQ */
+	if (status & V_EXT_IRQSTA) {
+		/* external IRQ */
+	}
 	if (status & V_LOST_STA) {
 		/* LOST IRQ */
 		HFC_outb(hc, R_INC_RES_FIFO, V_RES_LOST); /* clear irq! */