Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2768lqz; Fri, 29 Mar 2024 06:56:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzex2OKimX/pQZpQVIn6X3N1lH8wwDvYb0US9Ak06yKxxkRpqQ+mjkrIaGxrEuCfPArT7Lq04oryxraD3vsO8fOEKBBG8tUZ19vGL8oA== X-Google-Smtp-Source: AGHT+IGD6jwKv2cZb2D4sd2yQC5XPi/AGI4j0r6SX3cDR4fDGHPlX3jGTltgk5W7WkDx6D6lYSp9 X-Received: by 2002:a05:6e02:174b:b0:368:7e1e:7e00 with SMTP id y11-20020a056e02174b00b003687e1e7e00mr2587204ill.7.1711720613147; Fri, 29 Mar 2024 06:56:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711720613; cv=pass; d=google.com; s=arc-20160816; b=etmWJyCsvD0i5TPmA6ys6GTDzstf0GRfp9bVkcRydRboMgZP9nwOCdia2QQpwaUtqo ABr36CIG1M7k7c9yezQ7fPCQljYFxrj/UpcNWXgsv4rd89RhGM3yy1rKId+ZujC35nD0 uC4qBRncO6P1MaDkOme7rKBg9mXsSLDZSuRq7gpUEr38xsvO+CSViFsczSWXUqW6p8Pm oqZP/0rBQwc8LXxiiK83ZvN9S7qwwW//di96yxMyZocyFXElL1kWdJpfDk8GjTEbfV8V HfZWn3jpA1MtJhp6sMCHJKOzt9siI2bFw8bahtuBwAurwaDgMP6/7+byh6BsRj2DEwNH GoRQ== 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=O/HqOB0Vhq19oFktPaPitwPjF5v204tA8S4NgsKzwYI=; fh=XwbH2w0ekd22BROteqcRS+yY0aB48+RFJEbjCmPnD+8=; b=ugw0GzmCZ0R9L9X3cFFRDt8umfbq8RCReQTKES1dtDSSWJ1fhi9mvgH/0bQhPVEEq8 RMoPZVFCTkVvJWRoVBdZvjnfxcqjatdahqwU9qPhhKHOvCSPzSVpK3ApaOmvE+Cb7Rb7 JoTPJ6/MsYYtV1edMi1OLoF6XA6NlLqJ3tvyQjUwh2HYmjAoS38mhoCb+kLkViO3rhv+ 5JlycjEm9j+KXPpV+m9cLW1srpVV1tbBG251m5D0cTgCw36b8EoskUH5+29blo1nGPAs i51ubHm/bq6tpVj21cgRn5zFfSfh7C+J23zHrCaNHEugJcpLgcXZ7XoAkClV1YzhiSjr 4y5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z64K7x2O; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124797-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t25-20020a656099000000b005d760d1af1csi3660947pgu.460.2024.03.29.06.56.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 06:56:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124797-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z64K7x2O; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124797-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 278AF281795 for ; Fri, 29 Mar 2024 13:54:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DCF418C9EC; Fri, 29 Mar 2024 12:42:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z64K7x2O" 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 9CE4018C9D3; Fri, 29 Mar 2024 12:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716153; cv=none; b=oJUNMBVSu9YCUrARVCPM/IBc+YEREi4ib2huHgW4WdblqCrL/MmcSHPdFNUXu7h0lPm5WQdlc1u30dCoDCrY9mkpBBqimUnjYthJsbUyWM+BZulRlbiLKOcq8YTX3VwsXk+uOVUqObJIsqI+TvjbFk/lQjpfmYkntpXB7V6bN3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716153; c=relaxed/simple; bh=lrT3/5EW+go1p7C3oYph3/zyeXMsbRRexmI7l1NDZFY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jtiVE5Sh8nX25Ykz3Pfv1jYuZIL8hrXVPUuqIJOBulZVaJsJhB69ZJlTh7XS6Gf1rBDwuMVoujktgywNSs6izCL3uKMybUABTfM4JecFw7FVFgrbIKPVQJwFk6TXD5jqyCicvQ1adckukdCYOs/VvD/0yIqDJz4DYB9mcyloJok= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z64K7x2O; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A865EC433F1; Fri, 29 Mar 2024 12:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716153; bh=lrT3/5EW+go1p7C3oYph3/zyeXMsbRRexmI7l1NDZFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z64K7x2ONNZiqkZ8udOzMSzuDuF4ggnVcDbFomYN47ToWU1SU/H8y7tXj2JjOCkRw hwDb+on01sRfHZqTozNgrz1of0l9bfnB2w91bBcTHnMHpahSxWBLdDfhvW2wlxdM3G pZAED0OGHlmnepOE1Y1uB8TvMRIaBbmrnKD/0XDj1w0tgMDb0RXP5ta6wPwcjCSU1K x0dYQRLDZyumdyOyzKfDfENZZHsNSfwxZULxFbiQ9eHlYn6Bc6ELbp5HYgPof8L45z 5Gr0Stb3+s/k1YoRIO7nVWNbQWpjS7IOJUD0bbXjdXsFsYh7hcRrHZBl2BmdKT5vqo MxYHH0E9aR/nA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Ricardo B. Marliere" , Greg Kroah-Hartman , Dmitry Torokhov , Sasha Levin , linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 6.8 86/98] Input: make input_class constant Date: Fri, 29 Mar 2024 08:37:57 -0400 Message-ID: <20240329123919.3087149-86-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329123919.3087149-1-sashal@kernel.org> References: <20240329123919.3087149-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.2 Content-Transfer-Encoding: 8bit From: "Ricardo B. Marliere" [ Upstream commit a4735d40a5da96a637af6e5bf9f6ec8b9d996acd ] Since commit 43a7206b0963 ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the input_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Link: https://lore.kernel.org/r/20240305-class_cleanup-input-v1-1-0c3d950c25db@marliere.net Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/input.c | 2 +- include/linux/input.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index f71ea4fb173fd..c3fa43514dc6f 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1918,7 +1918,7 @@ static char *input_devnode(const struct device *dev, umode_t *mode) return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev)); } -struct class input_class = { +const struct class input_class = { .name = "input", .devnode = input_devnode, }; diff --git a/include/linux/input.h b/include/linux/input.h index de6503c0edb8e..c22ac465254ba 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -514,7 +514,7 @@ void input_enable_softrepeat(struct input_dev *dev, int delay, int period); bool input_device_enabled(struct input_dev *dev); -extern struct class input_class; +extern const struct class input_class; /** * struct ff_device - force-feedback part of an input device -- 2.43.0