Re: [PATCH] fuser: small code shrink
Maksym Kryzhanovskyy
xmaks at email.cz
Thu Jun 3 16:22:39 UTC 2010
Attached is a patch that move body of lonely functions to the place of their calls.
function old new delta
fuser_main 911 877 -34
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-34) Total: -34 bytes
Also my gcc (4.4.4) writes the type punning warnings around
#define G (* (struct globals *) & bb_common_bufsiz1).
Is it dangerous?
gcc output:
CC procps/fuser.o
procps/fuser.c: In function 'add_pid':
procps/fuser.c:45: warning: dereferencing type-punned pointer will break strict-aliasing rules
procps/fuser.c: In function 'add_inode':
procps/fuser.c:59: warning: dereferencing type-punned pointer will break strict-aliasing rules
procps/fuser.c: In function 'search_dev_inode':
procps/fuser.c:118: warning: dereferencing type-punned pointer will break strict-aliasing rules
procps/fuser.c: In function 'fuser_main':
procps/fuser.c:287: warning: dereferencing type-punned pointer will break strict-aliasing rules
>
> Applied with more modifications on top.
> Please review:
>
> http://git.busybox.net/busybox/commit/?id=fef9ee70727452954d2c5d28cc65e8b0fffcd6f1
> http://git.busybox.net/busybox/patch/?id=fef9ee70727452954d2c5d28cc65e8b0fffcd6f1
>
> Thanks!
> --
> vda
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox.fuser.patch
Type: text/x-patch
Size: 1622 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100603/1f7c1982/attachment.bin>
More information about the busybox
mailing list