From nobody Sun Aug 11 23:04:20 2024 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 4WhtWS4ychz5SRV9; Sun, 11 Aug 2024 23:04:20 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WhtWS4QyCz44mq; Sun, 11 Aug 2024 23:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723417460; 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=IwP7RZtcbfX+0RBuLiDe1wYoLzxOUM63dByB30ztcLo=; b=tVD/0wqM/ybwsEg+4aIjQwPQ49N67tjdVPyrm2ThC6ZP2TnBLZlIbv4vnlc60h3p+7XD29 XhZV1Ck0gx94axdyf47foPtW/KWv2CRW6TsOQz8ueZ5zoXogVq34N9qSi6ZVzfbO270k5h AItagrwKvyIKOpGr/+PykgVciNGWLcuS0b3xf6zMeXuB4Po0JoM30tyeAOVY8MsEdFdPb6 rsy3bgkkRwAdEqjMi5p5gL30O9XmESTLpEIbm+U1BgunCHUjwXWK4e3w0PfewSwE2VucsH 26MttbFgbBOouXddhDg0w7UHGFf4ixRLbDHnEqLQ9MQXja7UmGXukfWZW/VlbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723417460; a=rsa-sha256; cv=none; b=WSn+tBS6LgCHKsXdj0Hrtoz35zHVM0RcjfWmt2aiLkHCoGXIjZr/iGHug00Tyo3fQqYR4I kXE9OpTMIuZqh070yyOSn2JuRQQBu7csLtkyZhDYOJMokY1GsoBakrbJeDkNCe6UZ6eyq9 WiGUMVlOcWCZlQ0m2z/JlWkvDyvpv8DRfUrq9kY6o6Ap0FUNDHKedqytzXVHmZWK3+LscD 9BkzjFDpmhYxcozl0IV01a0UF5+6HtNZf4WSNS1Lx+aPbtuMete1GeQDx0RS6jm45TyTA6 1gXUZ2PAgBq5DBjtYywL8r0Aq3tYkW1O3GOP6PH/Y/7sg3DdBxYE2cB6nrDMfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723417460; 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=IwP7RZtcbfX+0RBuLiDe1wYoLzxOUM63dByB30ztcLo=; b=IW4+K7gK/aEx2Rdiv5frnmDS1sK2Dk9DkXC8yb4/r8L6S8oetqsd9PLvccy3lfzx8wgl7l gT5If1rb6Ui/eZxPl3bcSM0COuM/YjJXss1HrPKqsv+iL4DXXhs1Ig/48F4e7EFXoYRYpS ZL/tPvm/PSIHX6WouEwKPhDDC+FrF5HPC2wvfF1Oef8rpOU5VatfNA5l+ZIgDHjeUmS3fb i5unD7fOo1fPX/V2on9A8TOBk3/fT+W4KZCky7ovPY5t8a65SafNbV0xTEoR8GSZ9V3lp+ rHmBKLNVgUDBmtAs2ndb7Bz5+jT3vauVB2BDcysis90EBQG9vBQYR0mw/htsdg== 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 4WhtWS3zdCz13HB; Sun, 11 Aug 2024 23:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47BN4K2Y032627; Sun, 11 Aug 2024 23:04:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47BN4Ka4032624; Sun, 11 Aug 2024 23:04:20 GMT (envelope-from git) Date: Sun, 11 Aug 2024 23:04:20 GMT Message-Id: <202408112304.47BN4Ka4032624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f8a439c53840 - stable/13 - linuxkpi: use canonical tests for is_{zero,broadcast}_ether_addr 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8a439c538400f6ca67cbff71b98c29320a2ebf6 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f8a439c538400f6ca67cbff71b98c29320a2ebf6 commit f8a439c538400f6ca67cbff71b98c29320a2ebf6 Author: Ed Maste AuthorDate: 2024-08-08 00:00:00 +0000 Commit: Ed Maste CommitDate: 2024-08-11 23:03:42 +0000 linuxkpi: use canonical tests for is_{zero,broadcast}_ether_addr They are functionally equivalent, but the updated form mirrors the tests in sys/net/ethernet.h and avoids confusion. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21037 (cherry picked from commit a1295b24842d209e6bf93a4823193d56ad2db064) (cherry picked from commit 6fb0634bc4ce5fe32312a53031e56fe866b0b24d) --- sys/compat/linuxkpi/common/include/linux/etherdevice.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/etherdevice.h b/sys/compat/linuxkpi/common/include/linux/etherdevice.h index 89cd4c8e0ba0..5d3df744ae0e 100644 --- a/sys/compat/linuxkpi/common/include/linux/etherdevice.h +++ b/sys/compat/linuxkpi/common/include/linux/etherdevice.h @@ -53,7 +53,8 @@ struct ethtool_modinfo { static inline bool is_zero_ether_addr(const u8 * addr) { - return ((addr[0] + addr[1] + addr[2] + addr[3] + addr[4] + addr[5]) == 0x00); + return ((addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]) == + 0x00); } static inline bool @@ -65,7 +66,8 @@ is_multicast_ether_addr(const u8 * addr) static inline bool is_broadcast_ether_addr(const u8 * addr) { - return ((addr[0] + addr[1] + addr[2] + addr[3] + addr[4] + addr[5]) == (6 * 0xff)); + return ((addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == + 0xff); } static inline bool