Skip to contentSkip to conversation

net/7990: Make lance_private.name const

PATCH In review Geert Uytterhoeven 3 participants 12 messages Nov 12, 2013 – Nov 14, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/7990: Make lance_private.name const

This allows to drop a few casts.

---
 drivers/net/ethernet/amd/7990.h    |    2 +-
 drivers/net/ethernet/amd/hplance.c |    2 +-
 drivers/net/ethernet/amd/mvme147.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/amd/7990.h +1 -1
index 0a5837b96421..60c60926afda 100644
@@ -100,7 +100,7 @@ struct lance_init_block {
  */
 struct lance_private
 {
-        char *name;
+        const char *name;
 	unsigned long base;
         volatile struct lance_init_block *init_block; /* CPU address of RAM */
         volatile struct lance_init_block *lance_init_block; /* LANCE address of RAM */
drivers/net/ethernet/amd/hplance.c +1 -1
index 0c61fd50d882..a9046cf3a564 100644
@@ -149,7 +149,7 @@ static void hplance_init(struct net_device *dev, struct dio_dev *d)
         }
 
         lp = netdev_priv(dev);
-        lp->lance.name = (char*)d->name;                /* discards const, shut up gcc */
+        lp->lance.name = d->name;
         lp->lance.base = va;
         lp->lance.init_block = (struct lance_init_block *)(va + HPLANCE_MEMOFF); /* CPU addr */
         lp->lance.lance_init_block = NULL;              /* LANCE addr of same RAM */
drivers/net/ethernet/amd/mvme147.c +1 -1
index e108e911da05..b5d76b45176e 100644
@@ -120,7 +120,7 @@ struct net_device * __init mvme147lance_probe(int unit)
 		return ERR_PTR(-ENOMEM);
 	}
 
-	lp->lance.name = (char*)name;                   /* discards const, shut up gcc */
+	lp->lance.name = name;
 	lp->lance.base = dev->base_addr;
 	lp->lance.init_block = (struct lance_init_block *)(lp->ram); /* CPU addr */
 	lp->lance.lance_init_block = (struct lance_init_block *)(lp->ram);                 /* LANCE addr of same RAM */
Signature · 1 line
1.7.9.5
#1 lore raw

Hello.

Quoted 14 lines · Geert Uytterhoeven

This allows to drop a few casts.

---
  drivers/net/ethernet/amd/7990.h    |    2 +-
  drivers/net/ethernet/amd/hplance.c |    2 +-
  drivers/net/ethernet/amd/mvme147.c |    2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/amd/7990.h +0 -0
index 0a5837b96421..60c60926afda 100644

drivers/net/ethernet/amd/7990.h struct lance_init_block { · line 103

Quoted 5 lines
drivers/net/ethernet/amd/7990.h +1 -1
@@ -100,7 +100,7 @@ struct lance_init_block {
   */
  struct lance_private
  {
-        char *name;
+        const char *name;

Indent with tab, not spaces, please.

drivers/net/ethernet/amd/hplance.c static void hplance_init(struct net_device *dev, struct dio_dev *d) · line 152

Quoted 10 lines
drivers/net/ethernet/amd/hplance.c +1 -1
index 0c61fd50d882..a9046cf3a564 100644
@@ -149,7 +149,7 @@ static void hplance_init(struct net_device *dev, struct dio_dev *d)
          }
 
          lp = netdev_priv(dev);
-        lp->lance.name = (char*)d->name;                /* discards const, shut up gcc */
+        lp->lance.name = d->name;

Same here.

WBR, Sergei

maintainer
#2 lore raw

From: Sergei Shtylyov <[email protected]>
Date: Wed, 13 Nov 2013 01:04:17 +0300

Quoted 8 lines

drivers/net/ethernet/amd/7990.h struct lance_init_block { · line 103

Quoted 6 lines
drivers/net/ethernet/amd/7990.h +1 -1
@@ -100,7 +100,7 @@ struct lance_init_block {
   */
  struct lance_private
  {
-        char *name;
+        const char *name;

Indent with tab, not spaces, please.

This whole file is %99 space indentation, you really can't blame Geert for this.

#3 lore raw
Quoted 11 lines · David Miller
Quoted 8 lines

drivers/net/ethernet/amd/7990.h struct lance_init_block { · line 103

Quoted 6 lines
drivers/net/ethernet/amd/7990.h +1 -1
@@ -100,7 +100,7 @@ struct lance_init_block {
    */
   struct lance_private
   {
-        char *name;
+        const char *name;

Indent with tab, not spaces, please.

This whole file is %99 space indentation, you really can't blame Geert for this.

It's never late to fix some. And remember about checkpatch.pl which was
hardly content with the patch.

WBR, Sergei

#4 lore raw
Quoted 13 lines · Sergei Shtylyov
Quoted 9 lines · David Miller
Quoted 9 lines

drivers/net/ethernet/amd/7990.h struct lance_init_block { · line 103

Quoted 6 lines
drivers/net/ethernet/amd/7990.h +1 -1
@@ -100,7 +100,7 @@ struct lance_init_block {
    */
   struct lance_private
   {
-        char *name;
+        const char *name;

Indent with tab, not spaces, please.

Quoted 5 lines
Quoted 2 lines

This whole file is %99 space indentation, you really can't blame Geert for this.

It's never late to fix some.

That would be a separate patch. Care to create and send it?

Quoted 1 line

And remember about checkpatch.pl which was hardly content with the patch.

Only because checkpatch looks at the _new_ lines, and doesn't compare the styles of the old and new lines.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw
Quoted 9 lines · Geert Uytterhoeven
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/net/ethernet/amd/7990.h struct lance_init_block { · line 103

Quoted 6 lines
drivers/net/ethernet/amd/7990.h +1 -1
@@ -100,7 +100,7 @@ struct lance_init_block {
     */
    struct lance_private
    {
-        char *name;
+        const char *name;

Indent with tab, not spaces, please.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

This whole file is %99 space indentation, you really can't blame Geert for this.

It's never late to fix some.

That would be a separate patch. Care to create and send it?

I wasn't telling you to fix all of them, just the ones you touched anyway.
I don't see why the separate patch is needed for that.

Quoted 4 lines
Quoted 1 line

And remember about checkpatch.pl which was hardly content with the patch.

Only because checkpatch looks at the _new_ lines, and doesn't compare the styles of the old and new lines.

Care to fix it? :-)

Quoted 3 lines

Gr{oetje,eeting}s,

Geert

WBR, Sergei

maintainer
#6 lore raw
In reply to Geert Uytterhoeven

From: Geert Uytterhoeven <[email protected]>
Date: Tue, 12 Nov 2013 23:44:06 +0100

Quoted 19 lines
Quoted 17 lines · Sergei Shtylyov
Quoted 13 lines · David Miller
Quoted 9 lines

drivers/net/ethernet/amd/7990.h struct lance_init_block { · line 103

Quoted 6 lines
drivers/net/ethernet/amd/7990.h +1 -1
@@ -100,7 +100,7 @@ struct lance_init_block {
    */
   struct lance_private
   {
-        char *name;
+        const char *name;

Indent with tab, not spaces, please.

This whole file is %99 space indentation, you really can't blame Geert for this.

Quoted 8 lines
Quoted 1 line

It's never late to fix some.

That would be a separate patch. Care to create and send it?

Quoted 1 line

And remember about checkpatch.pl which was hardly content with the patch.

Only because checkpatch looks at the _new_ lines, and doesn't compare the styles of the old and new lines.

You really should fix the line you are changing to use tabs, please respin with this in mind, thanks.

#7 lore raw
Quoted 7 lines · David Miller
Quoted 4 lines
Quoted 1 line

And remember about checkpatch.pl which was hardly content with the patch.

Only because checkpatch looks at the _new_ lines, and doesn't compare the styles of the old and new lines.

You really should fix the line you are changing to use tabs, please respin with this in mind, thanks.

As that would add more to the TAB/space mess^H^H^Hix, I prepended a patch to fix all whitespace errors.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

maintainer
#8 lore raw

From: Geert Uytterhoeven <[email protected]>
Date: Wed, 13 Nov 2013 09:54:18 +0100

Quoted 11 lines · David Miller
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

And remember about checkpatch.pl which was hardly content with the patch.

Only because checkpatch looks at the _new_ lines, and doesn't compare the styles of the old and new lines.

You really should fix the line you are changing to use tabs, please respin with this in mind, thanks.

As that would add more to the TAB/space mess^H^H^Hix, I prepended a patch to fix all whitespace errors.

I implicitly asked you not to do this, now things are more difficult and your original change will take longer to integrate.

Becuase now it isn't a patch set I can easily just apply quickly in the current merge window, and it's therefore a series you'll have to resubmit later when the merge window closes and the net-next tree opens up again.

Sorry.

#9 lore raw

Hi David,

Quoted 6 lines · David Miller
Quoted 6 lines · David Miller
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

And remember about checkpatch.pl which was hardly content with the patch.

Only because checkpatch looks at the _new_ lines, and doesn't compare the styles of the old and new lines.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

You really should fix the line you are changing to use tabs, please respin with this in mind, thanks.

As that would add more to the TAB/space mess^H^H^Hix, I prepended a patch to fix all whitespace errors.

I implicitly asked you not to do this, now things are more difficult and your original change will take longer to integrate.

Sorry, I didn't get that message. I was puzzled by your request to correct the whitespace of the lines I touched only, which causes them to stand out in a block of old non-compliant whitespace.

Quoted 4 lines

Becuase now it isn't a patch set I can easily just apply quickly in the current merge window, and it's therefore a series you'll have to resubmit later when the merge window closes and the net-next tree opens up again.

Nevermind, it's not urgent nor critical. I will resubmit for the next merge window.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

maintainer
#10 lore raw

From: Geert Uytterhoeven <[email protected]>
Date: Thu, 14 Nov 2013 09:37:32 +0100

Quoted 3 lines

Sorry, I didn't get that message. I was puzzled by your request to correct the whitespace of the lines I touched only, which causes them to stand out in a block of old non-compliant whitespace.

It's very hard to stand out in this source file, even in the first hunk of your patch the very next line already used proper TABs.

maintainer
#11 lore raw
In reply to Sergei Shtylyov

From: Sergei Shtylyov <[email protected]>
Date: Wed, 13 Nov 2013 02:40:38 +0300

Quoted 11 lines · David Miller
Quoted 9 lines
Quoted 9 lines

drivers/net/ethernet/amd/7990.h struct lance_init_block { · line 103

Quoted 7 lines
drivers/net/ethernet/amd/7990.h +1 -1
@@ -100,7 +100,7 @@ struct lance_init_block {
    */
   struct lance_private
   {
-        char *name;
+        const char *name;

Indent with tab, not spaces, please.

Quoted 5 lines
Quoted 2 lines

This whole file is %99 space indentation, you really can't blame Geert for this.

It's never late to fix some. And remember about checkpatch.pl which was hardly content with the patch.

Good point, Geert please respin this, thanks.