Re: [PATCH] ifplugd: simple code shrink (~ -43)

Maksym Kryzhanovskyy xmaks at email.cz
Sat Jul 10 14:11:48 UTC 2010


Denys Vlasenko wrote:
> Hi,
> 
> On Friday 09 July 2010 13:41, Maksym Kryzhanovskyy wrote:
> > attached is a patch for ifplugd. Please review and consider usage.
> 
> Max, please briefly explain what this patch fixes.
> 
> And, if there are both cosmetic changes and logic changes,
> it makes sense to split the patch into two - it's easier
> to understand the changes that way.
> 

I split the previous patch into two, logical and cosmetic.

The first patch simplifies the method choice for detecting the link state,
also it makes 'set_ifreq_to_ifname' function more generic:

function                                             old     new   delta
ifplugd_main                                        1056    1119     +63
maybe_up_new_iface                                    33      35      +2
detect_link                                          216     208      -8
detect_link_wlan                                     120      99     -21
set_ifreq_to_ifname                                   32       -     -32
static.method                                         40       -     -40
.rodata                                           133272  133232     -40
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 2/3 up/down: 65/-141)           Total: -76 bytes

The second patch includes rename the named constants acording to bb convention
and removes those which are not used. No size changes.

Please review and consider usage.

Max.


> -- 
> vda
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox.ifplugd.logic.patch
Type: text/x-patch
Size: 6678 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100710/d4732a8b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox.ifplugd.logic.and.cosmetic.patch
Type: text/x-patch
Size: 8015 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100710/d4732a8b/attachment-0001.bin>


More information about the busybox mailing list