From patchwork Sat Feb 3 15:31:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 13544285 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 076BC5F553; Sat, 3 Feb 2024 15:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706974319; cv=none; b=ftEytGV+I0nAzbXY5yq5KyRfU9het/PSRusfKzVmbw/Q8h+jAQnan2LrOUX5MTaEV1k3ePH+7Ow5vNyCXA3kcVkGraNVEHEtNSpxD6ZpE9W6wo1CPZFaoCFJZIOfgkBdS7dE6IEeLRk8eqpetgDSP6kQEc9jymLcdzimS99eVuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706974319; c=relaxed/simple; bh=YeXplEKxiKSr0fUaoHc3KKtm9jjg4cmFKCOYzQsxP34=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YOUsf0nFA2kGzQiaDQGdFEMice1XByvXPwoZ8rLFPHWrcuFJdD3bX0T95TtIygzMx0crE5Gyc7JFvVBLDit2Ym4zvp6urgXYvzVtZCRXwHKchI0HZX8D3yfXZsQSHBO/PeSz6SfOBNWpzk+alK0jY2RIv75iZDX929HiukGW/Xo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=fail (0-bit key) header.d=marliere.net header.i=@marliere.net header.b=AUO9blWQ reason="key not found in DNS"; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=marliere.net header.i=@marliere.net header.b="AUO9blWQ" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1d934c8f8f7so27572355ad.2; Sat, 03 Feb 2024 07:31:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706974317; x=1707579117; 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=2/QYvYl3noKUntcPqI6dq+qD8nnGZtpzrjLRRn/gWtg=; b=FW+emPEm+NZNuSTPvlR2VLAE1sJXpifArT8njISszzx6p1D4j3NjOWa6cU+WMq6eoy zvAxkaMV0dnisgU7DkOlW1VbeaA6chpYT2zE7FCZAKViF3RGrKp4Rap3OMdFQYtvJGG0 GNT7d/eEB2a3Onc2CianleFE8la9YlZZEOddZLC06p9Cpdq4oiY3RGNKlR5hJ3iX6oEH wAQo+xUCSvlcxhxwAbh/fBX0K4yi5Q0z/kXYI03HRAdx6IXBK8L8xXERed1yBCOevNyG CyrR6H8GRcsZZGAQ9OkbVY+qwSA7BC8O4uaCkk9TjjVixAgUNJsI8af/T0bfApy4FXCf 9Hdw== X-Gm-Message-State: AOJu0Yx9c20zKl/PvVpAsMY4Gde/lWgXJHJOMrqjB6XksOVcT+tzrxU2 IctaxRGXvVY5AUl7WAxmRQtincqejYDpxS9U0JgJpf8uwh9IdFkcpXcHwHelvpNDXA== X-Google-Smtp-Source: AGHT+IGPO4lYod4XCkRsx0HysvoZ3svwv9xRXfLAeLaTODo6eU5/9qaSQGQZbwKi7fzoy4YlqXIReQ== X-Received: by 2002:a17:902:7848:b0:1d9:503b:807a with SMTP id e8-20020a170902784800b001d9503b807amr7541442pln.44.1706974317298; Sat, 03 Feb 2024 07:31:57 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXAOrivb0PQOiVn977dTG3F0TB3hp6eWI6gsc4gISAHKe60+2tH8scaZP/17r975a3luZH8OKof75R0DLYRWKvjKMdqyEtODI0UbJAxxWaCMa/dd5y64UqVdPRBQP2zq5Fp2NsoIYTsFhM/RYcxtkQIdDXapJMynIff5U5AHiKHKY+vCTivXDldEiXAY30/PD8FEOzAP8TLHVpvXDCe4MSWJZ+JfGGlYUvHse+reekVn8qeEP4g6fWn1ruj9eFS Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id ju3-20020a170903428300b001d91b6175afsm3437131plb.18.2024.02.03.07.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 07:31:56 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2023; t=1706974315; 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=2/QYvYl3noKUntcPqI6dq+qD8nnGZtpzrjLRRn/gWtg=; b=AUO9blWQx2WJvxkrvcD1acABmJKwhXhOXdX5AHxsvshLgZHXafPD3j7Rztf4w1WrV9MUs2 HveJJ2K+4oHTTRtple2ng9o6wn6AlKqwch//99Ry377U9mwKwRRi7l7HUf+6rJPfhUkBlN JokedENvwIscwwnjIpWy7oTP11RyM5w3EkJZ/IwdkWlRWo8PPIi8aVMWdkhLSl0G7VhfYU WFFLkxnT9XDYTSEkewV4Uxb7C02iNcc3Ja+/KJ7iOp+ZNzX7nJbBO6I3+nAGKPWEirasuh nASun878mm/sDBLJr7UMnExca/V4Uhc5ZWyST6k2fUCL4fduj+Oy5jW61SIxlQ== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sat, 03 Feb 2024 12:31:26 -0300 Subject: [PATCH 1/2] media: cec: make cec_bus_type const Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240203-bus_cleanup-media-v1-1-33e8feeab912@marliere.net> References: <20240203-bus_cleanup-media-v1-0-33e8feeab912@marliere.net> In-Reply-To: <20240203-bus_cleanup-media-v1-0-33e8feeab912@marliere.net> To: Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus , Laurent Pinchart Cc: Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=953; i=ricardo@marliere.net; h=from:subject:message-id; bh=YeXplEKxiKSr0fUaoHc3KKtm9jjg4cmFKCOYzQsxP34=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlvlyDBuFHPWAN8p98l9B8kgNwNyYbw0dpVad6l Sy3X7jhBNyJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZb5cgwAKCRDJC4p8Y4ZY pjuFD/0WXuxiejW/FybhrMFQ7866XFRpdoNfRN2YZGCf/hnKf4bd1ee6N7+UzR0cP3FTZDPfx/A 20wyByski8er3Hk9h9vpVE16Q7c1rUE2t/APgUvQpcomWICaROvh4xEHFMMEB6INI6PFO2aBdII 3y+2k5cnmUlcaURrSDwKsL613zGNTdGHiy+SFNc0dBDh9WvvY+NB6MUNaZ1hVwG0p2OEESCxgMb uRV1DA/ZJc3fu0Yn2T12+PwxjnSoYwc9VwYRJbWksPaE2lunlgVDJ0dqzel2iPpo/teUolfS8ze mU41RU4X2JG5dUSQKSQfbpGY5MtrOQpmJ54QXiCouwGJJXcZARafPjnhxzDkzlcGv+nMGO0qjgX fh7yY0k0aykZON9jFEOFpTcgtCUwScHwm1TS9kQaHtib6hEmqvpiDYtacvTaoO8ihmC8pGiEXQj tqeHsaZQuKXdhaX5gRBysAgTgnonkLDP7nQ31HNMaIjsXhCK8QPS4RjEfLXwgZCgTIoVtaTLw8h N05Z4r9unhPZS2lezBHFGXCQSL2vEOTjrx8BeRmnuat/hnFOsDRknolNtxuAx4eqaaV8/Yo22Wi 0a9VYLy1433mpryLM9JtuCICaQTFZU49OFQcYBC/RYDPe2fc2yF1e/REu65K04J/jETLF3FjotQ KYLK0bG2XGDLaGg== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 Now that the driver core can properly handle constant struct bus_type, move the cec_bus_type 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 Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Greg Kroah-Hartman Reviewed-by: Laurent Pinchart --- drivers/media/cec/core/cec-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index 7e153c5cad04..5a54db839e5d 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -93,7 +93,7 @@ static void cec_devnode_release(struct device *cd) cec_delete_adapter(to_cec_adapter(devnode)); } -static struct bus_type cec_bus_type = { +static const struct bus_type cec_bus_type = { .name = CEC_NAME, }; From patchwork Sat Feb 3 15:31:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 13544286 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 1A3E25F84C; Sat, 3 Feb 2024 15:32:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706974322; cv=none; b=aPZ4pRFKVIPGCEsT0U2sQ9GMs8i43NXt0ZGMoWXLMR9PDNXXumhdFff4E74avnj1SXJA/aEGVXb31CuKZrRWJQJw9kNs7JdksPuyMbkgu9dg/QrXqATTdzV07BLNgl3DaJLbzo5FnxJociYDWmatmrY1glq3ANUGjNvo3ncfr0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706974322; c=relaxed/simple; bh=OcdO4+Lmv5jeFYKjb4B+mP70CtkJZ7ufqOpuShyPo2M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qHpjbj+2S+i0VhRXBKXV2IE7qQut8w5Xx63yTsGT4OcZwFDzMmjNep6Ip8GblgQLPZlMYHieQufgCXP2d8rCVLyBL42QlVSc6oMWllSt/0onYUe6E1fUzanztlXQUnKwqwmPvSRkZWVO8b+8o7Qo0zIFr8Yq9yXt7DOYDF3FBCk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=fail (0-bit key) header.d=marliere.net header.i=@marliere.net header.b=oiGo5E3W reason="key not found in DNS"; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=marliere.net header.i=@marliere.net header.b="oiGo5E3W" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d958e0d73dso14290325ad.1; Sat, 03 Feb 2024 07:32:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706974320; x=1707579120; 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=HkzC/4J1CJguP9SwF3o5ml0BgeYLSNx8kmjhXVsnB9E=; b=iGej0mvq/LvJabqsedujqI7VWVRIJsqY3ky6hznxE7AYiFAIzxb1IbqNXj7mtfsgi8 ML/f3o2jdFwtl83BfM5VIVPAB9JJTJYDEQBN4XaDo9Nx0WQ+59FUXB+vPReR6aa/EYEr 7UB3yC/6nuw3WHWXLuDsihftXLqw80NNXMwb3xo22gAOWaEixYxiXyex5fNK4wqxG9im +0+262nAniyjqv3CYKafjtpCGGpfYU5ILseWCVfik+ULj8HjQPpLOdS5WT2YH4dsAULE bKSmE4rXPgKIKoE8bo8k4T76LavU7oEaCGbQAe5m3j/gfuKS5t2hxpAp27lDgAcMspvt HOSA== X-Gm-Message-State: AOJu0YyAPCb3S9+s3EpB3W6WeTNwZQMeIvs73q8xYVm4YD+C6I6nK+HK fKEr2UkHek9kGoC0d7ODY3sPETow2P0p4WQDYdqpCdG+YVR0yRt2 X-Google-Smtp-Source: AGHT+IGHWPOihH4W0+TDMHhxLH7sIs4raapMS0uWhDuNiv3zVdIIIJ0Hn5wELcdx60T82x25ljfwPQ== X-Received: by 2002:a17:903:1d1:b0:1d8:d3e8:c322 with SMTP id e17-20020a17090301d100b001d8d3e8c322mr2696494plh.0.1706974320364; Sat, 03 Feb 2024 07:32:00 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWsbCWCbpMTZF0qmV7cjOaqJWm8aUEaOs3YMNfK0AWbNifZead2DBYemig4EyDFFNu3KuHJhn4iCg45AFB3H34sh4Tw8SAexk9kX28WsrSAPAn9DOBfynsQTpBOns1TrpJ1Q3cnI3hmwVSKaHxgEUD3ho4ky014N+wVIs4DqqeWAwWl8jF2PqlTKRvNmJLdc+feIXJGhmGawVuNE/O7OAL9VK4zB2JnCk9Wf+vVLaoSANTWzNcc/nBkaU/3vtiy Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id 19-20020a170902c15300b001d8fe502661sm3424915plj.19.2024.02.03.07.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 07:31:59 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2023; t=1706974319; 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=HkzC/4J1CJguP9SwF3o5ml0BgeYLSNx8kmjhXVsnB9E=; b=oiGo5E3W4AAd0y4bbfmIKXG0KFVurh6RBcQoxKr1OF/trrTzx8Ru9syGGXjDCmlEgcALEd z+z01msOLrEoUq74b4b7bDVl62Yz+XIOVw1oB50edA3wp3yoIg3CIJnVOebPftiYYM4LC2 MFvAx0lrVeKLAp9+o0smYFI4mTM16+tKaga1vSaOHWOnvmyZ8plgFthE2CIfL1isW6JGHb tjxUyFHKWzZtUKF5Fg4HPlvXUMYrS+aiUrxVMDCW3bjxuN1rURQzzQsjwcv6zqSmVWGEAT 1OqdAo9vu7LM5J8f0vVhL2lG+is0T0L1V8so+1qfyloX0VHkHiISZ+Gn/APEGw== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sat, 03 Feb 2024 12:31:27 -0300 Subject: [PATCH 2/2] media: media-devnode: make media_bus_type const Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240203-bus_cleanup-media-v1-2-33e8feeab912@marliere.net> References: <20240203-bus_cleanup-media-v1-0-33e8feeab912@marliere.net> In-Reply-To: <20240203-bus_cleanup-media-v1-0-33e8feeab912@marliere.net> To: Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus , Laurent Pinchart Cc: Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=953; i=ricardo@marliere.net; h=from:subject:message-id; bh=OcdO4+Lmv5jeFYKjb4B+mP70CtkJZ7ufqOpuShyPo2M=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlvlyDdcnqcg+yRKKpg+tMvuurs4R3Bz0/X8TXt mdhFHwD/BqJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZb5cgwAKCRDJC4p8Y4ZY piruEACGbgMP1negXyitmpiMwUI7wB9FY1Sb+qOZmuY4L3abJBCjoEpK3hYjeWfViC6/6Y/hVjT 5BK9H5M//XER6BZ34tOS8MpkQ6VPMu01xdX7jY9Rt3dHJrdyvbUMyPVR72r58JXpXt5+JdFDbhW W678/WJJ90AXK1hRxRxmBpHahfOoomuXyNAnuMVnf0U2ExOkdde2/Rd7m65geMUfYPiUtE+Amha dFiIQMULu2OzDM2vlfXtgxunnXdWgjP7dE/yOI3z37s65T8ThTgsxubUziMbItbrJpXUFkrt2k+ 8uLP8uJ4RGwPML0uOlpeEREGgfTL02KhT7rUExtoWK7i2dqzVkGQ8Wm6mV009UbZqfqWnvLdm/i 2M9M4lyVvT7VREGv7Ysq7IXu//P0JXWttdYpUwKV9eMHljFT77RwAzxiAtmd8O0zX6gjuUebIp5 MmNQDcO4WNjAaPUo/J08MtkbY0/aVJkT15dlY0ZPYM4EkjxG6i3ArFEPUvUOOzf9JFHVQLYqc1n 3A4ksuXlUW/aFjNo9Hu/mrq5yzGaD1ddtu/EgdKc3k0hcQQMrW7SYKCRBfQ7FyfJZaTWEzQTViV 1kjI49vZy75+MsQ7UXNYbdu0xvpE1AHaXX1Do1HfVAmom7QQe45xSUB0N/1lN1fjV9uymq7Ublu tITzCWpTCq1XoYA== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 Now that the driver core can properly handle constant struct bus_type, move the media_bus_type 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 Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Greg Kroah-Hartman Reviewed-by: Laurent Pinchart --- drivers/media/mc/mc-devnode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/mc/mc-devnode.c b/drivers/media/mc/mc-devnode.c index 680fbb3a9340..90646805bd81 100644 --- a/drivers/media/mc/mc-devnode.c +++ b/drivers/media/mc/mc-devnode.c @@ -63,7 +63,7 @@ static void media_devnode_release(struct device *cd) pr_debug("%s: Media Devnode Deallocated\n", __func__); } -static struct bus_type media_bus_type = { +static const struct bus_type media_bus_type = { .name = MEDIA_NAME, };