From nobody Thu Jan 26 20:27:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P2sh01WpFz3btKY; Thu, 26 Jan 2023 20:27:12 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P2sh0152Zz3QxD; Thu, 26 Jan 2023 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674764832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TNG5rP7xLfo8/RWIRUBpnck+VrSoxlK+acacU8A+KLM=; b=yI4MEypEZ9ucx9dkxWtB6EgWeMV8qS+djtfwgQ52v1Pl5S9RbrFOSGkVzCkWY0nnR4/+xQ 4/0vh+aWuO7sVqyOV0qOUgW+Rn5X1R69OdMQI90BSM6ioMDO7+jADS3jDe0Or0dfZgOpj0 tNvbb8hK7OeZjNO4sZ0WHWwWox2fPkqZoRp196zADlWmjyDgbdHGxBpZjn1K0/9pWOH8yn RnojqtuvSwQINrf4N5pfiCZ0zRi8Ta1SgR++xm6GAGjS9OYVlHp5zxidW0ZzgChSTQboJ0 0wp8zN37a0eKwvI4m76uswc5Dfd/xU4HkotjbPGnal70dt2ycwl1g15RtK+SJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674764832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TNG5rP7xLfo8/RWIRUBpnck+VrSoxlK+acacU8A+KLM=; b=e7jfGN9R8H+ZxJjE4kIBtxLmX+P8ImmdniCdHki/HUA7TYdGcprdM6Am8di4GY3GgRBOKq WW4jEHWZr+TqAvMw68oELWyEyPHBgOrfjZEYNwDwy6GQQ0eFybZ1qTe1CkGl2oKBeczozU Ts6++6I/w6ibeWR0PSolE3bHYmkWUgwF9T1UOUgeYmhIwapHuQeTf6K7BBryuODF7Xazq9 uhwT0CxzZrUVOEz5jZA+9lYaXgA2QDxf+YPaU7qaGIS0zt39v6jFTcGkx3bk8LCenMM9X0 bDtLXbamFlhYqe5L3ELeHBAQvb8bOSIFNKjptcOTLQT7BmHjnkc1xtxH/06zDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674764832; a=rsa-sha256; cv=none; b=xD8rcEi3LbJBiVZlQOwqRXKJgSiNws7qlgX5Yr9rI4Y1uMjE4N3pEhUtN7KNnXqfEEKd6Z iv9iQ7L5H+qJVnIjb3vrmGIu1uOfSVEESlmjIyDwYHUjovWzXHxK7TpWD2pjEAnuBe7Ccl TDkXdCnskDpSrjAml0LmasClQiZMRrMZxOB382DLef0g5cT0sHnMsDRAsnqNIV2wsKEfQd hSnMInY/t2ij3eeNO96ohkZOnlBJQXVFtYAmjixagp5ipR6fAoJ8aLIzbpqvCGvzXve1FG RzDjhYe5RxVd8uROnbnQHaMdJen4uwYBQ40hgwJTulTAdzzR4cvn6xLBgiDXoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P2sh00B4ZzjRs; Thu, 26 Jan 2023 20:27:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30QKRBpA064845; Thu, 26 Jan 2023 20:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30QKRBGS064844; Thu, 26 Jan 2023 20:27:11 GMT (envelope-from git) Date: Thu, 26 Jan 2023 20:27:11 GMT Message-Id: <202301262027.30QKRBGS064844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a4d4176aae92 - stable/13 - bhyve: Fix sign compare warnings in the e1000 device model. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4d4176aae9226cc07d278e40737a20358a054f2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a4d4176aae9226cc07d278e40737a20358a054f2 commit a4d4176aae9226cc07d278e40737a20358a054f2 Author: John Baldwin AuthorDate: 2022-11-29 01:08:09 +0000 Commit: John Baldwin CommitDate: 2023-01-26 20:23:42 +0000 bhyve: Fix sign compare warnings in the e1000 device model. Adding a bare constant to a uint16_t promotes to a signed int which triggers these warnings. Changing the constant to be explicitly unsigned instead promotes the expression to unsigned int. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37485 (cherry picked from commit e7cd5ffff88f1f4dfba2693041cc78fcf3613fba) --- usr.sbin/bhyve/pci_e82545.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/pci_e82545.c b/usr.sbin/bhyve/pci_e82545.c index 21e01b22ec4b..9d991b124965 100644 --- a/usr.sbin/bhyve/pci_e82545.c +++ b/usr.sbin/bhyve/pci_e82545.c @@ -1045,7 +1045,7 @@ e82545_transmit_checksum(struct iovec *iov, int iovcnt, struct ck_info *ck) DPRINTF("tx cksum: iovcnt/s/off/len %d/%d/%d/%d", iovcnt, ck->ck_start, ck->ck_off, ck->ck_len); - cklen = ck->ck_len ? ck->ck_len - ck->ck_start + 1 : UINT_MAX; + cklen = ck->ck_len ? ck->ck_len - ck->ck_start + 1U : UINT_MAX; cksum = e82545_iov_checksum(iov, iovcnt, ck->ck_start, cklen); *(uint16_t *)((uint8_t *)iov[0].iov_base + ck->ck_off) = ~cksum; } @@ -1231,9 +1231,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head, uint16_t tail, if (!tso) { /* Estimate required writable space for checksums. */ if (ckinfo[0].ck_valid) - hdrlen = MAX(hdrlen, ckinfo[0].ck_off + 2); + hdrlen = MAX(hdrlen, ckinfo[0].ck_off + 2U); if (ckinfo[1].ck_valid) - hdrlen = MAX(hdrlen, ckinfo[1].ck_off + 2); + hdrlen = MAX(hdrlen, ckinfo[1].ck_off + 2U); /* Round up writable space to the first vector. */ if (hdrlen != 0 && iov[0].iov_len > hdrlen && iov[0].iov_len < hdrlen + 100) @@ -1282,26 +1282,26 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head, uint16_t tail, * TCP | flags | 13 | 1 * UDP | len | 4 | 4 */ - if (hdrlen < ckinfo[0].ck_start + 6 || - hdrlen < ckinfo[0].ck_off + 2) { + if (hdrlen < ckinfo[0].ck_start + 6U || + hdrlen < ckinfo[0].ck_off + 2U) { WPRINTF("TSO hdrlen too small for IP fields (%d) " "-- dropped", hdrlen); goto done; } if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) { - if (hdrlen < ckinfo[1].ck_start + 14) { + if (hdrlen < ckinfo[1].ck_start + 14U) { WPRINTF("TSO hdrlen too small for TCP fields " "(%d) -- dropped", hdrlen); goto done; } } else { - if (hdrlen < ckinfo[1].ck_start + 8) { + if (hdrlen < ckinfo[1].ck_start + 8U) { WPRINTF("TSO hdrlen too small for UDP fields " "(%d) -- dropped", hdrlen); goto done; } } - if (ckinfo[1].ck_valid && hdrlen < ckinfo[1].ck_off + 2) { + if (ckinfo[1].ck_valid && hdrlen < ckinfo[1].ck_off + 2U) { WPRINTF("TSO hdrlen too small for TCP/UDP fields " "(%d) -- dropped", hdrlen); goto done;