From nobody Mon Nov 21 13:53:25 2022 X-Original-To: dev-commits-src-branches@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 4NG8461jtWz4j5qD; Mon, 21 Nov 2022 13:53:26 +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 4NG8461GBwz47ML; Mon, 21 Nov 2022 13:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669038806; 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=kXadvLeqXZ+mKEqiAsGbOau+LLuhXKrAX/ol9sPZk8w=; b=kQzqAk0Hm2UEIxrfhXK3GkUhobfF3cFJHXGc5Eq1sgNrM5ZeDKommkP3vPiJbR82QutoyK ponvkzdAQY71StagQ+8LpQdQnoDQi/A5W/vinqMu0hARml9ro4xh2ik8AjwjxhkY+DKR/Y FlgjPB1QqT7N4xwExmKKJXNlgCCj1GXuljn6c3pKywij4LssruetJdOa6yoYmoMPClMBtB tP9DPHl1M+7GGf1a5IxMIsGMujm22jS6mgq8qqqhjgc54EtRKSynAUBRwzh4HC7KK7SToJ vXVXzm2iNZ0lsS7/6cHz5azzoetEnaV8bQfMTL4UvPNXLWFG527/NJnoUsWs+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669038806; 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=kXadvLeqXZ+mKEqiAsGbOau+LLuhXKrAX/ol9sPZk8w=; b=iG8bYgTvh04qDrtUf9wAnga4zv/MeVDbZ5NmRrdqUsES8m9l0hLsMrlo6kyx5T47KJXBCm umLhnVZJwO6iOH21Y8UAUGrczAkFKzA4tg6+251vs5Y2X2xyohVaQkQfqfaBLGTbGNL9KO bPO9nk9EgdG28vr0YZ4ZvsW1rqwAbrpB9sQJS4U3ug4uMlKuBFGKwUgdSnviN6GtvDHSkD h9gbSjL18EsJTQSHqawJKfZitO5vqsb0sntOJp20tf1BTTojsL7Rb86arY5RcGthdqzRTB 5z4GGXlJTMARldSHj2gJ2hgSDgQ7ghzA9VhJRXNmux4lfRSH01hBhqDC2bjPiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669038806; a=rsa-sha256; cv=none; b=X4YVDLrOTAkhoSejR1nmNuglHZ3S9sLeY+cxN8Bb98FcW3GPV9FHeltzkUC1WPzxnMmAf7 2o9iN4y/fuQSzEwZUMzrKsNwV4e8+hQTk8fWOwXYle8jAp02aBZ9ehgGeI1JlWVjIBhq0T FfOdBO9ND72Gt9htYwSv3H30PMmTOrylQjySm4g9TIY1Q5w9yvq0l/ayYjRpK+B/3BEu8m 1a5Em2crQ3RZMnXElLHD6XAQK8l8CVuZ3daUs9W2fD/+tQ4Fg9jpNi+B4nLekbBlEYN0lx SBWin5v2M9MPZC3ot9hf0CeWRGB0Fb+ZJBkZTZupK3zvoTSzPGsNpLI7bcHvhw== 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 4NG84601Tkz15gL; Mon, 21 Nov 2022 13:53:26 +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 2ALDrPP0083444; Mon, 21 Nov 2022 13:53:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ALDrPol083443; Mon, 21 Nov 2022 13:53:25 GMT (envelope-from git) Date: Mon, 21 Nov 2022 13:53:25 GMT Message-Id: <202211211353.2ALDrPol083443@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 51425bb84689 - stable/13 - virtio: Silence a -Wunused warning List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 51425bb84689001515b15e52f713a979b4bf3cdb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=51425bb84689001515b15e52f713a979b4bf3cdb commit 51425bb84689001515b15e52f713a979b4bf3cdb Author: Mark Johnston AuthorDate: 2022-11-14 20:07:34 +0000 Commit: Mark Johnston CommitDate: 2022-11-21 13:48:00 +0000 virtio: Silence a -Wunused warning Remove virtio_swap_endian(). htole*() are nops on little-endian platforms. No functional change intended. MFC after: 1 week Reviewed by: corvink, jhb Differential Revision: https://reviews.freebsd.org/D37298 (cherry picked from commit db494ceb65ef301c8fb48f57b60c4f7a9cfebba5) --- sys/dev/virtio/virtio_endian.h | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/sys/dev/virtio/virtio_endian.h b/sys/dev/virtio/virtio_endian.h index 19d7fcc12079..5c9bc7ec8f79 100644 --- a/sys/dev/virtio/virtio_endian.h +++ b/sys/dev/virtio/virtio_endian.h @@ -42,20 +42,10 @@ * and the Host's (device's) endianness when needed. */ -static inline bool -virtio_swap_endian(bool modern) -{ -#if _BYTE_ORDER == _LITTLE_ENDIAN - return (false); -#else - return (modern); -#endif -} - static inline uint16_t virtio_htog16(bool modern, uint16_t val) { - if (virtio_swap_endian(modern)) + if (modern) return (le16toh(val)); else return (val); @@ -64,7 +54,7 @@ virtio_htog16(bool modern, uint16_t val) static inline uint16_t virtio_gtoh16(bool modern, uint16_t val) { - if (virtio_swap_endian(modern)) + if (modern) return (htole16(val)); else return (val); @@ -73,7 +63,7 @@ virtio_gtoh16(bool modern, uint16_t val) static inline uint32_t virtio_htog32(bool modern, uint32_t val) { - if (virtio_swap_endian(modern)) + if (modern) return (le32toh(val)); else return (val); @@ -82,7 +72,7 @@ virtio_htog32(bool modern, uint32_t val) static inline uint32_t virtio_gtoh32(bool modern, uint32_t val) { - if (virtio_swap_endian(modern)) + if (modern) return (htole32(val)); else return (val); @@ -91,7 +81,7 @@ virtio_gtoh32(bool modern, uint32_t val) static inline uint64_t virtio_htog64(bool modern, uint64_t val) { - if (virtio_swap_endian(modern)) + if (modern) return (le64toh(val)); else return (val); @@ -100,7 +90,7 @@ virtio_htog64(bool modern, uint64_t val) static inline uint64_t virtio_gtoh64(bool modern, uint64_t val) { - if (virtio_swap_endian(modern)) + if (modern) return (htole64(val)); else return (val);