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");