Message ID | 20240210-bus_cleanup-input2-v1-2-0daef7e034e0@marliere.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-60435-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1517492dyd; Sat, 10 Feb 2024 07:15:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlBYkAkI8zzhe4t3Uu1vKoDUecD1qPFVAQiIrPBMNxdsnXD/hb/JN4sLAW4VYxM4XFFszH X-Received: by 2002:a05:6808:1285:b0:3bf:efd2:b852 with SMTP id a5-20020a056808128500b003bfefd2b852mr3026887oiw.36.1707578121218; Sat, 10 Feb 2024 07:15:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707578121; cv=pass; d=google.com; s=arc-20160816; b=vmEUuXKxG9ldVjFzi0oMVC9HwHFG2KJOaceJqnGrTQfuZs6J+Vm13c633MphqWdAaL DqEmwha61iwvGK9mAYrC1KKUiEtq8t9ZB1ZsX0E6s0ntMFAl111RLA2oSzD4jU+6H1zv MBGnycr+Wo+THPRFzMWt5t4jDo3DTesnkf3W5mlzDemAcwzu5L7GGauiOMeu2nD0+4eS 78iS22wax/g+CZlXZ/UVFWXReWy+Yluh1obmYjvA2wyE/AxNQOsDNKY5RPF3S0gkGF4D rAZAX9fkCpX6NKbkn5kxciCGd+L0pMfkzhhcs2m3F+8KS7rd4T1bZ4aXMGkEOjZd+V1G nVbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=NX4kPnkghriz8C5dtPzUceyYxZS8GIQH2mEq/Ym7Bqo=; fh=UIDRx/mv/4Li4BPD6BmvUsQxzvaO8I+6BmrOLS7VWjo=; b=kyuwiIncO87+gTYXpsZlpU+boo84d+6VLkbgceqsq0mpT9nrnA9HN4Kh2QgWszW597 WK6+17b4/Dwy1SBKhosnLK6FuMpDApzZ5WvgmJNUUgTbChDXmfS60rc+P9Idd5zJH1ez HrRzOTVFXrF9c5sNaZ6N5HvC01ASNXQtDsHniEtNpl8YO6jiFijKzZfsKxGkq+QsMhRo fK6lB+PpNBRGc/ptTCqfpi5OQAVz8LX4NE3unSExMTP8Nnb9J2BtcjFVGqDXoyNuVcDU 2jlKTmZFIp7IqmwMnBfcNQnNeYhKIEcjb6sPy/nIfTMcbSU+60w/tSYubDLvB2c6THr1 0KqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=W2GxqCzX; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60435-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCUsWm9qjUiJEKwOKsWNyuE5tVimmYoaQSxfOvCcLPnzpNR+KhJrwPeBLsa1JprlEBNmMzDB+BnlLPlvET7myYteS3YyFw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 25-20020a05620a04d900b00783e4bf2c7fsi1867137qks.256.2024.02.10.07.15.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 07:15:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60435-ouuuleilei=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=@marliere.net header.s=2024 header.b=W2GxqCzX; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60435-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net 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 117731C214EE for <ouuuleilei@gmail.com>; Sat, 10 Feb 2024 15:15:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B1AC5C8ED; Sat, 10 Feb 2024 15:14:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="W2GxqCzX" Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE5A95C5F5; Sat, 10 Feb 2024 15:14:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707578080; cv=none; b=sAYu5i3pBybtZnXaj3k8yVCEZxdtWqAQwoAmCrt6BBUP99e+NWLDOoMVrtOLpIlCjz8ShNYto+yxJwKNhRD80Jn6K/iOyPBV2tc3sRcx9dPBdDEGtQnwU9giMUhj2Sn9YlOQP3T4ulo3chlMw0VaoyL+iamN4wyy8NFmRjhAgOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707578080; c=relaxed/simple; bh=JoJOoyztp4EgMKE0w5/pYOrwIDStyJc4o5zoKCZW3wI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZQF+SrDnGZBOKHPldP5drA/Jdfn5woZ8FSvau3n/fpBiMssrV26Gx89XHyMmITyskMFXz0E2pNfhpnDWdRxpdcjJ8U/eTYcy+YZCYAJQG1bXBR2ehZ4x05DVaMqG1KC027L7bGB3DQuQqOC0lA1JHo+FVGzPudshr4d3rAxoC+A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=W2GxqCzX; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d7232dcb3eso16228625ad.2; Sat, 10 Feb 2024 07:14:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707578078; x=1708182878; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NX4kPnkghriz8C5dtPzUceyYxZS8GIQH2mEq/Ym7Bqo=; b=mZ+YFD0J8Dxvc64Rtvmlk9DjWCqHZc/hjENDKopcYphZ4EOpyOd91VuIARt1BOHHZH lTxPotL3rJef9grbESbFcFgf7+DRtWKZ6ugxDUApk0u8MQgQqA22O8o7+M4cFRomsYnN Xa+LWEPBjhESlRwSYv2wt1OR4FqkxmoYiT4BIn30PJZIrXHSvERniVhyasZZzJ4Ci6tJ k31Bo2N+zzKNzLq48UAQD4+2dKcpz7/DLKxIeG6Xc9vkMeoCb+yRuSkEiy8vFKOBwuOv B28uuAjW0fGhTtltmeTt988qz0Pz8MsZizvs+XTli5nhe1hvC1N2rJnKnXVx7zklFbmq 7fTw== X-Gm-Message-State: AOJu0YxaIh8KxcpEWgjogKtujFFG173R9ox3Yi4WRolL5Fmli4NXwu+T 3yr03zYrcy/icbXAAl2XDFX2zEZQ6NgAv4hTCpmVKAtNj7lK1CRI X-Received: by 2002:a17:903:40c4:b0:1d7:7347:d80e with SMTP id t4-20020a17090340c400b001d77347d80emr2526076pld.37.1707578078086; Sat, 10 Feb 2024 07:14:38 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV39fp8PQTzcsikdCZCt6bed5TTjnqQFJ76j1TZJmRF/7uoJmgtpxhg75Jgy13xRQq4nCyu7dmapAScGdt3O2IO2+6s8PqEpzXeIfmgDye20I/inbBE30IWv+evM3PKVj9GwVOq3OJOEw== Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id kp3-20020a170903280300b001d8a5c08277sm3151239plb.260.2024.02.10.07.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 07:14:37 -0800 (PST) From: "Ricardo B. Marliere" <ricardo@marliere.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707578076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NX4kPnkghriz8C5dtPzUceyYxZS8GIQH2mEq/Ym7Bqo=; b=W2GxqCzXO8zzIE/IuIWyMRqLULmxoXdB+qFDfqApXPAaPY8CY6jxlvEVxY4s2AgMSLhyR4 U5eO/rrNXhZ19dVEQhAVKsEOMCcVMVSwnH2eZBOSCaRZl06GpzgJIjH0DOlErtmkPyt020 lR7U+DFjbcEqbWucgcD4fDaBCzLvvZARSy24OTOxyfMZ3cHuDEpOnsnqEmpioq/m/2oGZZ rALgpVRYUCum1xjh0lNoHcceZkPmpgTluTKbFmEXLKGP/9BRAGLhPIdF+uYu6yu5WPcYUg lVJH8w9dM+LdBLAR9Ku7BETJMgou8QRduIFGs+CTMfpCD7t79luYp3hEcOALRg== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sat, 10 Feb 2024 12:15:02 -0300 Subject: [PATCH 2/2] Input: serio - make serio_bus const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240210-bus_cleanup-input2-v1-2-0daef7e034e0@marliere.net> References: <20240210-bus_cleanup-input2-v1-0-0daef7e034e0@marliere.net> In-Reply-To: <20240210-bus_cleanup-input2-v1-0-0daef7e034e0@marliere.net> To: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Ricardo B. Marliere" <ricardo@marliere.net> X-Developer-Signature: v=1; a=openpgp-sha256; l=1356; i=ricardo@marliere.net; h=from:subject:message-id; bh=JoJOoyztp4EgMKE0w5/pYOrwIDStyJc4o5zoKCZW3wI=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlx5L5DNW883c3i//px5uQLulX/pacA+WVTN1VV MwzcHOG0VGJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZceS+QAKCRDJC4p8Y4ZY pmsYD/wK1YmO40D0PMDD1RYjsRNU20uSX/MD6Op9yUikmaKnAaj417aKLdjR0NVC7JxWHZJIgm8 i18kvg79pp7UCKhG6dVdUfrFZR6OCXlaJzCPxZnt06dKdaWfrVOTGrwqwOU1G9Ni5WNY7VKNNPD CCtmd4uveTxIxuZsnAmy2laWHQfI84H8s2a7Jx+bHeiU/qwSmEcpKBnQAXdzN3OnNFLSzUCxbJ6 ylyQiEmYNfg9O0KCBqkv1u+TuFbDxU6ptQ2fhlDrzl59dBlWpJ669phEocfcoKXx5mO12NDERf7 L3DZCDVAUgF71Ocx7D93W9UWD8Ppnau+Cq1BkAQ5rqV8j4meAWYuYEaZTqQhMuDDFDkwNCHOnx8 AuRCgnQpIm0XWKIwZML7aSXxItYWPKtdCe78xh9QGOlY3f0S+ZtHwWnGYhJx9udIvaft1PlhiAP hLvJeW74MqRQawuJxzndFtTIDOpOe8evkyi+Xu61jgju5NEw++QJoK+ofVzjEKi+r1AmyA1ujxH w0uF3iF2uDeKojv862ecADb1pN1mUqMTe3aIvrXvIAkaya58m2Oz8Zbvj1UCxwgVbSbbGQUaXgg QbB3tjBpQGt1NamzoMNyqVaojo3/rNEuq/OG5VH211vx7Bml9KGO63Yk2b/vKj2VHRL0G4QYkYg fbBHstPTIi0OiPQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790525435983429359 X-GMAIL-MSGID: 1790525435983429359 |
Series |
Input: struct bus_type cleanup
|
|
Commit Message
Ricardo B. Marliere
Feb. 10, 2024, 3:15 p.m. UTC
Now that the driver core can properly handle constant struct bus_type,
move the serio_bus variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
drivers/input/serio/serio.c | 2 +-
include/linux/serio.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Sat, Feb 10, 2024 at 12:15:02PM -0300, Ricardo B. Marliere wrote: > Now that the driver core can properly handle constant struct bus_type, > move the serio_bus variable to be a constant structure as well, > placing it into read-only memory which can not be modified at runtime. > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net> Applied, thank you.
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 767fc9efb4a8..a8838b522627 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -1007,7 +1007,7 @@ irqreturn_t serio_interrupt(struct serio *serio, } EXPORT_SYMBOL(serio_interrupt); -struct bus_type serio_bus = { +const struct bus_type serio_bus = { .name = "serio", .drv_groups = serio_driver_groups, .match = serio_bus_match, diff --git a/include/linux/serio.h b/include/linux/serio.h index 6c27d413da92..7ca41af93b37 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -15,7 +15,7 @@ #include <linux/mod_devicetable.h> #include <uapi/linux/serio.h> -extern struct bus_type serio_bus; +extern const struct bus_type serio_bus; struct serio { void *port_data;