Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp24093lqz; Fri, 29 Mar 2024 07:29:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXA+woYuvCbRQmBDpnPg+ajDsc7Gad4xWazyzswH6MGIt//LniCZGpYjvWj4iHQ5/kObD/oHTv7m/Kb/8RwOV5w6N6aJKozk+kql6nLJw== X-Google-Smtp-Source: AGHT+IENDYs1c0ORiPRr61JfwSkv0HRVP2jsEyBwC0ftKLMnInlQp1q1br5SrGmSx34XvrE5MFwC X-Received: by 2002:a05:622a:593:b0:431:82dd:610c with SMTP id c19-20020a05622a059300b0043182dd610cmr2966836qtb.48.1711722551428; Fri, 29 Mar 2024 07:29:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711722551; cv=pass; d=google.com; s=arc-20160816; b=YEXCRcriG8Q1hkzv8f5hzTMT/S4HbuzP/QNJKtKMZ/tdAUp/fZH7AQKzA160oG0lh5 Sucournpp/jkxdUmlcRieDcQB8fnVA/5P/arhBMdP7PXJYyM3DPROKTQRJD6lKDCVRIh W+l+fqlJ9dDicqK33WiftJ8+eV4asgfYO2Gl5ruQruCjKtrw+T+a6VlkpD6l2ycuLJl9 0/4CHqjLuZQl6MfrC7TZnMpKk091gAjNCJkZ5LRfi5px7p/9yET1EwLnaIytERcbAc7A 3a84edBXwZfMkv6k0cjWeMNT6eaHfwL13e5uwpz5XC+kmsEf5b2UXGRsqwPKIR9A9He7 BQbw== 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=EVFYyYo7UYWimXOv9dZ7BuqtR0f8TUKz0DmjbLmtxFQ=; fh=XwbH2w0ekd22BROteqcRS+yY0aB48+RFJEbjCmPnD+8=; b=ueXOA87NvE5uXynqAoOGBAmco69QPXdQ593Ca7301MHNa8SFlHGXQA5e6O0Gfr+n6P kx6+92LRm8D1Vt8WCBv6mzYFIgvn0Zmbs1r72J34r9h6dTqldytMdLG+1KZVAg2ezX4U mHUut8ZZxBnLE2LA9fG0VZiDxeHGVpbRgyHugUdEmEm3l3eHDJdxKdMXPyd6sX8E3r75 OD610wX4AX05JRdo9jPyp1jqWavuZ0XWXNk3c+0pDH/Zt+aiTodlOAaB0EaYvQpDCFZM m9swTZaJ1UXljyqEiNHW3m9Rz50/kcZtfV9NwNwAGqntGAVIwLlFXr8PCMg99bXWzz5w WboQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CEbrRgXj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124929-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124929-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m11-20020a05622a118b00b00432b4a44413si3639246qtk.68.2024.03.29.07.29.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 07:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124929-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CEbrRgXj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-124929-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124929-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 16BCA1C27E17 for ; Fri, 29 Mar 2024 14:29:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2D8C1A4C1F; Fri, 29 Mar 2024 12:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CEbrRgXj" 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 CEF811A4C0E; Fri, 29 Mar 2024 12:47:24 +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=1711716444; cv=none; b=G7890A57K5oJLjD1wwXpigFd9wGLAZIob2F4qGlOwD+GNW2fWedTdrDjPdWNNsZVIvwPw9nM5xSkiqq8rxbIHfI77gxJAGO6XYJB7bBWjmeNKJ6VN0YhbMBP02LtnrAHet9KIHQD23x/JvqqFGjUU44KQFj2+sZIj59OP6dg20Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711716444; c=relaxed/simple; bh=zZ9Pp+gF5Nd2ff9Hb0BYwi0APXWGdw1wvGYH0OFOOH8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a+SsPgXI0ITG97p7nbi4Yc8hAQPPwVepQPHXPBIMaiFcVbKw67tmIKaGZauXdXkBaToeIAKjEB8SZc49fxc4ZimCwvAR2A/JY2sfcurVmqwu/Dth7nmKlWXoDhOTY/6PVqiSUgAz+LM0wVORUOxCrPjh2YEgIrlsFONollUGmDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CEbrRgXj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93D8DC43394; Fri, 29 Mar 2024 12:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711716444; bh=zZ9Pp+gF5Nd2ff9Hb0BYwi0APXWGdw1wvGYH0OFOOH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CEbrRgXj73lv4wxzJHu1hAqktHjSfioIA08JwDhnpjm6RfVK0kfLfBjRg00cJYXfU 6cPdljFYhCAkdDGLNtjSyCGBG3AadmRzx7GKLLHAOB6FkciDZkQJz7TYDVs4zWzDxu 0i4bvhjliRkjhzjKRB3bVul3O9mWDd4scYAIg6nlpiJW6FJ7Wj60RTxRO4ufyk3nib IxItB7NhTTVUDSmH376kZnHdwZmwgBHzYI+K3hcvVZX0D23gqo9mG5o/0DDi4lETaF m5ljgIuyya4JCtKf7kyiOZRpqHZ1YFjBj5Y1jbVuUNzRGUzfnKGJE8Fjwo8P9PanGc v+qL1R1rszgqA== 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.1 45/52] Input: make input_class constant Date: Fri, 29 Mar 2024 08:45:39 -0400 Message-ID: <20240329124605.3091273-45-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240329124605.3091273-1-sashal@kernel.org> References: <20240329124605.3091273-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.1.83 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 8b6a922f84702..067a9b1d5befc 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1918,7 +1918,7 @@ static char *input_devnode(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 49790c1bd2c43..fa656f30081f6 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