Remove a use of a negative array index from fxp(4).
This fixes a warning seen when compiling amd64 GENERIC with clang 7. Also remove the workaround added in r337324. clang 7 and gcc 4.2 generate the same code with or without the code change. Reviewed by: imp (previous version) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18603
This commit is contained in:
parent
627bd78e3e
commit
0e4a3d93ee
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=342214
@ -1782,8 +1782,7 @@ dev/flash/cqspi.c optional cqspi fdt xdma
|
|||||||
dev/flash/mx25l.c optional mx25l
|
dev/flash/mx25l.c optional mx25l
|
||||||
dev/flash/n25q.c optional n25q fdt
|
dev/flash/n25q.c optional n25q fdt
|
||||||
dev/flash/qspi_if.m optional cqspi fdt | n25q fdt
|
dev/flash/qspi_if.m optional cqspi fdt | n25q fdt
|
||||||
dev/fxp/if_fxp.c optional fxp \
|
dev/fxp/if_fxp.c optional fxp
|
||||||
compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS}"
|
|
||||||
dev/fxp/inphy.c optional fxp
|
dev/fxp/inphy.c optional fxp
|
||||||
dev/gem/if_gem.c optional gem
|
dev/gem/if_gem.c optional gem
|
||||||
dev/gem/if_gem_pci.c optional gem pci
|
dev/gem/if_gem_pci.c optional gem pci
|
||||||
|
@ -25,7 +25,6 @@ NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-internal-declaration
|
|||||||
NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
|
NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized
|
||||||
NO_WCAST_QUAL= -Wno-error-cast-qual
|
NO_WCAST_QUAL= -Wno-error-cast-qual
|
||||||
NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
|
NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare
|
||||||
NO_WARRAY_BOUNDS= -Wno-error-array-bounds
|
|
||||||
# Several other warnings which might be useful in some cases, but not severe
|
# Several other warnings which might be useful in some cases, but not severe
|
||||||
# enough to error out the whole kernel build. Display them anyway, so there is
|
# enough to error out the whole kernel build. Display them anyway, so there is
|
||||||
# some incentive to fix them eventually.
|
# some incentive to fix them eventually.
|
||||||
|
@ -1627,7 +1627,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head)
|
|||||||
cbp->tbd_number = nseg;
|
cbp->tbd_number = nseg;
|
||||||
/* Configure TSO. */
|
/* Configure TSO. */
|
||||||
if (m->m_pkthdr.csum_flags & CSUM_TSO) {
|
if (m->m_pkthdr.csum_flags & CSUM_TSO) {
|
||||||
cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
|
cbp->tbdtso.tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
|
||||||
cbp->tbd[1].tb_size |= htole32(tcp_payload << 16);
|
cbp->tbd[1].tb_size |= htole32(tcp_payload << 16);
|
||||||
cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE |
|
cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE |
|
||||||
FXP_IPCB_IP_CHECKSUM_ENABLE |
|
FXP_IPCB_IP_CHECKSUM_ENABLE |
|
||||||
|
@ -281,10 +281,15 @@ struct fxp_cb_tx {
|
|||||||
uint16_t cb_status;
|
uint16_t cb_status;
|
||||||
uint16_t cb_command;
|
uint16_t cb_command;
|
||||||
uint32_t link_addr;
|
uint32_t link_addr;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
uint32_t tbd_array_addr;
|
uint32_t tbd_array_addr;
|
||||||
uint16_t byte_count;
|
uint16_t byte_count;
|
||||||
uint8_t tx_threshold;
|
uint8_t tx_threshold;
|
||||||
uint8_t tbd_number;
|
uint8_t tbd_number;
|
||||||
|
};
|
||||||
|
struct fxp_tbd tbdtso;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following structure isn't actually part of the TxCB,
|
* The following structure isn't actually part of the TxCB,
|
||||||
|
@ -6,5 +6,3 @@ KMOD= if_fxp
|
|||||||
SRCS= device_if.h bus_if.h if_fxp.c inphy.c miibus_if.h miidevs.h pci_if.h
|
SRCS= device_if.h bus_if.h if_fxp.c inphy.c miibus_if.h miidevs.h pci_if.h
|
||||||
|
|
||||||
.include <bsd.kmod.mk>
|
.include <bsd.kmod.mk>
|
||||||
|
|
||||||
CWARNFLAGS+= ${NO_WARRAY_BOUNDS}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user