[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20101118.104800.70193768.davem@davemloft.net>
Date: Thu, 18 Nov 2010 10:48:00 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: randy.dunlap@...cle.com
Cc: namhyung@...il.com, klassert@...hematik.tu-chemnitz.de,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] 3c59x: fix build failure on !CONFIG_PCI
From: Randy Dunlap <randy.dunlap@...cle.com>
Date: Wed, 17 Nov 2010 07:58:36 -0800
> On 11/16/10 18:22, Namhyung Kim wrote:
>> 2010-11-16 (ȭ), 09:14 -0800, Randy Dunlap:
>>> Hi,
>>>
>>
>> Hi, Randy
>>
>>
>>> Interesting patch. I have reported this build error and looked
>>> into fixing it, but did not come up with this solution.
>>>
>>> Looking at it more: if CONFIG_PCI is not enabled, DEVICE_PCI() is NULL.
>>> That makes VORTEX_PCI() (with or without your patch) have a value of NULL.
>>>
>>> Is the line with the reported syntax error (3211) executed in
>>> function acpi_set_WOL() ? If so, let's assume that vp->enable_wol is true.
>>> Then what happens on line 3211 (or 3213 after your patch)?
>>>
>>> if (VORTEX_PCI(vp)->current_state < PCI_D3hot)
>>> return;
>>>
>>> or if I am really confuzed this morning, please tell me how it works.
>>>
>>
>> At first glance, I've noticed that the code above could make a NULL
>> dereference so I added NULL check prior to the line.
>>
>> But after reading more code I realized that other pci-functions called
>> in acpi_set_WOL() would not work with NULL pci_dev pointer also. And I
>> found all callers of the acpi_set_WOL() already checked NULL pointer
>> before the call. Finally I could remove the NULL check and leave the
>> code as is. That's how it works. :)
>
> I see. and concur. Thanks for the explanation.
Looks good to me too, applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists