[OpenWrt-Devel] [PATCH v2 00/25] ramips: massive code cleanups

Piotr Dymacz pepe2k at gmail.com
Tue Aug 18 03:33:25 EDT 2015


Hello,

2015-08-18 6:04 GMT+02:00 郭传鈜 <gch981213 at gmail.com>:
> Hi!
>     I just wonder why you chose to use the board name in LED
> names?

Please, take a look at first version of my series and discussion about
"device:color:led-name" convention: [1].
I thought that OpenWrt uses different convention:
"manufacturer:color:led-name", but if you look deeper, we have both
approaches in code.

As an example, take a look at current version of diag.sh script in
ar71xx target [2].
There is exactly the same mix as it was in ramips target before my
cleans - some of boards follow upstream convention and rest don't.

> Sometimes we can use the same dts file for different boards.For
> example, in ar71xx wr841nd-v3 wr941nd-v2 and wr941nd-v3 shares
> mach-tl-wr941nd-v2.c(I haven't found such examples in ramips target.)I
> think the LED name will be a bit strange in this situation:-(

Yes, that's good point and I was thinking about the same problem.

IMHO, using same LED names for different boards is a mistake (assuming
that we switch to upstream convention).
Take TL-MR3420 v2 as an example ([3]) - for me it's not a TL-WR841N v8
"clone". They are similar from hardware POV (same platform, almost the
same specification), but manufacturer gave them different model names,
not without a reason.

That means all boards should have own names for LEDs. Question is how
to do it without duplicating and increasing code size.
What's more, what should we do with boards like TL-WR841N/ND vx -
should they share same code and use something like
"tl-wr841nx-vx:color:led-name" convention or separate that too
("tl-wr841n-v8:...", "tl-wr841nd-v8...", "tl-wr841nd-v7:..:", etc.)?
And what to do with clones like Mercury or Fast?

Maybe we should have separate mach-* files for all supported boards,
but then... what about DRY (don’t repeat yourself)?

Cheers,
Piotr

[1] http://patchwork.ozlabs.org/patch/500071/
[2] https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/base-files/etc/diag.sh
[3] https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c#L254

> 2015-08-17 19:24 GMT+08:00 Piotr Dymacz <pepe2k at gmail.com>:
>> 2015-08-17 8:28 GMT+02:00 John Crispin <blogic at openwrt.org>:
>>> Hi,
>>>
>>> just merged the whole lot. thanks a lot. what do you want to do next
>>> lantiq or ar71xx ? :) personally i would prefer ar71xx ;)
>>> [...]
>>
>> Hello John,
>>
>> It seems that there are some people who don't like the changes (see
>> below), but they don't have enough courage to use their real name and
>> post their comments on the list.
>>
>> I will back with answers for your and Michael Heimpold (I'm sorry, I
>> didn't spot your e-mail before!) questions in few days. Now I'm really
>> busy with other things.
>>
>> Cheers,
>> Piotr Dymacz
>>
>> ---
>>
>> 2015-08-17 13:05 GMT+02:00 West Fuck <deutchwrt at anonmail.de>:
>>> https://dev.openwrt.org/changeset/46617
>>>
>>> of all the bugs on related system you have choosen to change board and led
>>> names? why do you stick your nose into something that is not relevant? is it
>>> because your'e stupid fucking excuse for human being? you couldn't even make
>>> your uboot work without errors on some boards so why don't you stick to your
>>> own crap instead of acting like your're doing something
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel at lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list