• Krzysztof Kozlowski's avatar
    nfc: constify nci_ops · b9c28286
    Krzysztof Kozlowski authored
    The struct nci_ops is modified by NFC core in only one case:
    nci_allocate_device() receives too many proprietary commands (prop_ops)
    to configure.  This is a build time known constrain, so a graceful
    handling of such case is not necessary.
    
    Instead, fail the nci_allocate_device() and add BUILD_BUG_ON() to places
    which set these.
    
    This allows to constify the struct nci_ops (consisting of function
    pointers) for correctness and safety.
    Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b9c28286
core.c 3.81 KB