All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP
@ 2011-06-27 17:49 Jon Mason
  2011-06-27 18:54 ` wwguy
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jon Mason @ 2011-06-27 17:49 UTC (permalink / raw)
  To: Wey-Yi Guy; +Cc: Intel Linux Wireless, linux-wireless

The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
---
 drivers/net/wireless/iwlwifi/iwl-pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 7328fbf..60d9140 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -93,7 +93,7 @@ static u16 iwl_pciexp_link_ctrl(struct iwl_bus *bus)
 	u16 pci_lnk_ctl;
 	struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
 
-	pos = pci_find_capability(pci_dev, PCI_CAP_ID_EXP);
+	pos = pci_pcie_cap(priv->pci_dev);
 	pci_read_config_word(pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl);
 	return pci_lnk_ctl;
 }
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP
  2011-06-27 17:49 [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
@ 2011-06-27 18:54 ` wwguy
  2011-06-29 19:02 ` John W. Linville
  2011-06-30 15:42 ` [PATCH 18/19 v2] " Jon Mason
  2 siblings, 0 replies; 6+ messages in thread
From: wwguy @ 2011-06-27 18:54 UTC (permalink / raw)
  To: Jon Mason; +Cc: Intel Linux Wireless, linux-wireless

On Mon, 2011-06-27 at 10:49 -0700, Jon Mason wrote:
> The PCIE capability offset is saved during PCI bus walking.  It will
> remove an unnecessary search in the PCI configuration space if this
> value is referenced instead of reacquiring it.
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP
  2011-06-27 17:49 [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
  2011-06-27 18:54 ` wwguy
@ 2011-06-29 19:02 ` John W. Linville
  2011-06-30 14:40   ` Jon Mason
  2011-06-30 15:42 ` [PATCH 18/19 v2] " Jon Mason
  2 siblings, 1 reply; 6+ messages in thread
From: John W. Linville @ 2011-06-29 19:02 UTC (permalink / raw)
  To: Jon Mason; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Mon, Jun 27, 2011 at 12:49:29PM -0500, Jon Mason wrote:
> The PCIE capability offset is saved during PCI bus walking.  It will
> remove an unnecessary search in the PCI configuration space if this
> value is referenced instead of reacquiring it.
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> ---
>  drivers/net/wireless/iwlwifi/iwl-pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
> index 7328fbf..60d9140 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-pci.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
> @@ -93,7 +93,7 @@ static u16 iwl_pciexp_link_ctrl(struct iwl_bus *bus)
>  	u16 pci_lnk_ctl;
>  	struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
>  
> -	pos = pci_find_capability(pci_dev, PCI_CAP_ID_EXP);
> +	pos = pci_pcie_cap(priv->pci_dev);
>  	pci_read_config_word(pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl);
>  	return pci_lnk_ctl;
>  }
> -- 
> 1.7.5.4

  CC [M]  drivers/net/wireless/iwlwifi/iwl-pci.o
drivers/net/wireless/iwlwifi/iwl-pci.c: In function ‘iwl_pciexp_link_ctrl’:
drivers/net/wireless/iwlwifi/iwl-pci.c:96:21: error: ‘priv’ undeclared (first use in this function)
drivers/net/wireless/iwlwifi/iwl-pci.c:96:21: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [drivers/net/wireless/iwlwifi/iwl-pci.o] Error 1
make[1]: *** [drivers/net/wireless/iwlwifi] Error 2
make: *** [drivers/net/wireless/] Error 2

Please do make sure to compile patches before sending them to the list.

JOhn
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP
  2011-06-29 19:02 ` John W. Linville
@ 2011-06-30 14:40   ` Jon Mason
  0 siblings, 0 replies; 6+ messages in thread
From: Jon Mason @ 2011-06-30 14:40 UTC (permalink / raw)
  To: John W. Linville; +Cc: Wey-Yi Guy, Intel Linux Wireless, linux-wireless

On Wed, Jun 29, 2011 at 2:02 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Mon, Jun 27, 2011 at 12:49:29PM -0500, Jon Mason wrote:
>> The PCIE capability offset is saved during PCI bus walking.  It will
>> remove an unnecessary search in the PCI configuration space if this
>> value is referenced instead of reacquiring it.
>>
>> Signed-off-by: Jon Mason <jdmason@kudzu.us>
>> ---
>>  drivers/net/wireless/iwlwifi/iwl-pci.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
>> index 7328fbf..60d9140 100644
>> --- a/drivers/net/wireless/iwlwifi/iwl-pci.c
>> +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
>> @@ -93,7 +93,7 @@ static u16 iwl_pciexp_link_ctrl(struct iwl_bus *bus)
>>       u16 pci_lnk_ctl;
>>       struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
>>
>> -     pos = pci_find_capability(pci_dev, PCI_CAP_ID_EXP);
>> +     pos = pci_pcie_cap(priv->pci_dev);
>>       pci_read_config_word(pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl);
>>       return pci_lnk_ctl;
>>  }
>> --
>> 1.7.5.4
>
>  CC [M]  drivers/net/wireless/iwlwifi/iwl-pci.o
> drivers/net/wireless/iwlwifi/iwl-pci.c: In function ‘iwl_pciexp_link_ctrl’:
> drivers/net/wireless/iwlwifi/iwl-pci.c:96:21: error: ‘priv’ undeclared (first use in this function)
> drivers/net/wireless/iwlwifi/iwl-pci.c:96:21: note: each undeclared identifier is reported only once for each function it appears in
> make[2]: *** [drivers/net/wireless/iwlwifi/iwl-pci.o] Error 1
> make[1]: *** [drivers/net/wireless/iwlwifi] Error 2
> make: *** [drivers/net/wireless/] Error 2
>
> Please do make sure to compile patches before sending them to the list.

My apologies.  The underlying code changed between when I did the
original version and when it was time to submit.  Still, its no excuse
for not at least compiling it.

The fix is an easy one.

-       pos = pci_pcie_cap(priv->pci_dev);
+       pos = pci_pcie_cap(pci_dev);

I'll resubmit the whole thing with the proper fix.

Thanks,
Jon

>
> JOhn
> --
> John W. Linville                Someday the world will need a hero, and you
> linville@tuxdriver.com                  might be all we have.  Be ready.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 18/19 v2] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP
  2011-06-27 17:49 [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
  2011-06-27 18:54 ` wwguy
  2011-06-29 19:02 ` John W. Linville
@ 2011-06-30 15:42 ` Jon Mason
  2011-06-30 15:56   ` wwguy
  2 siblings, 1 reply; 6+ messages in thread
From: Jon Mason @ 2011-06-30 15:42 UTC (permalink / raw)
  To: Wey-Yi Guy; +Cc: Intel Linux Wireless, linux-wireless

The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
---
 drivers/net/wireless/iwlwifi/iwl-pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 7328fbf..068b9ae 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -93,7 +93,7 @@ static u16 iwl_pciexp_link_ctrl(struct iwl_bus *bus)
 	u16 pci_lnk_ctl;
 	struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
 
-	pos = pci_find_capability(pci_dev, PCI_CAP_ID_EXP);
+	pos = pci_pcie_cap(pci_dev);
 	pci_read_config_word(pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl);
 	return pci_lnk_ctl;
 }
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 18/19 v2] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP
  2011-06-30 15:42 ` [PATCH 18/19 v2] " Jon Mason
@ 2011-06-30 15:56   ` wwguy
  0 siblings, 0 replies; 6+ messages in thread
From: wwguy @ 2011-06-30 15:56 UTC (permalink / raw)
  To: Jon Mason; +Cc: Intel Linux Wireless, linux-wireless

On Thu, 2011-06-30 at 08:42 -0700, Jon Mason wrote:
> The PCIE capability offset is saved during PCI bus walking.  It will
> remove an unnecessary search in the PCI configuration space if this
> value is referenced instead of reacquiring it.
> 
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
compile and work for me now

Wey


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-30 16:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27 17:49 [PATCH 18/19] iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP Jon Mason
2011-06-27 18:54 ` wwguy
2011-06-29 19:02 ` John W. Linville
2011-06-30 14:40   ` Jon Mason
2011-06-30 15:42 ` [PATCH 18/19 v2] " Jon Mason
2011-06-30 15:56   ` wwguy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.