public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Coiby Xu <coiby.xu@gmail.com>
To: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: linux-staging@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: About improving the qlge Ethernet driver by following drivers/staging/qlge/TODO
Date: Fri, 7 May 2021 21:25:57 +0800	[thread overview]
Message-ID: <20210507132557.mgqhmb3acke5w6te@Rk> (raw)
In-Reply-To: <YJUvlC6RVGuonNmu@f3>

On Fri, May 07, 2021 at 09:16:20PM +0900, Benjamin Poirier wrote:
>On 2021-05-07 09:32 +0800, Coiby Xu wrote:
>[...]
>> > > > * fix weird line wrapping (all over, ex. the ql_set_routing_reg() calls in
>> > > >   qlge_set_multicast_list()).
>> > >
>> > > This issue of weird line wrapping is supposed to be all over. But I can
>> > > only find the ql_set_routing_reg() calls in qlge_set_multicast_list have
>> > > this problem,
>> > >
>> > > 			if (qlge_set_routing_reg
>> > > 			    (qdev, RT_IDX_PROMISCUOUS_SLOT, RT_IDX_VALID, 1)) {
>> > >
>> > > I can't find other places where functions calls put square and arguments
>> > > in the new line. Could you give more hints?
>> >
>> > Here are other examples of what I would call weird line wrapping:
>> >
>> > 	status = qlge_validate_flash(qdev,
>> > 				     sizeof(struct flash_params_8000) /
>> > 				   sizeof(u16),
>> > 				   "8000");
>>
>> Oh, I also found this one but I think it more fits another TODO item,
>> i.e., "* fix weird indentation (all over, ex. the for loops in
>> qlge_get_stats())".
>>
>> >
>> > 	status = qlge_wait_reg_rdy(qdev,
>> > 				   XGMAC_ADDR, XGMAC_ADDR_RDY, XGMAC_ADDR_XME);
>> >
>> > [...]
>>
>> Do you mean we should change it as follows,
>>
>>
>> 	status = qlge_wait_reg_rdy(qdev, XGMAC_ADDR, XGMAC_ADDR_RDY,
>> 				               XGMAC_ADDR_XME);
>
>	status = qlge_wait_reg_rdy(qdev, XGMAC_ADDR, XGMAC_ADDR_RDY,
>				   XGMAC_ADDR_XME);

Thanks! This is what I meant, i.e. qdev is aligned with XGMAC_ADDR_XME. 
Somehow when replying in the editor, the format is different from view 
mode. So I made a mistake by manually adding spaces to XGMAC_ADDR_XME 
to make it appear aligned with qdev in the editor.
>
>>
>> "V=" in vim could detect some indentation problems but not the line
>> wrapping issue. So I just scanned the code manually to find this issue. Do
>> you know there is a tool that could check if the code fits the kernel
>> coding style?
>
>See Documentation/process/coding-style.rst section 9.

Great. clang-format is exactly what I need. It could detect the above 
qlge_wait_reg_rdy issue and even automatically fix the issue. I will run
clang-format after finishing other TODO items.

>
>You can search online for info about how to configure vim for the kernel
>coding style, ex:
>https://stackoverflow.com/questions/33676829/vim-configuration-for-linux-kernel-development

Thanks. I'll use https://github.com/vivien/vim-linux-coding-style:)

-- 
Best regards,
Coiby

  reply	other threads:[~2021-05-07 13:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 13:14 About improving the qlge Ethernet driver by following drivers/staging/qlge/TODO Coiby Xu
2021-05-05  8:59 ` Benjamin Poirier
2021-05-07  1:32   ` Coiby Xu
2021-05-07 12:16     ` Benjamin Poirier
2021-05-07 13:25       ` Coiby Xu [this message]
2021-05-08 23:27     ` Coiby Xu
2021-05-09  7:51       ` Benjamin Poirier
2021-05-09 23:54         ` Coiby Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210507132557.mgqhmb3acke5w6te@Rk \
    --to=coiby.xu@gmail.com \
    --cc=benjamin.poirier@gmail.com \
    --cc=linux-staging@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox