From: Namhyung Kim <namhyung@gmail.com>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 3c59x: fix build failure on !CONFIG_PCI
Date: Wed, 17 Nov 2010 11:22:12 +0900 [thread overview]
Message-ID: <1289960532.1663.24.camel@leonhard> (raw)
In-Reply-To: <20101116091408.abd36ec8.randy.dunlap@oracle.com>
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. :)
Thanks.
--
Regards,
Namhyung Kim
next prev parent reply other threads:[~2010-11-17 2:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-16 15:27 [PATCH] 3c59x: fix build failure on !CONFIG_PCI Namhyung Kim
2010-11-16 17:14 ` Randy Dunlap
2010-11-17 2:22 ` Namhyung Kim [this message]
2010-11-17 15:58 ` Randy Dunlap
2010-11-18 18:48 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1289960532.1663.24.camel@leonhard \
--to=namhyung@gmail.com \
--cc=klassert@mathematik.tu-chemnitz.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).