From nobody Tue Apr 30 07:17:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557097383; cv=none; d=zoho.com; s=zohoarc; b=DpVNZlUBru5p1xFr7As0W3/WiCXz32q5GytQBTm1I827hQ4S0OAPOqDJfo2dST2/AXRf2Ee2IirjVQprSowCGJo6ECmVuW7zIQxj5vRNgfKNB6qMb6mob7672NQz+RQ4HEApcTuMYkj/UrqewM8yf0oWboLP2Dsw96IsTnBroM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557097383; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=fYRi1rr6ST/9NdXtpZZNkNsSWNRZI4lGfjsZPb43XKU=; b=PLt1fdngT7amNh1HZaripSWafuNk14laFYZCahmwhlOjWIEf7exu7wAcLRoofT2zZ0Vga3z88vPorRQu8GKrHHVK4a6itaSpZ7j26ERFbdBvtqWUY3n03zNdA59VjSHDmTKopViyK0oJCXe1a06cwf9DD0WK8rNCslcQhVaVXQY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557097383341629.1093712157201; Sun, 5 May 2019 16:03:03 -0700 (PDT) Received: from localhost ([127.0.0.1]:47424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNQ9s-0002E1-DB for importer@patchew.org; Sun, 05 May 2019 19:03:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNQ8j-0001ol-2M for qemu-devel@nongnu.org; Sun, 05 May 2019 19:01:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNQ8i-0002SA-4C for qemu-devel@nongnu.org; Sun, 05 May 2019 19:01:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55746) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hNQ8h-0002Rw-VH; Sun, 05 May 2019 19:01:48 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3ACAE46233; Sun, 5 May 2019 23:01:47 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-58.brq.redhat.com [10.40.204.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C564660851; Sun, 5 May 2019 23:01:42 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Date: Mon, 6 May 2019 01:01:40 +0200 Message-Id: <20190505230140.5661-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 05 May 2019 23:01:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] hw/sd/sdcard: Use the available enums X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We already define SDCardModes/SDCardStates as enums. Declare the mode/state as enums too, this make gdb debugging sessions friendlier: instead of numbers, the mode/state name is displayed. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 aaab15f3868..a66b3d5b45e 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -96,8 +96,8 @@ struct SDState { BlockBackend *blk; bool spi; =20 - uint32_t mode; /* current card mode, one of SDCardModes */ - int32_t state; /* current card state, one of SDCardStates */ + enum SDCardModes mode; + enum SDCardStates state; uint32_t vhs; bool wp_switch; unsigned long *wp_groups; @@ -1640,7 +1640,7 @@ static int cmd_valid_while_locked(SDState *sd, SDRequ= est *req) =20 int sd_do_command(SDState *sd, SDRequest *req, uint8_t *response) { - int last_state; + enum SDCardStates last_state; sd_rsp_type_t rtype; int rsplen; =20 --=20 2.20.1