From patchwork Mon Jun 24 13:14:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 807024 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp1877110wrt; Mon, 24 Jun 2024 06:15:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1Pzxs41zynkWWuhTHNEbhjSGj5rhBw9kjXzHB4d2P2ln0R6q67PKvrOmV61f8Yrig4gXGB7omn5JqXVUzxNmf X-Google-Smtp-Source: AGHT+IGpwSHkB0EjemRUF+1tbWc9+zxvLgGn/uVsG2NJrJYC6/JP9k+m5ZrXmT2gFl5pUJqNFaij X-Received: by 2002:a05:6122:208a:b0:4ec:f7d0:e71c with SMTP id 71dfb90a1353d-4ef6a5dd33emr2794744e0c.4.1719234955227; Mon, 24 Jun 2024 06:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719234955; cv=none; d=google.com; s=arc-20160816; b=p+Z39oxUJimZiyET4czijyRp+kR4LNFJjHYyHup2crZ+k9NIQTyz30/vnwNc4cd/Io aTPhov/Y/tQoMtx4w7CP2wrqr4aiGQ7x4TaBmXjh7j5NHGFuytYhwhvx/G63H91Z2Z9l j2zZxWfT8gBpyrJlmVNok3L35sGWCHK/P8YIaV3GQzeEPilZeZuXaQq+LlU54Tp0MTsk vxcgHBJyOoiGk1PXjNC3BL+uf6gb5aJvFUOQI6S/J4oN6nc6PvLwupcz573W3FmL8hs8 /Asar/EKluv9Rtx9gBClkcbS0IY0aHPEolwRpt8A53ShOHdVtG+0itUB6INhU+dODM2S /sMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=cGq9CknDLxCzVytX4zHmuSLklJOyE1bcs9yCSxS9ogk=; fh=SWrD6ZzKChsLNd0MI2/W9aN13/YqYpoy69YA//3JWDk=; b=mM0u/OgMg5qyFBL/9thPGrBA1Tz6AF4/ueBybH6tmwX4hqfn2tJNIrv4vhA+ZLlKEM 6mR7OYrvLpRVdp0KZOicQWDiU6owsMA2jlZcKxY0H8Cr3ejzZk01KYjCNeQGseyrEBG1 GyRP0JydTuGnHShnyQ8s8V/2Kowu/4tkhg0px6mIPwsfhX0Qk4wkOkSBoYG2iR9fuhyG 5yqVUqLOvb7aSEJsMEBBVZlmy9e/p97ovRs914d8PFChM07pGyoXm7Qrm2ppjdTAvapc jxO9v7awi+VX9rwazv897TMxomQpRdJUPW/BSXJXDh1rH1+rTZ4miuUyH40vzjDqng9l kfjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CmaqscEN; 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 71dfb90a1353d-4ef611a0b33si513785e0c.40.2024.06.24.06.15.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2024 06:15:55 -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=CmaqscEN; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLjXZ-0002JG-RQ; Mon, 24 Jun 2024 09:15:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLjXW-0002GK-0d for qemu-devel@nongnu.org; Mon, 24 Jun 2024 09:15:22 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLjXU-0005EN-BP for qemu-devel@nongnu.org; Mon, 24 Jun 2024 09:15:21 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2ebe40673d8so49021551fa.3 for ; Mon, 24 Jun 2024 06:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719234917; x=1719839717; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cGq9CknDLxCzVytX4zHmuSLklJOyE1bcs9yCSxS9ogk=; b=CmaqscENhnn2kYiljC6eAO0ISCj2LFcmNolkxTeqx0/qXdk3qTjpKbOdw3GlHvu/2p 3vrCvOO4uVsx/lrsSqDWUWkw8P81BbvtDEy5b0GiZ0pK7BWd5R0N5mkCPgFkMTJMvXzo pi2OYWlkgvIJtf5GOwmtEfEhPSJeqHawfwvdgTY08Jvb2fYKvRi5tweV7eXnSJL3VvDG kZd+WXvj0r80o2Uc4PhALcv8YIZaG2fRFehPm58lni/2m/2KEQ4LuvsIMuRRwRnCLmU/ js2RJ04vOKVT3hLCISRw11ERJbWo0/oQRDrJanjTXuYmAzWRiRUmOyHVqK5IxKeiSfGy BMlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719234917; x=1719839717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cGq9CknDLxCzVytX4zHmuSLklJOyE1bcs9yCSxS9ogk=; b=uxEgZ/L3HO63I41dgdktPO5yp+O4JBjxTHEknLoAmGyDvy80Lpnvfk/l8mbjbPvNHh AI3NZtMxfnn5G12XPukmFK3kWFxyaxeNEzEjFnLyCqrGsmp98lYVOXiJQf0aEPhpNg4L JlOsp4RVxuNqfowtgKosWs1c7Ifi16OBJ+0B4gUeLlEYl1tmWJxrVrfwpnSbtEuhod+h S/x1gK6WaM6xJhMh8ma2oQODz/4HD6V793ahOeShF6JEloezRI72uyiDEHH5fc3wwfxq J36oBWRiudLUuQMbDYz+y3RagSAD0BOZ59kvBj47iVB3iqsGFVF9VhDOj/AiK5hiOC09 hx3Q== X-Gm-Message-State: AOJu0YykswFW4LDnF96ZDyHG3/D49V4BiEKupfNq2ETuPm7jz6fcpXng o1+3i+xhvCRQieOgcjgveU6nHHe0Cy6IyCbOJLU0o9umBK4FFloRUlasUdzBk4z2/eFHE0tOreS c X-Received: by 2002:a2e:9e0d:0:b0:2ec:49c2:a79f with SMTP id 38308e7fff4ca-2ec5b388519mr25367741fa.42.1719234916739; Mon, 24 Jun 2024 06:15:16 -0700 (PDT) Received: from m1x-phil.lan (bd137-h02-176-184-46-22.dsl.sta.abo.bbox.fr. [176.184.46.22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d0bea05sm173281545e9.18.2024.06.24.06.15.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Jun 2024 06:15:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C=C3=A9?= =?utf-8?q?dric_Le_Goater?= Subject: [PULL 06/19] hw/sd/sdcard: Use HWBLOCK_SHIFT definition instead of magic values Date: Mon, 24 Jun 2024 15:14:27 +0200 Message-ID: <20240624131440.81111-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240624131440.81111-1-philmd@linaro.org> References: <20240624131440.81111-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=philmd@linaro.org; helo=mail-lj1-x235.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Message-Id: <20240621080554.18986-5-philmd@linaro.org> --- hw/sd/sd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 72d71259d3..a14c5ff147 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -596,7 +596,7 @@ static void sd_reset(DeviceState *dev) } else { sect = 0; } - size = sect << 9; + size = sect << HWBLOCK_SHIFT; sect = sd_addr_to_wpnum(size) + 1; @@ -822,8 +822,8 @@ static void sd_erase(SDState *sd) if (FIELD_EX32(sd->ocr, OCR, CARD_CAPACITY)) { /* High capacity memory card: erase units are 512 byte blocks */ - erase_start *= 512; - erase_end *= 512; + erase_start <<= HWBLOCK_SHIFT; + erase_end <<= HWBLOCK_SHIFT; sdsc = false; }