• Arnd Bergmann's avatar
    phonet: fix building with clang · b0f38ebe
    Arnd Bergmann authored
    [ Upstream commit 6321aa197547da397753757bd84c6ce64b3e3d89 ]
    
    clang warns about overflowing the data[] member in the struct pnpipehdr:
    
    net/phonet/pep.c:295:8: warning: array index 4 is past the end of the array (which contains 1 element) [-Warray-bounds]
                            if (hdr->data[4] == PEP_IND_READY)
                                ^         ~
    include/net/phonet/pep.h:66:3: note: array 'data' declared here
                    u8              data[1];
    
    Using a flexible array member at the end of the struct avoids the
    warning, but since we cannot have a flexible array member inside
    of the union, each index now has to be moved back by one, which
    makes it a little uglier.
    Signed-off-by: 's avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: 's avatarRémi Denis-Courmont <remi@remlab.net>
    Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    b0f38ebe
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
af_phonet.c Loading commit data...
datagram.c Loading commit data...
pep-gprs.c Loading commit data...
pep.c Loading commit data...
pn_dev.c Loading commit data...
pn_netlink.c Loading commit data...
socket.c Loading commit data...
sysctl.c Loading commit data...