From nobody Mon Apr 29 12:20:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) client-ip=209.85.128.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599722610; cv=none; d=zohomail.com; s=zohoarc; b=RT2b8GgAmgNXGjpRE7Y2bEI8nZLBgz5pji8/FiAWoRSMQZcF3M4cW7eto/puMXweGA5QUt4s8nXjCDPPrNWNbsCohBtE2t5oN6oijoAnKvfeJgtV0XDobXyNdlbjTL3mBuKOg+J9fS7fksiGu4zrm7giUTyjPtOBNSKVkrXtSB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599722610; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t4kTfpWibJLcPX1miKAIAIqMzQ2vkU3n7DRrDkK4dk8=; b=NNres6g3XpqeUrVCBJ2PlvHAmQ6MbU+rhVL+nFOA5WCSRLSx0NxSiuOM0gCpmLjgHDesb+p88O6odXM1i860K2BoYSd9FDM6XytaN1TdL5m94K2MOyTJNcyzjsBGQkwjyg1SKyTOuq0KIOn4e/wgJw2nJqBjFPW20fP4cnG1mJs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.zohomail.com with SMTPS id 1599722610637260.1200964678127; Thu, 10 Sep 2020 00:23:30 -0700 (PDT) Received: by mail-wm1-f65.google.com with SMTP id z9so4701842wmk.1 for ; Thu, 10 Sep 2020 00:23:30 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id x2sm6783804wrl.13.2020.09.10.00.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 00:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t4kTfpWibJLcPX1miKAIAIqMzQ2vkU3n7DRrDkK4dk8=; b=lySK3Ik4aggs5kzMHlWai0SL7UyMLQETZqBZ9/AR6fbrgiyzPaDgLX7nfVkJe0f5sD sBv3Zcb1XUmFMJuuFPzyjindOu/U6x5BqLlK9DnwqqO3yNe9/380TUYWG2Ledaw9qTTF +2XilGatQhxBOHk77IS8nR/bvoo4rnuuA7OHBBrU1NTHK0ek4dpBoviMoRKa8CggXS66 j0fAbf/ldAD9tmWAvQYBPu0iqZP945BPeNhopgx0UyWiTsgLa+u8jjknnkdznB+EIotQ wtsF7bKNW5SKE8u2/XertEDI/8JDINVn5tAhfkVUwROznnq6CTTans8YOt1m6H6f4SHt dOsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=t4kTfpWibJLcPX1miKAIAIqMzQ2vkU3n7DRrDkK4dk8=; b=sTFaUElR1h0bAKYDWWEheTvl2HcZNdcduh2ux7K4aM+u3uxFddDma9NVZjfxcttKfn Z1Yffi7kx4Ge2jpz7TXc6+co5Iy8gH1Nst7O8sAO+xZlxfmV7ZhKa19qdFAsbMVi6aRk WuW21EB76C8h5C8FxnxNnJu+RDr4mZd2LHzGuYigG/u4jDsWQHE5Mzb1jOr8sAee84F0 3rG3eAgxm5alZWTmc9VwXTYxY9JpP8qxwTOLkjB3LQHOuSSB05+guBm1wYGalQ0qrh/S 73iIrJtwTXs0m89RChDHvE+UQjaarD/bIdcx5Bx1efYAQiwtYhQLh8dDJf3RR1E2F3aD nZrg== X-Gm-Message-State: AOAM530rG/B/BL/BhkAF4g90s6OB1DSI9DOtmCr2hOlghvWoBpRus61R FBRVbb3hsHVqF/5sTqz4oFo= X-Google-Smtp-Source: ABdhPJwi9hutOnXWrSLkvEs0WvrNZlVwpMeuo2oy3RykGWLrUsYEOGp2i1exvAKIPspRd0wPK1HDgw== X-Received: by 2002:a7b:c84a:: with SMTP id c10mr7019905wml.139.1599722608717; Thu, 10 Sep 2020 00:23:28 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-trivial@nongnu.org, Andrzej Zaborowski , qemu-ppc@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/2] hw/gpio/max7310: Remove impossible check Date: Thu, 10 Sep 2020 09:23:24 +0200 Message-Id: <20200910072325.439344-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910072325.439344-1-f4bug@amsat.org> References: <20200910072325.439344-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The max7310_gpio_set() handler is static and only used by qdev_init_gpio_in, initialized with 8 IRQs. The 'line' argument can not be out of the [0-8[ range. Replace the dead code by an assertion. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/gpio/max7310.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index 4f78774dc8f..158b0a074e5 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -8,9 +8,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/hw.h" #include "hw/i2c/i2c.h" -#include "hw/hw.h" #include "hw/irq.h" #include "migration/vmstate.h" #include "qemu/module.h" @@ -173,8 +171,7 @@ static const VMStateDescription vmstate_max7310 =3D { static void max7310_gpio_set(void *opaque, int line, int level) { MAX7310State *s =3D (MAX7310State *) opaque; - if (line >=3D ARRAY_SIZE(s->handler) || line < 0) - hw_error("bad GPIO line"); + assert(line >=3D 0 && line < ARRAY_SIZE(s->handler)); =20 if (level) s->level |=3D s->direction & (1 << line); --=20 2.26.2 From nobody Mon Apr 29 12:20:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.68 as permitted sender) client-ip=209.85.128.68; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f68.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1599722611; cv=none; d=zohomail.com; s=zohoarc; b=WxI0NuX1sMAb5WXj1gN4D16Qf+cK2QDk6bqr4bVKRRUERFFyQIsCuN2SbNvuM6609dlWraafM44x5Un3YeXeEcG47pkD3VR4hogAFAGZqPSbVwMY4J3qURGuZQi+vQBbx+XOIM/r/sNruvJ4mUw5V4iHgMxao+nuazuuIEMaTmE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599722611; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2ze5QYyQyWojYS3caRCg7MlGDCArBjQK7biaiEuZNBk=; b=NRBBVKTi7EVQYdIPDAIuUHyCBDw62DZVGPulq/pWLfKWP3fvV13s54ESQMsbzdbsKrwre6r6UXQIwmJnESrxYN0CC7WCA4ZbiG6QJaUcV9D/iLEa5XHfqZA1t9w4uDiUIRvAFsEEdWf/46nDl1pCCXO/jfk4OPnhAnOSpeXRXas= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.68 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.zohomail.com with SMTPS id 1599722611946458.743155401998; Thu, 10 Sep 2020 00:23:31 -0700 (PDT) Received: by mail-wm1-f68.google.com with SMTP id e17so4550426wme.0 for ; Thu, 10 Sep 2020 00:23:31 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id x2sm6783804wrl.13.2020.09.10.00.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 00:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2ze5QYyQyWojYS3caRCg7MlGDCArBjQK7biaiEuZNBk=; b=mMWthuA7lfFfckReUdKJD11EGyTiCsucUYTnNgNAYKNKXacZE0IAu3D7lky7UQ8ZVU rmAMAKtH2m0PoNQ+9GDOPPYZci7fu7rGq8ElL1VQGHhrH+rRvJIau69qCOMJkZ80zhzh WFPRIPA5unX+FOo2xXHZfw8QVFST615jOS8/7fdreULd41m2wwVmHzphZ0+Z5sTxA/0c b+Ws/NRF6hpRx8edwtoCJ22MQaduYnO44/19vIsyO+PbmIplIeJJmW/Li9u7NIaMIwkc gCcxxYP5T6uz73qlzgc1oLcZQ8Y1iAdG7HHL4rxrkgkQKzrgSSmQViMxQZGFJ2uDB+/7 v+gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2ze5QYyQyWojYS3caRCg7MlGDCArBjQK7biaiEuZNBk=; b=YsshBKpiXz7xuS6FI8IreDgrtx9T8E5iKrgQwfoCG2SICI0coCXTG1rlEMecn9L71/ VLF3eDIgXCR64xUD5y59wvszoalg75RbrJJuyI20vCDaBeb0ANzACIbJgjynnPh+RvKF wUULMg14taewoJq1+O3VE5haqytbviL9U2ZF+y5Fmiae9yLkpvgOfiHjY0A6tsSMBtQd Q++tbPpj4WYlanVKisD/1+z3r+9FS4Nw2TDv/mNDoAY2X9ekvLXu6C4xzqQ9f/SB8rfl wv58wh3dHl+LT+15gbqd/RRi0/dMIzc7m2emEt/IfjQDwjN1o/lBuEOhXuYoMVl/V2Fx RzzQ== X-Gm-Message-State: AOAM530tQDhRlW6wQuFVRA3bOzaoTyZZ2r9C2JiMJNk5qEyMvGrqNgfb D0fljJuQ8RM7pc4FLQFG6zM= X-Google-Smtp-Source: ABdhPJyR+sTyKvk5uqPbgUnZe+Vtyfh7IqxAaJ1WzYZmrVquG7jGuo3P49IiowyPPhG49ZkjeGbe8w== X-Received: by 2002:a1c:8109:: with SMTP id c9mr7068919wmd.130.1599722610036; Thu, 10 Sep 2020 00:23:30 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-trivial@nongnu.org, Andrzej Zaborowski , qemu-ppc@nongnu.org, Peter Maydell , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 2/2] hw/ppc/ppc4xx_pci: Replace magic value by the PCI_NUM_PINS definition Date: Thu, 10 Sep 2020 09:23:25 +0200 Message-Id: <20200910072325.439344-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910072325.439344-1-f4bug@amsat.org> References: <20200910072325.439344-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Replace the magic '4' value by the PCI_NUM_PINS definition. Suggested-by: C=C3=A9dric Le Goater Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson Reviewed-by: Richard Henderson --- hw/ppc/ppc4xx_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 503ef46b39a..930be78361d 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -54,7 +54,7 @@ struct PPC4xxPCIState { =20 struct PCIMasterMap pmm[PPC4xx_PCI_NR_PMMS]; struct PCITargetMap ptm[PPC4xx_PCI_NR_PTMS]; - qemu_irq irq[4]; + qemu_irq irq[PCI_NUM_PINS]; =20 MemoryRegion container; MemoryRegion iomem; --=20 2.26.2