From patchwork Mon Jun 24 13:14:33 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: 807028 Delivered-To: patch@linaro.org Received: by 2002:a5d:508d:0:b0:362:4979:7f74 with SMTP id a13csp1877493wrt; Mon, 24 Jun 2024 06:16:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUk03dExTpcotPz4bI7TjTfNrpiHSdEbr0gfF4QYfv9cLrSY+Sn5TGqSBh1HSEweAXiWpUaav3y10AXKxSHn8CI X-Google-Smtp-Source: AGHT+IF2Y3VGhontXnTFxxGxPDS+H2X0eCGwoHTyV6z/fsrBBNKm1MIqXJZOTD+N5Uy3RvAwh0mz X-Received: by 2002:a05:6358:3396:b0:19f:15b2:2825 with SMTP id e5c5f4694b2df-1a2389dc97dmr707078755d.13.1719235002602; Mon, 24 Jun 2024 06:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719235002; cv=none; d=google.com; s=arc-20160816; b=k+BlpbdiU0dV/mat2IKornIdPgFaVGM2mIecwpKjws0NOKHe3qkSeOnVHehoAWKFna r+t9EV0nfQJ9H+q9dTHyx9lP+klRwfaIGIU+TBAmZeM4fj1mdWVte7XOgFyOpYw05lXR AiWPd+SDkmTFjAOZzk7kvmgrCAexvZqTZaYDdIiJf2JQFVE6kDi6HS86zH+ZpRNupaE8 61kiNoUgGM013ERhsuCB65oBypCwu5evoRsvv03sxNf1plQtndBpL7yvzR1Pi8LAPBKn hl2NbD+A+L4LFQZlxqrGoDCIj3qYrbDAoKMC0YxxFKYyRtvlh8GJSeCnWxaLR4KOCafG kdZg== 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=DdZdPflGxnU9+ulU0ghp7a6tzZgDef0bM1QxWZe/c5Y=; fh=/TyiCVzPJVYkT4NtrOYZRXAcrkaiLXA/rwqp4QqIc5M=; b=ajR+o06ak1jiD59caHNVj4QXtFQdpcwzT0AcWsnqo6c8A2UmZ2IrCriGqqNvVWV9mF zqWiY8QlAGorG7tF8q9MGWZ6tT4IDKo1YW8oL3GGvRLUJtFSHIuCxE0sVcUUUKDf5TGW Nn//TJ9fQBDI8IBp9eTKwHQsmF8hnVQiqz9KDikaxup8hZzDS4FQWnfDc/bMfg3tdQ+Y xFr18z9G+mc9yW+GJzXcJyXcXLF/egwzH2ZpkEJeW3f2jh/eXg3zgwyEqLMtq1nEs2/G /q+a2su4iciN7OH1v5ehwCgV6YnkH5U0boKmVHad55AA8Z8DUxIz/lC6MxmeDhPJFowx 3r2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkgm4+aj; 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-6b51ef32f53si78993806d6.486.2024.06.24.06.16.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jun 2024 06:16:42 -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=kkgm4+aj; 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 1sLjY2-0003Fm-Aq; Mon, 24 Jun 2024 09:15:54 -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 1sLjY0-00031Y-6y for qemu-devel@nongnu.org; Mon, 24 Jun 2024 09:15:52 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLjXy-0005Wr-Ju for qemu-devel@nongnu.org; Mon, 24 Jun 2024 09:15:51 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4249196a361so6725015e9.0 for ; Mon, 24 Jun 2024 06:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719234949; x=1719839749; 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=DdZdPflGxnU9+ulU0ghp7a6tzZgDef0bM1QxWZe/c5Y=; b=kkgm4+ajCkOKNAuFarhMNdjDKQo1TAN09CQdAt06qAKOJVzbHJp7mhgcKvCefjFkJd ylMWs89fjow63WlaoufzDas4HeWu8n8QLp2p/B9Z2ZnWHdtxmHYcKldba7co4sAqNTGs GG8efpvGN8tyAIwAjtLNWt6XzMXNleh2l5xag1RWZC/fqUirCFZ6aohncyDyHOsFNqKC fxZvAyfLkKQBLF5GUsrn+Rt65kT1OBuUhSu3BhsQMSiO73QYO6lsw0X2i7ot7qYP6+KG MPz80+i6ut9LN0ijm0A0U442pwiniZKrvKU97mRqZOcmBhy9tBAA4godfuy0rGc9tzYQ syjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719234949; x=1719839749; 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=DdZdPflGxnU9+ulU0ghp7a6tzZgDef0bM1QxWZe/c5Y=; b=r5+Zd+eaETuOGuD0K3ZawCOEGmLDa2Yz6/UiH2go/6DKs64Kt7Ep67Axz93Jly+W+e IVFFXuRqE2nCEYufmMKcHvw1FMetA7G9N4Zd8LLLD55kMONyd1Ancqd385IDBCs0fJqe uMAeIoR/CFz8+6yztaRWDJkUo9/d45HF3iM0FW/C/1n5oijLF+Z9bb1/+4+nZi5GsblL 5fCSNCcjEN6L79DO49hI7kEssVt04OuboGQfO0tPKg7Hk53aJXHBsPI3YKsKHzvoCWlj mBouvETM1qO5TtegUcVQ3NwpRlwK+Ch/9wavShivV2XrpfZeMUHFiNsRJer2XmIksRkH AFjQ== X-Gm-Message-State: AOJu0YwzTW4f2gxQ82Yai59YjuOCBX/aPxVKMqANvpKBvA2uhankbwAH MWAVcbmU71cw8CoauiYRIPbWf/sUP50AHE6tVTdDcbXcl7K2njqHWAU+pYGaWR+fHREpECZ5YF/ L X-Received: by 2002:a05:600c:4fc9:b0:422:7c50:18ff with SMTP id 5b1f17b1804b1-4248cc66677mr29054385e9.39.1719234948767; Mon, 24 Jun 2024 06:15:48 -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-4248179d3afsm140585865e9.5.2024.06.24.06.15.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Jun 2024 06:15:48 -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?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= Subject: [PULL 12/19] hw/sd/sdcard: Have cmd_valid_while_locked() return a boolean value Date: Mon, 24 Jun 2024 15:14:33 +0200 Message-ID: <20240624131440.81111-13-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Message-Id: <20240621080554.18986-14-philmd@linaro.org> --- hw/sd/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 44225bae9b..04b141784b 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1717,7 +1717,7 @@ static sd_rsp_type_t sd_app_command(SDState *sd, return sd_illegal; } -static int cmd_valid_while_locked(SDState *sd, const uint8_t cmd) +static bool cmd_valid_while_locked(SDState *sd, unsigned cmd) { /* Valid commands in locked state: * basic class (0) @@ -1731,7 +1731,7 @@ static int cmd_valid_while_locked(SDState *sd, const uint8_t cmd) return cmd == 41 || cmd == 42; } if (cmd == 16 || cmd == 55) { - return 1; + return true; } return sd_cmd_class[cmd] == 0 || sd_cmd_class[cmd] == 7; }