diff mbox

net/7990: Make lance_private.name const

Message ID 1384283649-10482-1-git-send-email-geert@linux-m68k.org
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Geert Uytterhoeven Nov. 12, 2013, 7:14 p.m. UTC
This allows to drop a few casts.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 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(-)

Comments

David Miller Nov. 12, 2013, 9:12 p.m. UTC | #1
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Wed, 13 Nov 2013 01:04:17 +0300

>> @@ -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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Nov. 12, 2013, 10:04 p.m. UTC | #2
Hello.

On 11/12/2013 10:14 PM, Geert Uytterhoeven wrote:

> This allows to drop a few casts.

> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>   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(-)

> diff --git a/drivers/net/ethernet/amd/7990.h b/drivers/net/ethernet/amd/7990.h
> index 0a5837b96421..60c60926afda 100644
> --- a/drivers/net/ethernet/amd/7990.h
> +++ b/drivers/net/ethernet/amd/7990.h
> @@ -100,7 +100,7 @@ struct lance_init_block {
>    */
>   struct lance_private
>   {
> -        char *name;
> +        const char *name;

    Indent with tab, not spaces, please.

> diff --git a/drivers/net/ethernet/amd/hplance.c b/drivers/net/ethernet/amd/hplance.c
> index 0c61fd50d882..a9046cf3a564 100644
> --- a/drivers/net/ethernet/amd/hplance.c
> +++ b/drivers/net/ethernet/amd/hplance.c
> @@ -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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Nov. 12, 2013, 10:44 p.m. UTC | #3
On Wed, Nov 13, 2013 at 12:40 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 11/13/2013 12:12 AM, David Miller wrote:
>
>>>> @@ -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.

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

> 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 -- geert@linux-m68k.org

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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 12, 2013, 11:15 p.m. UTC | #4
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Wed, 13 Nov 2013 02:40:38 +0300

> On 11/13/2013 12:12 AM, David Miller wrote:
> 
>>>> @@ -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.

Good point, Geert please respin this, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 12, 2013, 11:16 p.m. UTC | #5
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Tue, 12 Nov 2013 23:44:06 +0100

> On Wed, Nov 13, 2013 at 12:40 AM, Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
>> On 11/13/2013 12:12 AM, David Miller wrote:
>>
>>>>> @@ -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.
> 
> That would be a separate patch. Care to create and send it?
> 
>> 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Nov. 12, 2013, 11:40 p.m. UTC | #6
On 11/13/2013 12:12 AM, David Miller wrote:

>>> @@ -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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Nov. 13, 2013, 12:04 a.m. UTC | #7
On 11/13/2013 01:44 AM, Geert Uytterhoeven wrote:

>>>>> @@ -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.

> 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.

>> 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? :-)

> Gr{oetje,eeting}s,

>                          Geert

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Nov. 13, 2013, 8:54 a.m. UTC | #8
On Wed, Nov 13, 2013 at 12:16 AM, David Miller <davem@davemloft.net> wrote:
>>> 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 -- geert@linux-m68k.org

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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 13, 2013, 8:13 p.m. UTC | #9
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 13 Nov 2013 09:54:18 +0100

> On Wed, Nov 13, 2013 at 12:16 AM, David Miller <davem@davemloft.net> wrote:
>>>> 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Nov. 14, 2013, 8:37 a.m. UTC | #10
Hi David,

On Wed, Nov 13, 2013 at 9:13 PM, David Miller <davem@davemloft.net> wrote:
>> On Wed, Nov 13, 2013 at 12:16 AM, David Miller <davem@davemloft.net> wrote:
>>>>> 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.

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.

> 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 -- geert@linux-m68k.org

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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 14, 2013, 9:11 a.m. UTC | #11
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Thu, 14 Nov 2013 09:37:32 +0100

> 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/amd/7990.h b/drivers/net/ethernet/amd/7990.h
index 0a5837b96421..60c60926afda 100644
--- a/drivers/net/ethernet/amd/7990.h
+++ b/drivers/net/ethernet/amd/7990.h
@@ -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 */
diff --git a/drivers/net/ethernet/amd/hplance.c b/drivers/net/ethernet/amd/hplance.c
index 0c61fd50d882..a9046cf3a564 100644
--- a/drivers/net/ethernet/amd/hplance.c
+++ b/drivers/net/ethernet/amd/hplance.c
@@ -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 */
diff --git a/drivers/net/ethernet/amd/mvme147.c b/drivers/net/ethernet/amd/mvme147.c
index e108e911da05..b5d76b45176e 100644
--- a/drivers/net/ethernet/amd/mvme147.c
+++ b/drivers/net/ethernet/amd/mvme147.c
@@ -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 */