From nobody Fri Dec 19 04:33:45 2025 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=1677507497; cv=none; d=zohomail.com; s=zohoarc; b=abY2fgO7Rky5NzZaswoTlHewPPd8gcoboSrkdnSm+7loAVW6TflZYw2vOvniTADhcoeej2EQgu51OW/eBAO4WEOtZUNM8JTzS+hhbyoaKC6JWpcgD3ZY85ipvqkVvwENARlLbGaDntNIbTpDYIVXbyBrxc7tUFWdWkJdjK7ArSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677507497; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/KzSvjX9f4BCGIMkUG2tIfmdibE7Hacb/lDW3ntcm+Y=; b=jIP093dfrOc5PYVmpvsBhPabDzqKw4z5HB+I2OkKFCr86bHHZCHk1kIfZzK8O0FjoNE6nQvDx3Z/h+Eyk/SLBz4Sl+IRAbm9J9+/Kx/dny6FF8TQHtEKz6CDqvye3G6BIAeTgMBbt0OtGujiHuPT+UUgY7vmI5C4CLoqsCgeJ6Y= 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 1677507497077617.8442016116844; Mon, 27 Feb 2023 06:18:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWe5A-0002Ia-7I; Mon, 27 Feb 2023 09:02:24 -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 1pWe4E-0000gd-VW for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:01:33 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWe4C-0007Yy-SI for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:01:26 -0500 Received: by mail-wr1-x42d.google.com with SMTP id bw19so6296146wrb.13 for ; Mon, 27 Feb 2023 06:01:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id s9-20020a5d4249000000b002c5598c14acsm7158514wrr.6.2023.02.27.06.01.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 06:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/KzSvjX9f4BCGIMkUG2tIfmdibE7Hacb/lDW3ntcm+Y=; b=wYdBEPwFeJ9dtloednwvpgqd2a3dmH9iCt2y2zuh/1aqxEKhEstoy318C8gaXaH6JO uQnSouejSOIllwnHROaREn1E38v61OQhqzXbgUtS+1l1r4cYxiD1wb+LlpHBdPK5X3Ck 3hB4ric1YZ0PT/PjRIk2PyjxRpUBRP+/jV1tJs+Piag/6hWMx2qjql6lCYFbF3sRgdaR XOcSeckxm4Ah6hm0QLaJC1OmZmH6qq3NkY1cEuEr0DEfMcleBCNPjcxAVt1BVtXWq+yZ C3bmm2n+2a2gOWN6yKCEmfziZfojKKkYdi5YAZdswYvF2qZGc9GsejfHXfIQGM+WNjpT sEuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/KzSvjX9f4BCGIMkUG2tIfmdibE7Hacb/lDW3ntcm+Y=; b=Q0paCAMjDxM+NtdnuvKCRsk5y42plomSeThsgw89cDSa7zKrR7+Naq9EghBPXh0aPz 8cSSTJDgORrTODJREs+3dNOgoku+zCuyuVcOVH2ccSxHE3hNb+2XX3e9jTuh2Xf+Huhi 9J+twpfIDP7NOIZ1ZCqbfDyDw4RVEXUSKpVaxMqs31vb26FesXNiz4miVjMxUnNxFQR+ 6xfuvDwEmC+a9RmiNTCwHjZxv4byuYp2qnL07vyqgNUjWJdXptID/LB4WrrlIbXjEArL upJPUOKIsUIWoa3HQ1stELRroBsLz6teDV5wUfB1IaKruSARS22DTS9DTBmnyymIAJbP FZeQ== X-Gm-Message-State: AO0yUKW3cqokAG9g6itn0QhQP4MB8WvebvFg0nV88FJI0SOBonXw2fEA JnU0qLUOYWB6oz3+chW/uyVf+C7rmI7YyAoX X-Google-Smtp-Source: AK7set80suw588oUiYmCIOsVeU+o4gBOPnvqAB+HhipYkzcFcAKCt+Kb9srii+VG3r3J5taO+aj/yQ== X-Received: by 2002:adf:f34f:0:b0:2c7:fcc:2501 with SMTP id e15-20020adff34f000000b002c70fcc2501mr12136896wrp.28.1677506483327; Mon, 27 Feb 2023 06:01:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/25] hw/gpio/max7310: Simplify max7310_realize() Date: Mon, 27 Feb 2023 14:00:50 +0000 Message-Id: <20230227140102.3712344-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227140102.3712344-1-peter.maydell@linaro.org> References: <20230227140102.3712344-1-peter.maydell@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::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677507498249100004 From: Philippe Mathieu-Daud=C3=A9 Since &I2C_SLAVE(dev)->qdev =3D=3D dev, no need to go back and forth with QOM type casting. Directly use 'dev'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20230220115114.25237-2-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/gpio/max7310.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index db6b5e3d764..031482d9398 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -183,11 +183,10 @@ static void max7310_gpio_set(void *opaque, int line, = int level) * but also accepts sequences that are not SMBus so return an I2C device. = */ static void max7310_realize(DeviceState *dev, Error **errp) { - I2CSlave *i2c =3D I2C_SLAVE(dev); MAX7310State *s =3D MAX7310(dev); =20 - qdev_init_gpio_in(&i2c->qdev, max7310_gpio_set, 8); - qdev_init_gpio_out(&i2c->qdev, s->handler, 8); + qdev_init_gpio_in(dev, max7310_gpio_set, ARRAY_SIZE(s->handler)); + qdev_init_gpio_out(dev, s->handler, ARRAY_SIZE(s->handler)); } =20 static void max7310_class_init(ObjectClass *klass, void *data) --=20 2.34.1