From patchwork Mon Jul 26 21:47:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 485866 Delivered-To: patch@linaro.org Received: by 2002:a17:907:d92:0:0:0:0 with SMTP id go18csp4015475ejc; Mon, 26 Jul 2021 14:48:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLfhyM3Wy4GWDTLSTsRZo86Aou16hZJyi54bjH87YX4tgFXR+NdmgbIQ1NV6uv1ih3SHa+ X-Received: by 2002:a92:d152:: with SMTP id t18mr14105202ilg.34.1627336094751; Mon, 26 Jul 2021 14:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627336094; cv=none; d=google.com; s=arc-20160816; b=wuj6GZnJbYuI/WreL2thVE5HSDiNm0/tWLrUVzDHFcPx/0IDw7awzmrTcqZ3L80JDC wznp2Ko/8lVbxYJdaWahcPPymZHwbWc+o9gt3wafRt7//9nFyM68tD6GxXxgzsFm+nUb krqV9SW1rEByt4TU96+yGhQAHHWS91xkAKuvcfkpDvWlxMfFXIQe3csPGW4BguormC7v ZmVVS6igD32FWjr8cZdtHUutfPu9aM948cDJ58Y8m/0Kc0KqTCTukTfFtpsf9HqAL6fl x4bjBsgxYL8GRK3/BohtiXpSBlyIILq+WPpYYBYbmyAWFhFfgDWOSIXjrtBuH1fC98aN NinQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=zdI8+8nFNnxTYtRyQ8td0fUaRpYVtNk1B3zMGvwjcGA=; b=kkOJ+yl94ny2nAA7n7UYstJMETP4sTOVv9erD0vOwZmJWwV6yxOZ5yC0sV67ZrXlej S70M0en8Hx6v/oOUY0He6qBW95TkEjgzU146Fn31Y8YG0T++Hj5Un5OL/ZhRNrHiuNzA gqhgqadwi8IaDKOmsXpQ9TqbpbZNNN01kFu5CykSq/+VPbugpKFxRMLWS68xl86XA5YI 1nICT0x8xBgKpfVAHT7xNJuQd6NVKxPfgbKsc7YyloNVtm1J54nyWRA3GWVWGWhLzbgE RSis2HSPS3kzhLC7xJvtVEI5HGPzfexh4MoOix5pzFaIZ/H/GNf/dpdGBB3/OZrVfR4F lXHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mlC4dz9d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v8si1099796jas.68.2021.07.26.14.48.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jul 2021 14:48:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mlC4dz9d; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m88SM-0002UE-4E for patch@linaro.org; Mon, 26 Jul 2021 17:48:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m88Rn-0002P1-6W for qemu-devel@nongnu.org; Mon, 26 Jul 2021 17:47:39 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:36626) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m88Rl-00066e-LM for qemu-devel@nongnu.org; Mon, 26 Jul 2021 17:47:38 -0400 Received: by mail-pj1-x102e.google.com with SMTP id ds11-20020a17090b08cbb0290172f971883bso1016802pjb.1 for ; Mon, 26 Jul 2021 14:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zdI8+8nFNnxTYtRyQ8td0fUaRpYVtNk1B3zMGvwjcGA=; b=mlC4dz9dm5HBlcHuhh9jzfeJWxr1RKvDeSXrOF9F/ztICm5geh7LDty/NIBLaHOsnH 6DUUd3YDzPZwwhmTYXRGWNKO7/W8wLUZ/qHTKMPM88+GDPS0WXGySelmaKY4H3HtMxzs wgDo5kAOAUgGUIpCPISkkjIg2TrSsNF7d4RZ5m9h3wQRtFz0sskc1gYjssz2XBukpdZP 9xlnD2OOXZ1LeYCNSV76hsxHEogzdJflGx/MV8xYCA+uGPzwVIZmzBRa7gtqTkv9bYiR Kxsm4bSujwm2aTCDGE3fCnmSVanbYI7XH9Ua9JgisQUS+D3J/WL2LalMl3XYmRMSL8Qa JWgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zdI8+8nFNnxTYtRyQ8td0fUaRpYVtNk1B3zMGvwjcGA=; b=oAqjJwB14ujdD8RGpvc/MlBtm3Yo7sdhDjYYPTrkaDZ/wMEIXAsjym+QdLNcrW0aiz mhdiDU1T6Xo/vxMISqLQqYrkeWt444Ozej1yPMqJHo3vJabD2Y+oUPUIeCWdsif6hy7Z oPUWpu11at29kQDtkLDQXWt5ixwHh6u9iN9LEXAUcEV+vehXnacQLUSIrQ0YE/vvyCqJ QOprSGP1pn/dako21/s0nfQErkXIJ/D0yqB+Glyt5KCz0lrUXH3xQfqtysGWK/39fs5R aH6iN2RVtKl1TIzBHQn2J8SYLlobduC7lJfwH5anMYxshODD5muC08O+bTAmpSAoGtSl BqrQ== X-Gm-Message-State: AOAM531FrCTpSZ0kcUKv7YryVCWGG5BKeo5LCGWgiqSBd49EuWx80TXn BFbUfaW93nchOvjTBmdVROVJtJFIQfkacw== X-Received: by 2002:a17:902:e851:b029:12b:c50a:1ebc with SMTP id t17-20020a170902e851b029012bc50a1ebcmr13947312plg.84.1627336056466; Mon, 26 Jul 2021 14:47:36 -0700 (PDT) Received: from cloudburst.home (2603-800c-3202-ffa7-497b-6ae4-953c-7ad1.res6.spectrum.com. [2603:800c:3202:ffa7:497b:6ae4:953c:7ad1]) by smtp.gmail.com with ESMTPSA id e8sm997679pfm.218.2021.07.26.14.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 14:47:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL for-6.1 03/12] bitops.h: revert db1ffc32dd ("qemu/bitops.h: add bitrev8 implementation") Date: Mon, 26 Jul 2021 11:47:20 -1000 Message-Id: <20210726214729.2062862-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210726214729.2062862-1-richard.henderson@linaro.org> References: <20210726214729.2062862-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Mark Cave-Ayland , =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Commit db1ffc32dd ("qemu/bitops.h: add bitrev8 implementation") introduced a bitrev8() function to reverse the bit ordering required for storing the MAC address in the q800 PROM. This function is not required since QEMU implements its own revbit8() function which does exactly the same thing. Remove the extraneous bitrev8() function and switch its only caller in hw/m68k/q800.c to use revbit8() instead. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210725110557.3007-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson --- include/qemu/bitops.h | 22 ---------------------- hw/m68k/q800.c | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) -- 2.25.1 diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h index 110c56e099..03213ce952 100644 --- a/include/qemu/bitops.h +++ b/include/qemu/bitops.h @@ -618,26 +618,4 @@ static inline uint64_t half_unshuffle64(uint64_t x) return x; } -/** - * bitrev8: - * @x: 8-bit value to be reversed - * - * Given an input value with bits:: - * - * ABCDEFGH - * - * return the value with its bits reversed from left to right:: - * - * HGFEDCBA - * - * Returns: the bit-reversed value. - */ -static inline uint8_t bitrev8(uint8_t x) -{ - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = (x >> 4) | (x << 4) ; - return x; -} - #endif diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 6817c8b5d1..ac0a13060b 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -334,7 +334,7 @@ static void q800_init(MachineState *machine) prom = memory_region_get_ram_ptr(dp8393x_prom); checksum = 0; for (i = 0; i < 6; i++) { - prom[i] = bitrev8(nd_table[0].macaddr.a[i]); + prom[i] = revbit8(nd_table[0].macaddr.a[i]); checksum ^= prom[i]; } prom[7] = 0xff - checksum;