linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] PNP: constify driver name
@ 2020-03-06  7:53 Corentin Labbe
  2020-03-06  7:53 ` [PATCH 2/2] rtc: cmos: remove useless cast for driver_name Corentin Labbe
  2020-03-17 17:46 ` [PATCH 1/2] PNP: constify driver name Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Corentin Labbe @ 2020-03-06  7:53 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni, rafael.j.wysocki
  Cc: linux-kernel, linux-rtc, Corentin Labbe

struct pnp_driver has name set as char* instead of const char* like platform_driver, pci_driver, usb_driver, etc...
Let's unify a bit by setting name as const char*.
Furthermore, all users of this structures set name from already const
data.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 include/linux/pnp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 3b12fd28af78..b18dca67253d 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -379,7 +379,7 @@ struct pnp_id {
 };
 
 struct pnp_driver {
-	char *name;
+	const char *name;
 	const struct pnp_device_id *id_table;
 	unsigned int flags;
 	int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
-- 
2.24.1


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

* [PATCH 2/2] rtc: cmos: remove useless cast for driver_name
  2020-03-06  7:53 [PATCH 1/2] PNP: constify driver name Corentin Labbe
@ 2020-03-06  7:53 ` Corentin Labbe
  2020-03-17 17:46 ` [PATCH 1/2] PNP: constify driver name Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Corentin Labbe @ 2020-03-06  7:53 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni, rafael.j.wysocki
  Cc: linux-kernel, linux-rtc, Corentin Labbe

Now the pnp_driver name is "const char *", there are no need to cast
driver_name.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 drivers/rtc/rtc-cmos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index fb13993fad31..bcc96ab7793f 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1346,7 +1346,7 @@ static const struct pnp_device_id rtc_ids[] = {
 MODULE_DEVICE_TABLE(pnp, rtc_ids);
 
 static struct pnp_driver cmos_pnp_driver = {
-	.name		= (char *) driver_name,
+	.name		= driver_name,
 	.id_table	= rtc_ids,
 	.probe		= cmos_pnp_probe,
 	.remove		= cmos_pnp_remove,
-- 
2.24.1


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

* Re: [PATCH 1/2] PNP: constify driver name
  2020-03-06  7:53 [PATCH 1/2] PNP: constify driver name Corentin Labbe
  2020-03-06  7:53 ` [PATCH 2/2] rtc: cmos: remove useless cast for driver_name Corentin Labbe
@ 2020-03-17 17:46 ` Rafael J. Wysocki
  2020-03-18  9:21   ` LABBE Corentin
  1 sibling, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-03-17 17:46 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: a.zummo, alexandre.belloni, linux-kernel, linux-rtc, linux-acpi

On 3/6/2020 8:53 AM, Corentin Labbe wrote:
> struct pnp_driver has name set as char* instead of const char* like platform_driver, pci_driver, usb_driver, etc...
> Let's unify a bit by setting name as const char*.
> Furthermore, all users of this structures set name from already const
> data.
>
> Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
> ---
>   include/linux/pnp.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/pnp.h b/include/linux/pnp.h
> index 3b12fd28af78..b18dca67253d 100644
> --- a/include/linux/pnp.h
> +++ b/include/linux/pnp.h
> @@ -379,7 +379,7 @@ struct pnp_id {
>   };
>   
>   struct pnp_driver {
> -	char *name;
> +	const char *name;
>   	const struct pnp_device_id *id_table;
>   	unsigned int flags;
>   	int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);

Applied as 5.7 material along with the [2/2].

BTW, please CC PNP patches to linux-acpi in the future.



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

* Re: [PATCH 1/2] PNP: constify driver name
  2020-03-17 17:46 ` [PATCH 1/2] PNP: constify driver name Rafael J. Wysocki
@ 2020-03-18  9:21   ` LABBE Corentin
  0 siblings, 0 replies; 4+ messages in thread
From: LABBE Corentin @ 2020-03-18  9:21 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: a.zummo, alexandre.belloni, linux-kernel, linux-rtc, linux-acpi

On Tue, Mar 17, 2020 at 06:46:24PM +0100, Rafael J. Wysocki wrote:
> On 3/6/2020 8:53 AM, Corentin Labbe wrote:
> > struct pnp_driver has name set as char* instead of const char* like platform_driver, pci_driver, usb_driver, etc...
> > Let's unify a bit by setting name as const char*.
> > Furthermore, all users of this structures set name from already const
> > data.
> >
> > Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
> > ---
> >   include/linux/pnp.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/pnp.h b/include/linux/pnp.h
> > index 3b12fd28af78..b18dca67253d 100644
> > --- a/include/linux/pnp.h
> > +++ b/include/linux/pnp.h
> > @@ -379,7 +379,7 @@ struct pnp_id {
> >   };
> >   
> >   struct pnp_driver {
> > -	char *name;
> > +	const char *name;
> >   	const struct pnp_device_id *id_table;
> >   	unsigned int flags;
> >   	int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
> 
> Applied as 5.7 material along with the [2/2].
> 
> BTW, please CC PNP patches to linux-acpi in the future.
> 

Perhaps it is better to update MAINTAINERS ?
I will send a patch for it.

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

end of thread, other threads:[~2020-03-18  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  7:53 [PATCH 1/2] PNP: constify driver name Corentin Labbe
2020-03-06  7:53 ` [PATCH 2/2] rtc: cmos: remove useless cast for driver_name Corentin Labbe
2020-03-17 17:46 ` [PATCH 1/2] PNP: constify driver name Rafael J. Wysocki
2020-03-18  9:21   ` LABBE Corentin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).