From nobody Fri Nov 1 07:34:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1708020326; cv=none; d=zohomail.com; s=zohoarc; b=O801vJS7UdFEswCvFt6XkGOGPmyN6VN5Zw+zfccoPLjEWdot4CefdTQLyxasr6MWzDwl6YRFRQJSrEgOatdDhQdqz2CHffjxOVE9LZxmX8/8irfnEezVsIkzK3lzV9CkJEAbmbuBIpj31wZgm8CTtXfkyhamAodLo01BfnYgpPU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708020326; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xfCkJEQkL13uYlKC8WYjGFkI0aspDHRkh5m4W/eac1U=; b=E+pk6xU8wauXwtvEXfF9ow5kaOV7zz/xm83LGpawiI2ug5/0zQfNGBKUFa4dm65NTG2Gejhot1tE4fp03iphrES+06rZosLqVwhxDwu0GoByqQdHafxG1KIhZMkRzCAbZa8e/ILB7lXYuI/XltcJmtrdA/e+sCfCBKGlwws5jOs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708020326575815.4195595473398; Thu, 15 Feb 2024 10:05:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rag5U-0002O7-TA; Thu, 15 Feb 2024 13:03:56 -0500 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 1rag5L-0001wn-Ho for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:03:48 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rag5J-0003CR-3C for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:03:47 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a3d6ea28d46so263027966b.1 for ; Thu, 15 Feb 2024 10:03:44 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id s13-20020a1709066c8d00b00a38936aa08dsm791978ejr.32.2024.02.15.10.03.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 10:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708020223; x=1708625023; 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=xfCkJEQkL13uYlKC8WYjGFkI0aspDHRkh5m4W/eac1U=; b=DdTLLq3zRc2SElnLLqfSZBeBKHVyNTskJqyIQQ6LEIeMyycTPQIlvPtefsgXEuhS29 2wKkEPp7fh85sxwNsGDYtTveoxUGw1oU72d9Q2LuVU2smoUKLNKXNB+yMKNsLX9Zjln0 mk1TCdx/hSG/ppzdSiOv5nY35d2Ujf+lKwj+Miw7dZy0Xrucz8NDc/IenvZlRr1a1q2U ASfVkJgHAZ4+Nj9fJ3vuTeblqJkrej2W926ovZWO9n2onrVxhBdGuPKiybeFcK+9PUFl oJIuRBh+ERNFjWcRf6+prwjs4HxPbtXAhFr86SA2md4kuQmOoiTt0gpvsiEzt+w3/OcC qRSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708020223; x=1708625023; 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=xfCkJEQkL13uYlKC8WYjGFkI0aspDHRkh5m4W/eac1U=; b=bf3NyEyr8jCDHscCxwr6CzMj2W/CHL62LwrR45XHP3svFG7DdS+oK7CfgYZx0hrHUi 2bm5HKhUWUaUoHS+ZOTIO0EwK52etjGRxxqDEsrKhzS/Wzbc6E8moPtl82vDRfuJTjmH yhauTnpqucNRYGlURjmRB1F6U0rdJXmgOGsYVp5uzKl62PHuTofD9UUIXdXm7XqZTwCj si+gElDB18NFLSmn22oqSA6vEQWRQfyNNHGGWPksvrnKjIORAAba1Z7J7IXFD72t6cn8 diI06V+BuV7rARibCJI/RGLJ9/MkkDga4m+PvEc/mbbh2pHNaPALHXEOzCGH97hXZ9Jb YMMg== X-Gm-Message-State: AOJu0YyoC4sIytJWr7ADlLDxI+llrGy8I35Mivc7vtjhqkHk5VuD9oR+ u8DP3arGxEQXkwDXI/NEEsvucRS1EZ9O6r6PLLVg+zp/dkIubHQq3aTJtnapbJovzfXJIXH36dm aRS4= X-Google-Smtp-Source: AGHT+IHmkJone5BX9dptvxAsjufks1nCpyTu6Mehz/epzlEnOmQptFkz7jJim/WyCtDZAVtMML28pA== X-Received: by 2002:a17:906:bc4e:b0:a3c:a545:5fd8 with SMTP id s14-20020a170906bc4e00b00a3ca5455fd8mr2480206ejv.26.1708020223279; Thu, 15 Feb 2024 10:03:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" , Richard Henderson , John Snow Subject: [PULL 52/56] hw/ide/ahci: Convert AHCIState::ports to unsigned Date: Thu, 15 Feb 2024 18:57:46 +0100 Message-ID: <20240215175752.82828-53-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215175752.82828-1-philmd@linaro.org> References: <20240215175752.82828-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1708020326893100009 AHCIState::ports should be unsigned. Besides, we never check it for negative value. It is unlikely it was ever used with more than INT32_MAX ports, so it is safe to convert it to unsigned. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Richard Henderson Message-Id: <20240213081201.78951-7-philmd@linaro.org> --- include/hw/ide/ahci.h | 2 +- hw/ide/ahci.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index 8cd55b1333..604d3a0994 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -46,7 +46,7 @@ typedef struct AHCIState { MemoryRegion idp; /* Index-Data Pair I/O port space */ unsigned idp_offset; /* Offset of index in I/O port space */ uint32_t idp_index; /* Current IDP index */ - int32_t ports; + uint32_t ports; qemu_irq irq; AddressSpace *as; } AHCIState; diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index bac1871a31..2c3306dae4 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1819,7 +1819,7 @@ const VMStateDescription vmstate_ahci =3D { .version_id =3D 1, .post_load =3D ahci_state_post_load, .fields =3D (const VMStateField[]) { - VMSTATE_STRUCT_VARRAY_POINTER_INT32(dev, AHCIState, ports, + VMSTATE_STRUCT_VARRAY_POINTER_UINT32(dev, AHCIState, ports, vmstate_ahci_device, AHCIDevice), VMSTATE_UINT32(control_regs.cap, AHCIState), VMSTATE_UINT32(control_regs.ghc, AHCIState), @@ -1827,7 +1827,7 @@ const VMStateDescription vmstate_ahci =3D { VMSTATE_UINT32(control_regs.impl, AHCIState), VMSTATE_UINT32(control_regs.version, AHCIState), VMSTATE_UINT32(idp_index, AHCIState), - VMSTATE_INT32_EQUAL(ports, AHCIState, NULL), + VMSTATE_UINT32_EQUAL(ports, AHCIState, NULL), VMSTATE_END_OF_LIST() }, }; --=20 2.41.0