Re: if/else block default coding style question

2016-10-08 Thread Valdis . Kletnieks
On Sat, 08 Oct 2016 15:19:18 -, Nicholas Mc Guire said: > Thats actually the cause of this mail - it just becaem obvious > that some of these if==else are intentional At the very least, the intentional ones need a comment similar to the one found in file.c > Now reporting these cases if

Re: if/else block default coding style question

2016-10-08 Thread Nicholas Mc Guire
On Sat, Oct 08, 2016 at 11:10:10AM -0400, Robert P. J. Day wrote: > On Sat, 8 Oct 2016, valdis.kletni...@vt.edu wrote: > > > On Sat, 08 Oct 2016 10:40:37 -, Nicholas Mc Guire said: > > > > >} else if (rtlpcipriv->bt_coexist.bt_service == BT_PAN) { > > >rtl_write_byte(rtlpriv,

Re: if/else block default coding style question

2016-10-08 Thread Nicholas Mc Guire
On Sat, Oct 08, 2016 at 10:58:41AM -0400, valdis.kletni...@vt.edu wrote: > On Sat, 08 Oct 2016 10:40:37 -, Nicholas Mc Guire said: > > >} else if (rtlpcipriv->bt_coexist.bt_service == BT_PAN) { > >rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, tmp1byte); > >} else { > >

Re: if/else block default coding style question

2016-10-08 Thread Robert P. J. Day
On Sat, 8 Oct 2016, valdis.kletni...@vt.edu wrote: > On Sat, 08 Oct 2016 10:40:37 -, Nicholas Mc Guire said: > > >} else if (rtlpcipriv->bt_coexist.bt_service == BT_PAN) { > >rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, tmp1byte); > >} else { > >

Re: if/else block default coding style question

2016-10-08 Thread Valdis . Kletnieks
On Sat, 08 Oct 2016 10:40:37 -, Nicholas Mc Guire said: >} else if (rtlpcipriv->bt_coexist.bt_service == BT_PAN) { >rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, tmp1byte); >} else { >rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, tmp1byte); >} That *does* smell like

if/else block default coding style question

2016-10-08 Thread Nicholas Mc Guire
Hi ! There are quite a few places (roughly 90) in the kernel where an if/else if/else block repeats the last "case" presumably as default e.g. drivers/net/wireless/realtek/rtlwifi/rtl8192c/dm_common.c if ((rtlpcipriv->bt_coexist.bt_service == BT_BUSY) &&