public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hv: vmbus: make hv_bus const
@ 2024-02-04 16:38 Ricardo B. Marliere
  2024-02-05 12:49 ` Greg Kroah-Hartman
  2024-02-05 16:40 ` Michael Kelley
  0 siblings, 2 replies; 5+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 16:38 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui
  Cc: linux-hyperv, linux-kernel, Greg Kroah-Hartman,
	Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the hv_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/hv/vmbus_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index edbb38f6956b..c4e6d9f1b510 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -988,7 +988,7 @@ static const struct dev_pm_ops vmbus_pm = {
 };
 
 /* The one and only one */
-static struct bus_type  hv_bus = {
+static const struct bus_type  hv_bus = {
 	.name =		"vmbus",
 	.match =		vmbus_match,
 	.shutdown =		vmbus_shutdown,

---
base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70
change-id: 20240204-bus_cleanup-hv-2ca8a4603ebc

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


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

* Re: [PATCH] hv: vmbus: make hv_bus const
  2024-02-04 16:38 [PATCH] hv: vmbus: make hv_bus const Ricardo B. Marliere
@ 2024-02-05 12:49 ` Greg Kroah-Hartman
  2024-02-05 16:40 ` Michael Kelley
  1 sibling, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-05 12:49 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	linux-hyperv, linux-kernel

On Sun, Feb 04, 2024 at 01:38:02PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the hv_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>

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

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

* RE: [PATCH] hv: vmbus: make hv_bus const
  2024-02-04 16:38 [PATCH] hv: vmbus: make hv_bus const Ricardo B. Marliere
  2024-02-05 12:49 ` Greg Kroah-Hartman
@ 2024-02-05 16:40 ` Michael Kelley
  2024-02-05 17:34   ` Ricardo B. Marliere
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Kelley @ 2024-02-05 16:40 UTC (permalink / raw)
  To: Ricardo B. Marliere, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
	Dexuan Cui
  Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman

From: Ricardo B. Marliere <ricardo@marliere.net> Sent: Sunday, February 4, 2024 8:38 AM
> 

NIT:  For consistency, we try to use "Drivers: hv: vmbus:" as the prefix on the
Subject line for patches to vmbus_drv.c.

Otherwise,

Reviewed-by: Michael Kelley <mhklinux@outlook.com>

> Now that the driver core can properly handle constant struct bus_type,
> move the hv_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/hv/vmbus_drv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index edbb38f6956b..c4e6d9f1b510 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -988,7 +988,7 @@ static const struct dev_pm_ops vmbus_pm = {
>  };
> 
>  /* The one and only one */
> -static struct bus_type  hv_bus = {
> +static const struct bus_type  hv_bus = {
>  	.name =		"vmbus",
>  	.match =		vmbus_match,
>  	.shutdown =		vmbus_shutdown,
> 
> ---
> base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70
> change-id: 20240204-bus_cleanup-hv-2ca8a4603ebc
> 
> Best regards,
> --
> Ricardo B. Marliere <ricardo@marliere.net>
> 


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

* Re: [PATCH] hv: vmbus: make hv_bus const
  2024-02-05 16:40 ` Michael Kelley
@ 2024-02-05 17:34   ` Ricardo B. Marliere
  2024-03-01  8:39     ` Wei Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Ricardo B. Marliere @ 2024-02-05 17:34 UTC (permalink / raw)
  To: Michael Kelley
  Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman

Hi Michael,

On  5 Feb 16:40, Michael Kelley wrote:
> From: Ricardo B. Marliere <ricardo@marliere.net> Sent: Sunday, February 4, 2024 8:38 AM
> > 
> 
> NIT:  For consistency, we try to use "Drivers: hv: vmbus:" as the prefix on the
> Subject line for patches to vmbus_drv.c.

Thanks for the feedback, I'll keep that in mind in the future. I looked
into a few commits using `git blame` and 'hv: ' seemed to be sufficient.

All the best,
-	Ricardo.



> 
> Otherwise,
> 
> Reviewed-by: Michael Kelley <mhklinux@outlook.com>
> 
> > Now that the driver core can properly handle constant struct bus_type,
> > move the hv_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/hv/vmbus_drv.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> > index edbb38f6956b..c4e6d9f1b510 100644
> > --- a/drivers/hv/vmbus_drv.c
> > +++ b/drivers/hv/vmbus_drv.c
> > @@ -988,7 +988,7 @@ static const struct dev_pm_ops vmbus_pm = {
> >  };
> > 
> >  /* The one and only one */
> > -static struct bus_type  hv_bus = {
> > +static const struct bus_type  hv_bus = {
> >  	.name =		"vmbus",
> >  	.match =		vmbus_match,
> >  	.shutdown =		vmbus_shutdown,
> > 
> > ---
> > base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70
> > change-id: 20240204-bus_cleanup-hv-2ca8a4603ebc
> > 
> > Best regards,
> > --
> > Ricardo B. Marliere <ricardo@marliere.net>
> > 
> 

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

* Re: [PATCH] hv: vmbus: make hv_bus const
  2024-02-05 17:34   ` Ricardo B. Marliere
@ 2024-03-01  8:39     ` Wei Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2024-03-01  8:39 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Michael Kelley, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
	Dexuan Cui, linux-hyperv@vger.kernel.org,
	linux-kernel@vger.kernel.org, Greg Kroah-Hartman

On Mon, Feb 05, 2024 at 02:34:12PM -0300, Ricardo B. Marliere wrote:
> Hi Michael,
> 
> On  5 Feb 16:40, Michael Kelley wrote:
> > From: Ricardo B. Marliere <ricardo@marliere.net> Sent: Sunday, February 4, 2024 8:38 AM
> > > 
> > 
> > NIT:  For consistency, we try to use "Drivers: hv: vmbus:" as the prefix on the
> > Subject line for patches to vmbus_drv.c.
> 
> Thanks for the feedback, I'll keep that in mind in the future. I looked
> into a few commits using `git blame` and 'hv: ' seemed to be sufficient.
> 

No worries. I fixed the title for you and applied the patch.

Thank you for the patch.

Wei.

> All the best,
> -	Ricardo.

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

end of thread, other threads:[~2024-03-01  8:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 16:38 [PATCH] hv: vmbus: make hv_bus const Ricardo B. Marliere
2024-02-05 12:49 ` Greg Kroah-Hartman
2024-02-05 16:40 ` Michael Kelley
2024-02-05 17:34   ` Ricardo B. Marliere
2024-03-01  8:39     ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox