From patchwork Fri Jan 5 12:51:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 185386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6197524dyb; Fri, 5 Jan 2024 04:51:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKelIyX92VTz376ly1vurnLY6lAZzAlxpEvIJymKFp5PF1LKpRjMTyxkDaxtJ+T6+vtziI X-Received: by 2002:a17:90a:f28e:b0:28b:d5a9:8953 with SMTP id fs14-20020a17090af28e00b0028bd5a98953mr1680500pjb.77.1704459105826; Fri, 05 Jan 2024 04:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704459105; cv=none; d=google.com; s=arc-20160816; b=Ikn+3ZotpalBgE6SECUhqQawhheYNxoiLLTI3t/aR8hjW9hNtgboJPA9tqVxJJKM5P 3JpKyvGPDRExktcvEIb0mIWbUurmu8lHtRDUmBh0VmffwP05NGYppTB1Ilr3990Iaq1p NMfsy+V9Y8opOYNM1LCxA5k5oyUs8YtYe0BiVMTudvPI2z/NL6QXpaPkYvdP/8X64J5j r51B/mgrPSKHko5sOH2wdyeGzCx5X08j1JFeACdLvI6LfxxlPSvh25zP/HfI7DcktFu1 c/IkLEFtNMKg0zIGxCMHM5nuub1LPBFD6JxJayWxTCfGjZxyTu1ZMqn2uSYfySKDkTpj Al+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=m/zr3rD2ailCVKOSCjhx8Wj+/BfWmZOHPYBIIdrAvGI=; fh=cB5P4WhXQuedIZXOzVjTsjx8bHso60w3VlULXsl+XzY=; b=bDZBdwuZPgtb6Eq7iS7lj5Xj/W84VZsLHQwkW4v0BgpRp8+1XBi/NiSqEAj88T3CoA lVZPmSHFMxIPwZKCBkUWdnQERxJZHfbzT6W2kWSpsgVkWchKlnnXIAwuww0tmsmv80Nc aFrVv1ibXhTRC91upn1l9IGCW9hDMNvQqOmfc2elp8Zagqa9aC6oMYELkxDXVW/O6Sqc 7zKgoyRTwBULQfVnPW1+B5rE2t6y6SgM9y/zSZHAonHI1SBfASFIwmcQrxobjt7ggDZ+ LuLooWI+Op4HbvG5OnObObC2p3H622v0TaAs8D0wuA+uw42zanv738maLpDM/nAs/Tkq Dz+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E93C7Ybv; spf=pass (google.com: domain of linux-kernel+bounces-17841-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17841-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id l5-20020a17090add8500b0028bffeb354csi775823pjv.127.2024.01.05.04.51.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 04:51:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17841-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=E93C7Ybv; spf=pass (google.com: domain of linux-kernel+bounces-17841-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17841-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C9F7EB22C1F for ; Fri, 5 Jan 2024 12:51:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 484A72D61F; Fri, 5 Jan 2024 12:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="E93C7Ybv" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9C9BD2D602; Fri, 5 Jan 2024 12:51:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B481AC433C7; Fri, 5 Jan 2024 12:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1704459086; bh=Z1D8rD3/nRzA4kc+dux1HvFymw8yFf5r7zYbbSNB8vU=; h=From:To:Cc:Subject:Date:From; b=E93C7YbvTXPqnqBX8lLOXPOsswyYuuh3RpwOTs9I8ScFvWdSSpMKQy+yPx3dlx7V2 0VH7Kitbx14G+asiFGXW5jVQMp+m86pG1AYG3ntIH9t11hCxO/SGzXDQOn1etcriFo sX7K4y+oDhVgBExMg/OxR+rDCDB9c2t6j5u3ClQA= From: Greg Kroah-Hartman To: rafael.j.wysocki@intel.com Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , linux-acpi@vger.kernel.org Subject: [PATCH] PNP: make pnp_bus_type const Date: Fri, 5 Jan 2024 13:51:21 +0100 Message-ID: <2024010520-joyfully-cosigner-c2a9@gregkh> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lines: 40 X-Developer-Signature: v=1; a=openpgp-sha256; l=1348; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Z1D8rD3/nRzA4kc+dux1HvFymw8yFf5r7zYbbSNB8vU=; b=owGbwMvMwCRo6H6F97bub03G02pJDKnTf3voeGhLb/G84dB0Zcc8tYhlpa9mrbjotijt494+U xElvqSSjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIc0uGBZePK0Ub3b7cIRGc V5znF2jyY/mDdIY53GdaX0fHK7qwnhIXtCx+kZ3UsPUwAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787254911360327816 X-GMAIL-MSGID: 1787254911360327816 Now that the driver core can properly handle constant struct bus_type, move the pnp_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/pnp/driver.c | 2 +- include/linux/pnp.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 46c534f6b1c9..0a5d0d8befa8 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -256,7 +256,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = { .restore = pnp_bus_resume, }; -struct bus_type pnp_bus_type = { +const struct bus_type pnp_bus_type = { .name = "pnp", .match = pnp_bus_match, .probe = pnp_device_probe, diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 267fb8a4fb6e..ddbe7c3ca4ce 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -435,7 +435,7 @@ struct pnp_protocol { #define protocol_for_each_dev(protocol, dev) \ list_for_each_entry(dev, &(protocol)->devices, protocol_list) -extern struct bus_type pnp_bus_type; +extern const struct bus_type pnp_bus_type; #if defined(CONFIG_PNP)