From patchwork Fri Jan 19 13:20:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Abbott X-Patchwork-Id: 189562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1005001dyb; Fri, 19 Jan 2024 05:28:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFElhZTkL8jWhw8yRDrKgSA6RHnITKh4CFERDof7vx8pRH8q+Y3OXqUciIeq+EhfQjzUNXA X-Received: by 2002:a05:6512:3a91:b0:50e:df4f:44d7 with SMTP id q17-20020a0565123a9100b0050edf4f44d7mr751078lfu.90.1705670914639; Fri, 19 Jan 2024 05:28:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705670914; cv=pass; d=google.com; s=arc-20160816; b=n3t9ee2Q25pMiZaNdHq4fvamC9YA1tReZfpbzVFLvDhV5v/4O7REYIIt+IdhnsTm/x WMqHEX4pRJIumQfVySeMnAvXNzSuYr8CdWuZYy5wf3jwc89WhZW+a9gnX8TNRVIKzMLJ OvMflUPtOmyxoxbFqLysi1FAgAFBvzquo/nNSKb/eyxu7O/kayuX/X+QxPnNKIui6kI5 LGv3TKjMlPtBaGrFwqAcCI7XdSakeT83RVGyAhK7xESBMtP4JOEOK2lcUFXQJaRF1fKJ +fPquR/UCrKDb7F/z1HA5Fz8/vADF3+DLogO0A7o44LBFQWP3vHcBNppvD8shAofyECg EQug== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=M42PiZy84LxCMMcMzt40YeAyyhunmUXO7bAwJkoNrog=; fh=gxc/HTt8I7H60+yTTJJXyc6QfLirZXdzvVWlSfI2Rz0=; b=Vm8/k+C8PxUM3HMARpQtTg9rNTntwKi4hNrv6tDAjsgZVxyFMc+GmYtMynwEnu9V6F QQsHa7G99+kkPTx1XkQTVJiQtY0sPTPcK/k4v1VriHP7hpbCU46tvR17I+McJzXPzPlU tA1JbOzAGc1ubVxVr87U6PRHmPzKamThVVPJgvOLbxcsdyyt7Pru9oIgLSBxxyXrwBCh uiTJODBCjwSDS8KFlEW4jh0jZWUMIAXMa7eZbo3ZkG6SjmUwFemTgd3ezDxzvBH29fzA JoNUWKT6kg9ZUbgktPmsx4/RtSaKpj3XcP/xZV5kRroeKm8+VhOZDAon92PkhCJrrujX 6iMA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mev.co.uk header.s=20221208-6x11dpa4 header.b=ch5Y9qgp; arc=pass (i=1 spf=pass spfdomain=mev.co.uk dkim=pass dkdomain=mev.co.uk dmarc=pass fromdomain=mev.co.uk); spf=pass (google.com: domain of linux-kernel+bounces-31200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31200-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mev.co.uk Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j19-20020aa7c0d3000000b005577786e606si7915267edp.374.2024.01.19.05.28.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 05:28:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mev.co.uk header.s=20221208-6x11dpa4 header.b=ch5Y9qgp; arc=pass (i=1 spf=pass spfdomain=mev.co.uk dkim=pass dkdomain=mev.co.uk dmarc=pass fromdomain=mev.co.uk); spf=pass (google.com: domain of linux-kernel+bounces-31200-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31200-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mev.co.uk 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 41FBB1F20CDB for ; Fri, 19 Jan 2024 13:28:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 762B253E03; Fri, 19 Jan 2024 13:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="ch5Y9qgp" 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 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 X-Classification-ID: 5ab2b5c7-4f68-4b27-8b47-1878e9f7d96c-2-1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788525581084689242 X-GMAIL-MSGID: 1788525585305246774 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 = 0 ; minor < max_ccb; minor++) { struct device *dev; dev = 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"); From patchwork Fri Jan 19 13:20:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Abbott X-Patchwork-Id: 189569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1021157dyb; Fri, 19 Jan 2024 05:57:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyPHdQwN8S1Wlkn0gboac89OU2CGBYdE5Et63J7+JBm0eaYVKo2ogwbDbV5kdvzuGUOJy6 X-Received: by 2002:ac2:457b:0:b0:50e:80dc:b118 with SMTP id k27-20020ac2457b000000b0050e80dcb118mr289976lfm.62.1705672632034; Fri, 19 Jan 2024 05:57:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705672632; cv=pass; d=google.com; s=arc-20160816; b=TxWuTsoJsIX79U4miXcW4mrDSWySLwqmPrM8oaP5mamjtuYDBP89uSfPftH/ElqwrF iZSVXSnDzLW3EWAZDExoeOAlFkpDIoK6B+2my+wtPHiREaymnxWlwUB3TCKZUH5H9j0H AvgftRn0b28h703bD1QTPvg3X23Ng38xBx5LDgNWHqf87vZanapmb6HlCEM7KMFkU10k 6ux+dBPhHicU9n0Iff5fwf9mWckRNtAJ/v84jjyCAd/KoOhknwB+2EE9v3/jI0nVLjAa gdpVPbGPi/3k2Cr6DcPH9alIdeGbTCFyRP2WioWKjKAY54xuVk6z8pBIYurQU58Wn5h8 iUwA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+5sEmqJRfvcq1ySo6Whh0Mtndny3X+4rZCyHAS1Le2U=; fh=gxc/HTt8I7H60+yTTJJXyc6QfLirZXdzvVWlSfI2Rz0=; b=aBbmSokqgYCZhQdMXXOglvOpHOPmrZYjSPj7ZsdEJCu9bPMW0perL+89rbsh/wMzX/ 4NSBMt8FT08j8SbbRNU5aOf+kWoPbfubgA2qHuWu0iaEEqn2YFjZv5vcfgR8S4I9wp00 NCxlhjlHIv9cqwRQNcTViQ+kCuyosckT1HvSDVmDYTJ+aQFDvwMtZCPoyJgSuprCV91e rqWAJwTzKWGx/LAvXOOI5zOIE0aiHhCXloFbkjYnnLgwOII29VCU/m0ZLg/oVYmhdXw8 x8/txwwSEjGIzsxsn/4h9GugWyhFRXnY7WWzgFr3LDQ7E0VABNUD3EgeUlOYPv0u2M4B 6wQg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mev.co.uk header.s=20221208-6x11dpa4 header.b=pBnoJggm; arc=pass (i=1 spf=pass spfdomain=mev.co.uk dkim=pass dkdomain=mev.co.uk dmarc=pass fromdomain=mev.co.uk); spf=pass (google.com: domain of linux-kernel+bounces-31230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31230-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mev.co.uk Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bv22-20020a170906b1d600b00a23499b189fsi8040360ejb.913.2024.01.19.05.57.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 05:57:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mev.co.uk header.s=20221208-6x11dpa4 header.b=pBnoJggm; arc=pass (i=1 spf=pass spfdomain=mev.co.uk dkim=pass dkdomain=mev.co.uk dmarc=pass fromdomain=mev.co.uk); spf=pass (google.com: domain of linux-kernel+bounces-31230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31230-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mev.co.uk 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 9FF6B1F21C04 for ; Fri, 19 Jan 2024 13:57:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8D3B53809; Fri, 19 Jan 2024 13:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="pBnoJggm" 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 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 X-Classification-ID: 5ab2b5c7-4f68-4b27-8b47-1878e9f7d96c-3-1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788527386075147220 X-GMAIL-MSGID: 1788527386075147220 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 = 0; + int devnum, slot, start, error = 0; struct ilo_hwinfo *ilo_hw; if (pci_match_id(ilo_blacklist, pdev)) { @@ -839,11 +839,11 @@ static int ilo_probe(struct pci_dev *pdev, goto remove_isr; } - for (minor = 0 ; minor < max_ccb; minor++) { + for (slot = 0; slot < max_ccb; slot++) { struct device *dev; dev = 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"); }