Re: [PATCH 2.4] gcc-3.4 more fixes

O.Sezer
2004-08-23T22:47:35Z

Jeff Garzik wrote:
> Marcelo Tosatti wrote:
>
>> On Mon, Aug 23, 2004 at 05:13:26PM +0300, O.Sezer wrote:
>>
>>> Marcelo Tosatti wrote:
>>>
>>>> On Mon, Aug 23, 2004 at 04:41:46PM +0300, O.Sezer wrote:
>>>>
>>>>
>>>>>>> Ozkan,
>>>>>>>
>>>>>>> This are just warning fixes right?
>>>>>>>
>>>>>>> I dont like this patches, that is, I'm not confident about them.
>>>>>>>
>>>>>>> Let the warnings be.
>>>>>>
>>>>>>
>>>>>> For gcc-3.4 they're warnings. For gcc-3.5 they'll cause compiler
>>>>>> failures (that's what mikpe says on cset-1.1490, too)
>>>>>
>>>>>
>>>>> As a side note, almost all of them are in 2.6 anyway (can't
>>>>> honestly remember which aren't)
>>>>
>>>>
>>>>
>>>> Have you nocited the deadly mistake you made I showed with the grep?
>>>>
>>>
>>> Oopss :/ Than 2.6 has the same deadly thing. I'm too trusting I
>>> guess.. The correct thing should be to change "if (!(PRIV(dev) ="
>>> into "if (!(dev->phy_data =", right?
>>
>>
>>
>> I think so yes. A network driver expert can confirm this for us.
>
>
>
> Not enough context is quoted for me to decipher what this refers to :(
>
> URL?
>
> Jeff

To fix the gcc-3.4 lvalue warnings in drivers/atm/idt77105.c, 2.6 does:
at line 267:
- if (!(PRIV(dev) = kmalloc(sizeof(struct ......
+ if (!(dev->dev_data = kmalloc(sizeof(struct ......
and at line 345:
- PRIV(dev) = NULL;
+ dev->dev_data = NULL;
(see 2.6 bk-repo, cset-1.1371.280.43)

But the define for PRIV is (2.6, line 44):
#define PRIV(dev) ((struct idt77105_priv *) dev->phy_data)

So it seems the correct change should be change those "PRIV(dev) ="
into "dev->phy_data =" not "dev->dev_data =".