From nobody Thu Dec 25 11:17:13 2025 Received: from smtp118.iad3a.emailsrvr.com (smtp118.iad3a.emailsrvr.com [173.203.187.118]) (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 C589D52F7C for ; Fri, 19 Jan 2024 13:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.203.187.118 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670816; cv=none; b=JhmbCjUbuH1CEnm7IoJx1IGmOOuVTTB3Z/KRZPvD22mP3nPAZcyYCADONTLCj+CBbpi3GvDKsNU50WzYzG27ylPwM2yF5wQtA4C8ktYNqgFGUcUTq/u1ngCYbE7catZjQ9848ghb1vEvZI/3gqm18Wb2s5LA8vCqfNxr/stKo8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705670816; c=relaxed/simple; bh=hms2Pc59mwmGOO0shb+ByW7baurBdVjmSsISiE/x0vI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QO4ybf3+LuZeuMsRuEg15tokyJBugyFF02+9UiUdh5hQ+mCkAntnN5+RRdYMc7AokByrHMOxxLCkEuLOitw3XaJbKbfIcsnaJSx1S8cJ1Hf6gV/0YhiEN7MeL7xzgKEZAVvhpnvpkkrn/IwPcJXkBNq0ptlr7U3bjuW8TuO7Lqk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk; spf=pass smtp.mailfrom=mev.co.uk; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b=ch5Y9qgp; arc=none smtp.client-ip=173.203.187.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="ch5Y9qgp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1705670448; bh=hms2Pc59mwmGOO0shb+ByW7baurBdVjmSsISiE/x0vI=; h=From:To:Subject:Date:From; b=ch5Y9qgpTdsd7hELH4GDukJUUDun5PtvAJiwu1ql5+eIW+ggdJPn0c24qc3AAn+Yi Mu8xlEs56hrC94c+7vIRuHgWLQAr5oWc3qLm0wSEAtEJ0VZMe/Km0nAwjBESptYceW So6Fn7BvQuC3T46ZSGP8ZHUuCGEvK5csUbJFQ0yw= X-Auth-ID: abbotti@mev.co.uk Received: by smtp23.relay.iad3a.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id C261D24F6F; Fri, 19 Jan 2024 08:20:47 -0500 (EST) From: Ian Abbott To: Matt Hsiao Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Ian Abbott Subject: [PATCH 1/2] misc: hpilo: fix inconsistent device numbers Date: Fri, 19 Jan 2024 13:20:17 +0000 Message-ID: <20240119132032.106053-2-abbotti@mev.co.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240119132032.106053-1-abbotti@mev.co.uk> References: <20240119132032.106053-1-abbotti@mev.co.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Classification-ID: 5ab2b5c7-4f68-4b27-8b47-1878e9f7d96c-2-1 Content-Type: text/plain; charset="utf-8" Each iLO device is allocated `max_ccb` minor device numbers (one for each channel). When `ilo_probe()` calls `device_create()` in a loop, the minor device numbers passed to `device_create()` start at 0. For consistency with the call to `cdev_add()`, and for consistency with the calls to `device_destroy()` from `ilo_remove()`, the minor device numbers passed to `device_create()` should start at the value in the variable `start`. Fix it. This is a logical bug rather than an actual bug, because the number of supported devices is `MAX_ILO_DEV` which is defined as `1`. Fixes: 89bcb05d9bbf ("HP iLO driver") Signed-off-by: Ian Abbott --- drivers/misc/hpilo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index f1b74d3f8958..3428a0bd5550 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -842,7 +842,7 @@ static int ilo_probe(struct pci_dev *pdev, for (minor =3D 0 ; minor < max_ccb; minor++) { struct device *dev; dev =3D device_create(&ilo_class, &pdev->dev, - MKDEV(ilo_major, minor), NULL, + MKDEV(ilo_major, start + minor), NULL, "hpilo!d%dccb%d", devnum, minor); if (IS_ERR(dev)) dev_err(&pdev->dev, "Could not create files\n"); --=20 2.43.0 From nobody Thu Dec 25 11:17:13 2025 Received: from smtp119.iad3a.emailsrvr.com (smtp119.iad3a.emailsrvr.com [173.203.187.119]) (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 CA347524D8 for ; Fri, 19 Jan 2024 13:56:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.203.187.119 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705672616; cv=none; b=e9kUyTCSKKtEmT4+TddSXm2io0OHZcuJLGrW1D7pEgR8YVPdlS7gjSXICURA8LQAF6g4O3kkeG7W0zJxLwNbd6IF4b6HAHuGt9K4wsSFq/fblc9eimWIZic7swtK2ByE0GpX0Xv/XhMUM2EK0GG9QhrIeJFnlm5Cd7PbXcpEs5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705672616; c=relaxed/simple; bh=nS+r7MaskCPsuXGcVmc2lQaLyPRahw2eN/Qec5iMmx0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q4Zfq1BsUw/ijpIhrPByGYkCrnq/L4x9xiRdgxfUVRjaGQGiltlieGAIf821WSgqSmxSnhEZlT6fhRifMEhzXvec/p0Z4iIpW1zQWUYDRnUWVQ919hop3AyBAQo4UND54nxRA8lGSzDXpZBiuSyoq8mjWhqDm6yKNZdwIPNGM1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk; spf=pass smtp.mailfrom=mev.co.uk; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b=pBnoJggm; arc=none smtp.client-ip=173.203.187.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="pBnoJggm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1705670449; bh=nS+r7MaskCPsuXGcVmc2lQaLyPRahw2eN/Qec5iMmx0=; h=From:To:Subject:Date:From; b=pBnoJggmF7hEiOIjzQeyYvaxGz3p0EqaNbhOkhmR1LSX9p/vYFE5u1lKvh88F1D+0 puat1ryTvHenIFNjXmNq2baAJAOGWHjYM4bi1Prm2Rg1EAGnu/quYQyI5NrMQtw2Fl +a6CPdD0O/sdRLM8YsKBMHHDYz/Jsl7PLejIDdzs= X-Auth-ID: abbotti@mev.co.uk Received: by smtp23.relay.iad3a.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id DBD4E24FCE; Fri, 19 Jan 2024 08:20:48 -0500 (EST) From: Ian Abbott To: Matt Hsiao Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Ian Abbott Subject: [PATCH 2/2] misc: hpilo: rename device creation loop variable Date: Fri, 19 Jan 2024 13:20:18 +0000 Message-ID: <20240119132032.106053-3-abbotti@mev.co.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240119132032.106053-1-abbotti@mev.co.uk> References: <20240119132032.106053-1-abbotti@mev.co.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Classification-ID: 5ab2b5c7-4f68-4b27-8b47-1878e9f7d96c-3-1 Content-Type: text/plain; charset="utf-8" In `ilo_probe()`, the loop variable `minor` isn't really the minor device number, it's the channel or slot number. Rename it to `slot` for consistency. Signed-off-by: Ian Abbott --- drivers/misc/hpilo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index 3428a0bd5550..04bd34c8c506 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -770,7 +770,7 @@ static void ilo_remove(struct pci_dev *pdev) static int ilo_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { - int devnum, minor, start, error =3D 0; + int devnum, slot, start, error =3D 0; struct ilo_hwinfo *ilo_hw; =20 if (pci_match_id(ilo_blacklist, pdev)) { @@ -839,11 +839,11 @@ static int ilo_probe(struct pci_dev *pdev, goto remove_isr; } =20 - for (minor =3D 0 ; minor < max_ccb; minor++) { + for (slot =3D 0; slot < max_ccb; slot++) { struct device *dev; dev =3D device_create(&ilo_class, &pdev->dev, - MKDEV(ilo_major, start + minor), NULL, - "hpilo!d%dccb%d", devnum, minor); + MKDEV(ilo_major, start + slot), NULL, + "hpilo!d%dccb%d", devnum, slot); if (IS_ERR(dev)) dev_err(&pdev->dev, "Could not create files\n"); } --=20 2.43.0