• Tobin C. Harding's avatar
    staging: ks7010: remove magic numbers · 08484ef4
    Tobin C. Harding authored
    Driver includes magic numbers. Defining constants or using existing
    constants aids the readability of the code.
    
    Magic number '12' is used for two ethernet addresses (6 bytes
    each). ETH_ALEN is already defined within the kernel to 6. We can us
    the expression '2 * ETH_ALEN' to make this code explicit.
    
    Magic number '20' refers to the data size, in bytes, of a struct
    ether_hdr (described in eap_packet.h). We can define a constant for
    this purpose, making the code explicit and easier to read.
    
    Define constant. Remove magic numbers, using newly defined constant
    and/or expression using existing kernel constant.
    Signed-off-by: default avatarTobin C. Harding <me@tobin.cc>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    08484ef4
eap_packet.h 4.2 KB