All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kunit: make kunit_bus_type const
@ 2024-02-14 19:15 Ricardo B. Marliere
  2024-02-15  7:39 ` Greg Kroah-Hartman
  2024-02-19 23:39 ` David Gow
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-14 19:15 UTC (permalink / raw)
  To: Brendan Higgins, David Gow
  Cc: linux-kselftest, kunit-dev, linux-kernel, Greg Kroah-Hartman,
	Ricardo B. Marliere

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the kunit_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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 lib/kunit/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/kunit/device.c b/lib/kunit/device.c
index f5371287b375..d23b8fb166d8 100644
--- a/lib/kunit/device.c
+++ b/lib/kunit/device.c
@@ -35,7 +35,7 @@ struct kunit_device {
 
 #define to_kunit_device(d) container_of_const(d, struct kunit_device, dev)
 
-static struct bus_type kunit_bus_type = {
+static const struct bus_type kunit_bus_type = {
 	.name		= "kunit",
 };
 

---
base-commit: 76021a887a50892fd969cd42a5f3467f5696e50e
change-id: 20240214-bus_cleanup-kunit-840cd37b0e10

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kunit: make kunit_bus_type const
  2024-02-14 19:15 [PATCH] kunit: make kunit_bus_type const Ricardo B. Marliere
@ 2024-02-15  7:39 ` Greg Kroah-Hartman
  2024-02-19 23:39 ` David Gow
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-15  7:39 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Brendan Higgins, David Gow, linux-kselftest, kunit-dev,
	linux-kernel

On Wed, Feb 14, 2024 at 04:15:00PM -0300, Ricardo B. Marliere wrote:
> Since commit d492cc2573a0 ("driver core: device.h: make struct
> bus_type a const *"), the driver core can properly handle constant
> struct bus_type, move the kunit_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 <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] kunit: make kunit_bus_type const
  2024-02-14 19:15 [PATCH] kunit: make kunit_bus_type const Ricardo B. Marliere
  2024-02-15  7:39 ` Greg Kroah-Hartman
@ 2024-02-19 23:39 ` David Gow
  1 sibling, 0 replies; 3+ messages in thread
From: David Gow @ 2024-02-19 23:39 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Brendan Higgins, linux-kselftest, kunit-dev, linux-kernel,
	Greg Kroah-Hartman

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

On Thu, 15 Feb 2024 at 03:14, Ricardo B. Marliere <ricardo@marliere.net> wrote:
>
> Since commit d492cc2573a0 ("driver core: device.h: make struct
> bus_type a const *"), the driver core can properly handle constant
> struct bus_type, move the kunit_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 <gregkh@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---

Looks good here: thanks very much.

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4014 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-19 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-14 19:15 [PATCH] kunit: make kunit_bus_type const Ricardo B. Marliere
2024-02-15  7:39 ` Greg Kroah-Hartman
2024-02-19 23:39 ` David Gow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.