From owner-svn-src-head@freebsd.org Wed Dec 19 04:54:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F5B4134B231; Wed, 19 Dec 2018 04:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB2897FBC; Wed, 19 Dec 2018 04:54:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E951197A4; Wed, 19 Dec 2018 04:54:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJ4sXRK005078; Wed, 19 Dec 2018 04:54:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ4sWJ2005072; Wed, 19 Dec 2018 04:54:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812190454.wBJ4sWJ2005072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 04:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342214 - in head/sys: conf dev/fxp modules/fxp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: conf dev/fxp modules/fxp X-SVN-Commit-Revision: 342214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0DB2897FBC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 04:54:34 -0000 Author: markj Date: Wed Dec 19 04:54:32 2018 New Revision: 342214 URL: https://svnweb.freebsd.org/changeset/base/342214 Log: 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 Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/dev/fxp/if_fxp.c head/sys/dev/fxp/if_fxpreg.h head/sys/modules/fxp/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/conf/files Wed Dec 19 04:54:32 2018 (r342214) @@ -1782,8 +1782,7 @@ dev/flash/cqspi.c optional cqspi fdt xdma dev/flash/mx25l.c optional mx25l dev/flash/n25q.c optional n25q fdt dev/flash/qspi_if.m optional cqspi fdt | n25q fdt -dev/fxp/if_fxp.c optional fxp \ - compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS}" +dev/fxp/if_fxp.c optional fxp dev/fxp/inphy.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/conf/kern.mk Wed Dec 19 04:54:32 2018 (r342214) @@ -25,7 +25,6 @@ NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-intern NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized NO_WCAST_QUAL= -Wno-error-cast-qual 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 # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/dev/fxp/if_fxp.c Wed Dec 19 04:54:32 2018 (r342214) @@ -1627,7 +1627,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) cbp->tbd_number = nseg; /* Configure 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->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE | FXP_IPCB_IP_CHECKSUM_ENABLE | Modified: head/sys/dev/fxp/if_fxpreg.h ============================================================================== --- head/sys/dev/fxp/if_fxpreg.h Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/dev/fxp/if_fxpreg.h Wed Dec 19 04:54:32 2018 (r342214) @@ -281,10 +281,15 @@ struct fxp_cb_tx { uint16_t cb_status; uint16_t cb_command; uint32_t link_addr; - uint32_t tbd_array_addr; - uint16_t byte_count; - uint8_t tx_threshold; - uint8_t tbd_number; + union { + struct { + uint32_t tbd_array_addr; + uint16_t byte_count; + uint8_t tx_threshold; + uint8_t tbd_number; + }; + struct fxp_tbd tbdtso; + }; /* * The following structure isn't actually part of the TxCB, Modified: head/sys/modules/fxp/Makefile ============================================================================== --- head/sys/modules/fxp/Makefile Wed Dec 19 03:23:23 2018 (r342213) +++ head/sys/modules/fxp/Makefile Wed Dec 19 04:54:32 2018 (r342214) @@ -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 .include - -CWARNFLAGS+= ${NO_WARRAY_BOUNDS}