Re: [PATCH net-next 4/4] net: dsa: realtek: add LED drivers for rtl8366rb

From: Andrew Lunn
Date: Sun Mar 24 2024 - 11:33:17 EST


> OK, I'll add _group_/_GROUP_ both to the enum name and macros. Led
> blink rate, for example, is global, used by all groups. However, it
> will be difficult to respect the 80 columns limit passing
> RTL8366RB_LED_GROUP_OFF to a rb8366rb_set_ledgroup_mode function with
> only two levels of indentation. Do you have any recommendations?

https://www.kernel.org/doc/html/v4.10/process/coding-style.html

Now, some people will claim that having 8-character indentations
makes the code move too far to the right, and makes it hard to read
on a 80-character terminal screen. The answer to that is that if you
need more than 3 levels of indentation, you’re screwed anyway, and
should fix your program.

Functions should be short and sweet, and do just one thing. They
should fit on one or two screenfuls of text (the ISO/ANSI screen
size is 80x24, as we all know), and do one thing and do that well.

Maybe you need to use more helper functions?

Andrew