From patchwork Thu Jun 27 16:38:34 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: 807848 Delivered-To: patch@linaro.org Received: by 2002:adf:e842:0:b0:362:4979:7f74 with SMTP id d2csp896753wrn; Thu, 27 Jun 2024 09:40:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUfL9Up7fc75pnCghAFpwavyQMQEhjmvNZUtrh34g3TmZKTavq+BaUp3tT0B7ssvA0GNSaQSOvA1OyWvED7I1Ym X-Google-Smtp-Source: AGHT+IGsfohCPoTnBlWzJ1l14fSJsqPaeO8ZXohK1t4sjLQIhrKBM/uAQxv8LYUcK8Aym4t2Sheu X-Received: by 2002:a05:6214:104f:b0:6b5:37f4:8945 with SMTP id 6a1803df08f44-6b537f48ba1mr162979796d6.9.1719506407777; Thu, 27 Jun 2024 09:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719506407; cv=none; d=google.com; s=arc-20160816; b=iYQzIY42KWzdVu/7j6ZRq3LU8e/uKvb108KrJei8IvbJAiE7hYnq/Xx8VV4CVy4Z0u B9CfY6NzUqj5dWF96BknSfhrgYSp3a6/C1RAYMncigIxka199KU87l/jCcJhhroLti1F vxWSAGxG2EpiomSbNzqn28/fxxZ0uY0qiq1DQvQSYVJrOatwD09S99i9xtRNiH+qvEzO JFyeac+Pt5MaO8n/zpH49aROvohXduSz7uH9hA+5jCOaE3FwLhDVojQLscqz+KqBtfk+ bAeL8/MBl+wpR3hpebcc+3yNiDEtZ5yDCknxFtg4eeLFgLHdpfFp1Hqteril5jWc117R QJkw== 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=0hugKoDWkNwghwH1h1z7n8tbSuuJya6Cw/1S35GizWg=; fh=E5m7+9HN0zGcNIUskxjX+xkpcxQksSinAMYSY8RmZaI=; b=cA7tX9C/NFS4YYm4p6eY6MOFg/4i4wXQLnIcVAksS5IMBAcXHb4lx/mnWzW8/LVnat TF4Z0pSAgnYrTUusiCUgQOKTnVEmQqQ+p4Jk3BQniYsDPOakLivOI9uYwYDN5kkaj39G oGe6meB4VSjxlUWK5APo8YYxV3rMBe6S/SLq+zZU+X9kfHseW/0GTziRNBUilROs1L7b NN/fdZH5LjEoddo45g052QNZffkMsPIGHC4+h4Qp4b7ba6uNbVsTcFelTSVMXnzV09ya 2Y9o5uKzD93iSY0UDvr5iQJJT1w79eWV7o0Gg8jSqoe7qHgqe9Yn1wDaFHxRLgLiCmRo I3kw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IZkqlfHn; 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 6a1803df08f44-6b59e36c130si304906d6.138.2024.06.27.09.40.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jun 2024 09:40:07 -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=IZkqlfHn; 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 1sMs9V-0001Ak-C9; Thu, 27 Jun 2024 12:39:17 -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 1sMs9U-00018M-Hk for qemu-devel@nongnu.org; Thu, 27 Jun 2024 12:39:16 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMs9S-0006sv-R2 for qemu-devel@nongnu.org; Thu, 27 Jun 2024 12:39:16 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-354b722fe81so5420883f8f.3 for ; Thu, 27 Jun 2024 09:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719506352; x=1720111152; 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=0hugKoDWkNwghwH1h1z7n8tbSuuJya6Cw/1S35GizWg=; b=IZkqlfHn2xRbZiTMTpxadh8ibDKPx4JoyV7me9WQwHciw729I9kPF+N3LSSpOS4VTt rNE61ayGllO1s+yEDEJi4dGx8vm3H55L0np98B29mkwOLlEXwsoN8ieyuc/jyx/z7Uz+ bYY5XAUeVnLMtm1D0QRo2Y3mgYeb+q2f/qc9NSJ4eRay+o2X7qtC4Eue9jANfH8+V1Gs l/RFfwnGffPFUStRjHUrtXXnvUFc2ABk9OONnySjidFDiQt4HNs5bUkbf9+MR8cBffuo qH9E97YjsOkTu+n1HBrwuPAt0z8Hv7mNurp5UxghlyC1stFoSJ+PsZ+WnIN315JrHVSu 5LKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719506352; x=1720111152; 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=0hugKoDWkNwghwH1h1z7n8tbSuuJya6Cw/1S35GizWg=; b=cI71m+tdvBaToZloEDNcHcAgTzUQSnDO1p96oUR0vYOOgirbt8pyCrw00Ncxxirq9R Za/f7hOdBWrvtr5XuujxmmsAelxQ9GVqVfo+IVRMUCRtoAL3KHkqZALm6IjzyjURVHiv Q29vy4M5Q8w2h1NDqT5ZUb6DouBk13/UN3kF3L3IBwrgr52CgbRYu8rrLoN7SD76la1i 0u3ckrFEXFAZxl0bkuzSAjT0/QW1ZAuMxhEQVbwOPZ0ykRmrGqnYcruDVn8thwZ962wD cyChElKk0WoF2AehxxseuMFDVgfGqEKSjOH9ondymZ6htHXQ2QHObNr+O+9w3vjoSpCD ALXQ== X-Gm-Message-State: AOJu0YxO1/o1cC/9q7XlPDhc+RtkaDw2lRRCor7ZObPbUkEOpIC48ZX+ YlU3uYR3riPyTV/Mpei02S8YIdJ+C5/J6FjEegA/yuH/IOSS9paspaX+pAjQTSCuxjpByKWYzIc 14U8= X-Received: by 2002:a05:6000:d0a:b0:362:80af:1adc with SMTP id ffacd0b85a97d-366e4f00a9fmr9077082f8f.53.1719506352181; Thu, 27 Jun 2024 09:39:12 -0700 (PDT) Received: from localhost.localdomain (33.red-95-127-46.staticip.rima-tde.net. [95.127.46.33]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3674369ed92sm2384487f8f.105.2024.06.27.09.39.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 27 Jun 2024 09:39:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Joel Stanley , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Francisco Iglesias , qemu-block@nongnu.org, Sai Pavan Boddu , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Bin Meng , Luc Michel Subject: [PATCH 02/11] hw/sd/sdcard: Pass SDState as argument to sd_[a]cmd_name() Date: Thu, 27 Jun 2024 18:38:34 +0200 Message-ID: <20240627163843.81592-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240627163843.81592-1-philmd@linaro.org> References: <20240627163843.81592-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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 In order to access SDState::SDProto from sd_[a]cmd_name(), pass SDState as argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 93a4a4e1b4..f4bdd12b26 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -233,7 +233,7 @@ static const char *sd_response_name(sd_rsp_type_t rsp) return response_name[rsp]; } -static const char *sd_cmd_name(uint8_t cmd) +static const char *sd_cmd_name(SDState *sd, uint8_t cmd) { static const char *cmd_abbrev[SDMMC_CMD_MAX] = { [0] = "GO_IDLE_STATE", [1] = "SEND_OP_COND", @@ -272,7 +272,7 @@ static const char *sd_cmd_name(uint8_t cmd) return cmd_abbrev[cmd] ? cmd_abbrev[cmd] : "UNKNOWN_CMD"; } -static const char *sd_acmd_name(uint8_t cmd) +static const char *sd_acmd_name(SDState *sd, uint8_t cmd) { static const char *acmd_abbrev[SDMMC_CMD_MAX] = { [6] = "SET_BUS_WIDTH", @@ -1281,7 +1281,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) uint64_t addr; uint32_t data; - sd->last_cmd_name = sd_cmd_name(req.cmd); + sd->last_cmd_name = sd_cmd_name(sd, req.cmd); /* CMD55 precedes an ACMD, so we are not interested in tracing it. * However there is no ACMD55, so we want to trace this particular case. */ @@ -1748,7 +1748,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) static sd_rsp_type_t sd_app_command(SDState *sd, SDRequest req) { - sd->last_cmd_name = sd_acmd_name(req.cmd); + sd->last_cmd_name = sd_acmd_name(sd, req.cmd); trace_sdcard_app_command(sd->proto->name, sd->last_cmd_name, req.cmd, req.arg, sd_state_name(sd->state)); sd->card_status |= APP_CMD;