Re: [PATCH] target: Use LIST_HEAD()/DEFINE_MUTEX() for static objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-01-12 at 10:41 -0800, Roland Dreier wrote:
> From: Roland Dreier <roland@xxxxxxxxxxxxxxx>
> 
> Instead of
> 
>    static struct list_head foo;
>    static struct mutex bar;
> 
>    ...
> 
>    INIT_LIST_HEAD(&foo);
>    mutex_init(&bar);
> 
> just do
> 
>    static LIST_HEAD(foo);
>    static DEFINE_MUTEX(bar);
> 
> Also remove some superfluous struct list_head and spinlock_t
> initialization calls where the variables are already defined using
> macros that initialize them.
> 
> This saves a decent amount of compiled code too:
> 
>     add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-178 (-178)
>     function                                     old     new   delta
>     target_core_init_configfs                    898     850     -48
>     core_scsi3_emulate_pro_preempt              1742    1683     -59
>     iscsi_thread_set_init                        159      88     -71
> 
> Signed-off-by: Roland Dreier <roland@xxxxxxxxxxxxxxx>
> ---
>  drivers/target/iscsi/iscsi_target_tq.c |    6 ------
>  drivers/target/target_core_configfs.c  |    6 ++----
>  drivers/target/target_core_pr.c        |    6 ++----
>  3 files changed, 4 insertions(+), 14 deletions(-)
> 

A nice savings on complied code.  Applied to lio-core/master.

Thanks!

--nab

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux