• Jon Paul Maloy's avatar
    tipc: initiate media type array at compile time · 5702dbab
    Jon Paul Maloy authored
    Communication media types are abstracted through the struct 'tipc_media',
    one per media type. These structs are allocated statically inside their
    respective media file.
    
    Furthermore, in order to be able to reach all instances from a central
    location, we keep a static array with pointers to these structs. This
    array is currently initialized at runtime, under protection of
    tipc_net_lock. However, since the contents of the array itself never
    changes after initialization, we can just as well initialize it at
    compile time and make it 'const', at the same time making it obvious
    that no lock protection is needed here.
    
    This commit makes the array constant and removes the redundant lock
    protection.
    Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
    Reviewed-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5702dbab
eth_media.c 10.2 KB