Thread (79 messages) 79 messages, 6 authors, 2024-07-08

Re: [PATCH net-next v13 14/15] net: stmmac: dwmac-loongson: Add Loongson GNET support

From: Yanteng Si <hidden>
Date: 2024-07-06 10:31:02

在 2024/7/5 20:17, Serge Semin 写道:
On Fri, Jul 05, 2024 at 08:06:32PM +0800, Yanteng Si wrote:
quoted
quoted
quoted
quoted
But if you aren't comfortable with such naming we can change the
macro to something like:
#define DWMAC_CORE_LOONGSON_MULTI_CH    0x10
Maybe DWMAC_CORE_LOONGSON_MULTICHAN or DWMAC_CORE_LOONGSON_MULTI_CHAN
is a little better?
Well, I don't have a strong opinion about that in this case.
Personally I prefer to have the shortest and still readable version.
It decreases the probability of the lines splitting in case of the
long-line statements or highly indented code. From that perspective
something like DWMAC_CORE_LS_MULTI_CH would be even better. But seeing
the driver currently don't have such cases, we can use any of those
name. But it's better to be of such length so the code lines the name
is utilized in wouldn't exceed +80 chars.
Okay.

I added an indent before 0xXX and left three Spaces before the comment,

which uses huacai's MULTICHAN and doesn't exceed 80 chars.
I meant that it's better to have the length of the macro name so
!the code where it's utilized!
wouldn't exceed +80 chars. That's the criteria for the upper length
boundary I normally follow in such cases.
Oh, I see!

Hmm, let's compare the two options:

DWMAC_CORE_LS_MULTI_CH

DWMAC_CORE_LS_MULTICHAN

With just one more char, the increased readability seems to be
worth it.


Thanks,

Yanteng
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help