mbox series

[net-next,0/8] net: hdlc_ppp: clean up some code style issues

Message ID 1623836037-26812-1-git-send-email-huangguangbin2@huawei.com
Headers show
Series net: hdlc_ppp: clean up some code style issues | expand

Message

huangguangbin (A) June 16, 2021, 9:33 a.m. UTC
From: Peng Li <lipeng321@huawei.com>

This patchset clean up some code style issues.

Peng Li (8):
  net: hdlc_ppp: remove redundant blank lines
  net: hdlc_ppp: add blank line after declarations
  net: hdlc_ppp: fix the code style issue about "foo* bar"
  net: hdlc_ppp: move out assignment in if condition
  net: hdlc_ppp: fix the comments style issue
  net: hdlc_ppp: remove unnecessary out of memory message
  net: hdlc_ppp: remove redundant spaces
  net: hdlc_ppp: add required space

 drivers/net/wan/hdlc_ppp.c | 90 ++++++++++++++++++++++------------------------
 1 file changed, 42 insertions(+), 48 deletions(-)

Comments

Andrew Lunn June 16, 2021, 4:20 p.m. UTC | #1
>  static int cp_table[EVENTS][STATES] = {
>  	/* CLOSED     STOPPED STOPPING REQ_SENT ACK_RECV ACK_SENT OPENED
> -	     0           1         2       3       4      5          6    */
> +	 *   0           1         2       3       4      5          6
> +	 */
>  	{IRC|SCR|3,     INV     , INV ,   INV   , INV ,  INV    ,   INV   }, /* START */
>  	{   INV   ,      0      ,  0  ,    0    ,  0  ,   0     ,    0    }, /* STOP */
>  	{   INV   ,     INV     ,STR|2,  SCR|3  ,SCR|3,  SCR|5  ,   INV   }, /* TO+ */

This probably reduces the readability of the code. So i would not make
this change.

Please remember these are only guidelines. Please don't blindly make
changes, or change it because some bot says so. Check that it actually
makes sense and the code is better afterwards.

      Andrew
Peng Li June 17, 2021, 1 a.m. UTC | #2
在 2021/6/17 0:20, Andrew Lunn 写道:
>>   static int cp_table[EVENTS][STATES] = {

>>   	/* CLOSED     STOPPED STOPPING REQ_SENT ACK_RECV ACK_SENT OPENED

>> -	     0           1         2       3       4      5          6    */

>> +	 *   0           1         2       3       4      5          6

>> +	 */

>>   	{IRC|SCR|3,     INV     , INV ,   INV   , INV ,  INV    ,   INV   }, /* START */

>>   	{   INV   ,      0      ,  0  ,    0    ,  0  ,   0     ,    0    }, /* STOP */

>>   	{   INV   ,     INV     ,STR|2,  SCR|3  ,SCR|3,  SCR|5  ,   INV   }, /* TO+ */

> This probably reduces the readability of the code. So i would not make

> this change.

>

> Please remember these are only guidelines. Please don't blindly make

> changes, or change it because some bot says so. Check that it actually

> makes sense and the code is better afterwards.

>

>        Andrew

> .


Agree with you they are only guidelines.

The code should  follow the rules mostly, or  it will be diferent style 
from different developer.

If that's the exception, i will drop this patch.


Thanks

             Peng Li