From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NPkP0GCu" 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: devicetree@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