Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1135132lqm; Thu, 2 May 2024 06:24:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJKJg4/N3l014p8Dc5hbKXUauLoXZnmifAS6uSGT/g2sF1SC9cEdaLaPk9ppV6vDWDcYGNht8Q/tSEfgujhMDz5KFrpWaLfcYUjczwDQ== X-Google-Smtp-Source: AGHT+IGapP5GODSM+0yap0Te64fr1g0PTCogRWUvzm7CvFvo8/BtrlwRY1C1n56C30AsdRjSzocp X-Received: by 2002:a05:620a:a04:b0:78a:6a01:d8d with SMTP id i4-20020a05620a0a0400b0078a6a010d8dmr5810505qka.65.1714656268041; Thu, 02 May 2024 06:24:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714656268; cv=pass; d=google.com; s=arc-20160816; b=XuuDCIhkrqVXCVW5E7mLqHMwMvtLzBTR5Ru0KecLPgPtk9ku6KaevB3UvsiHFl71jl hXcGK6kDvmyo0FTyOWVG5SDbqR7iZjsBNqO5RcihJ8Sud5Cd2aroF654iokLVkHPzhWf VYpRdYjtM7gqqoZ8C9dz12bAGumLlWd0g8BqIMWAHJaV0AffwaX59bXbs9iZ3/qF8cAS LU6k5KgUqHw+pj4188Q0sS1H/wFLkW94HGKryGv/OuI3v3MtRu58YuRhevlpNxaJvRC7 GLrvArwtXkc1wMBzbri+ybw60n5B+wRyP/4m8JL39H4yTLGT+goSHBfE1/bp3G1WrPud j9fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=CpTPdiBa1OIGqNkEL6fPrCzTcfq7rb6C3wl4aQp+dcE=; fh=JL/t8p/unZ90aFNqUYiNsASVpf9VSeeM+GYSA0n45Po=; b=W2GTz6vMFrSKri5IeQEphVrJer6m0MY82EfkWAmaBNw5EmpoeA5mz+WHzCYuZL893W BfUu8o6J+Ix2XulCTCtmWpmG7fk9J7nsl/zOTQU35SHeE2q0qDpm1erIuxVNWoUwdHI9 ok4U8Ymwug00DfW0F/RhJY9IcaqWOfFbs/fH3NBIuLZaWTKAZVKTI1QjZ1/2X63EPIgO GVtPf+k6UBtKkzUf9y6RkHOEf/EBDvs0RpKjF7QAUuluArjSkdvW4CisviRlfqQt0f4R nsHu8Mh+6XmwWnehDkJ4ScTTYcG9HKhMHft0aEQ6qXkqExHgXejVFi7sM/hoBv6Rt23A Lcxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NPkP0GCu; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-166504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id oq16-20020a05620a611000b00790fcc70909si878518qkn.153.2024.05.02.06.24.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 06:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=NPkP0GCu; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-166504-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166504-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id ADBCE1C21101 for ; Thu, 2 May 2024 13:24:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AC3584FB9; Thu, 2 May 2024 13:24:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NPkP0GCu" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4216556B8B; Thu, 2 May 2024 13:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714656257; cv=none; b=iq+5DlvLWwCMi9Rt0rIDDixf0CTApVQeYjiKpiGH6cEymkXFtqh/nGE3xoqDcOEDtgLzyUVb19/solNrsRiSmozNUvyTMoIyXBSfvV4nHfMQiccNfKPt5Z746ZU8pd6/6e1/QJ3t9KeoOff99NJ+e2LoCmqvUnxRQ9PWHBKw1ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714656257; c=relaxed/simple; bh=+xxCO+Xf/1cD5/co4TyZWT75lYmYABg2lLKlawfo68E=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XX1AynHGAKSeiN2CJXwLtEUlR8FQbZUnobqFuvBQCMgU5c8OVmCWnKAbWop9EB99n7gt6rSvHJrvxJ1ERJNym807wtKpNB76pLFPk3aNDPiGy8Z6lxEnLRe/pBlhpgT41nV9xQymoTrr0P6hrfH6YU6V6uXNbascQN3xvY+Gymw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=NPkP0GCu; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 75EF9FF808; Thu, 2 May 2024 13:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714656252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CpTPdiBa1OIGqNkEL6fPrCzTcfq7rb6C3wl4aQp+dcE=; b=NPkP0GCumBTB70ynwkVX+XDO1XNVFTfvKLUT+5OWkYYJaNp8AJ76z1vAsGpmJg0N4r3Tk+ FQIxTPvPtsQ8tOlwx+qCvG5y1/4xi9k1myhBDuV5idzjf/12FH8pjfab79m6uA31VSRdWn WPf3VGoVsxqvZNHqQ+FWJs+AVyZYGPBRey4ipNJMXXZpuSZXQbC833xBbFigo2Ajok9sjM xxMNlmIAGc4X7SLAa8VmBs/B+Z4UQ2z6DJvwMiZt8BXY0BKRpgjTubPlHXbGzr57cy96d6 RnDbMHO/5by3VKF5YESRk+lRHpsYhPqTRVzNc+9M+9TohLszr/A2mK0q4K63LQ== Date: Thu, 2 May 2024 15:24:09 +0200 From: Herve Codina To: Simon Horman Cc: Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lee Jones , Arnd Bergmann , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , Alexandre Belloni , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Luca Ceresoli , Thomas Petazzoni Subject: Re: [PATCH 12/17] irqchip: Add support for LAN966x OIC Message-ID: <20240502152409.70a85339@bootlin.com> In-Reply-To: <20240430202451.GF2575892@kernel.org> References: <20240430083730.134918-1-herve.codina@bootlin.com> <20240430083730.134918-13-herve.codina@bootlin.com> <20240430202451.GF2575892@kernel.org> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Hi Simon, On Tue, 30 Apr 2024 21:24:51 +0100 Simon Horman wrote: > On Tue, Apr 30, 2024 at 10:37:21AM +0200, Herve Codina wrote: > > The Microchip LAN966x outband interrupt controller (OIC) maps the > > internal interrupt sources of the LAN966x device to an external > > interrupt. > > When the LAN966x device is used as a PCI device, the external interrupt > > is routed to the PCI interrupt. > > > > Signed-off-by: Herve Codina > > Hi Herve, > > > +static int lan966x_oic_probe(struct platform_device *pdev) > > +{ > > + struct device_node *node = pdev->dev.of_node; > > + struct lan966x_oic_data *lan966x_oic; > > + struct device *dev = &pdev->dev; > > + struct irq_chip_generic *gc; > > + int ret; > > + int i; > > + > > + lan966x_oic = devm_kmalloc(dev, sizeof(*lan966x_oic), GFP_KERNEL); > > + if (!lan966x_oic) > > + return -ENOMEM; > > + > > + lan966x_oic->regs = devm_platform_ioremap_resource(pdev, 0); > > + if (IS_ERR(lan966x_oic->regs)) > > + return dev_err_probe(dev, PTR_ERR(lan966x_oic->regs), > > + "failed to map resource\n"); > > + > > + lan966x_oic->domain = irq_domain_alloc_linear(of_node_to_fwnode(node), > > + LAN966X_OIC_NR_IRQ, > > + &irq_generic_chip_ops, NULL); > > nit: Please consider limiting lines to 80 columns wide in Networking code. This will be done in the next iteration. > > > + if (!lan966x_oic->domain) { > > + dev_err(dev, "failed to create an IRQ domain\n"); > > + return -EINVAL; > > + } > > + > > + lan966x_oic->irq = platform_get_irq(pdev, 0); > > + if (lan966x_oic->irq < 0) { > > + dev_err_probe(dev, lan966x_oic->irq, "failed to get the IRQ\n"); > > + goto err_domain_free; > > Hi, > > This will result in the function returning ret. > However, ret is uninitialised here. > > Flagged by W=1 builds with clang-18, and Smatch. Indeed, this fill be fixed in the next iteration. Best regards, Hervé -- Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com