linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] compat: drop const to fix compiler warnings
@ 2012-09-07  7:56 Felix Fietkau
  2012-09-07  9:04 ` Luis R. Rodriguez
  2012-09-11 23:36 ` Luis R. Rodriguez
  0 siblings, 2 replies; 5+ messages in thread
From: Felix Fietkau @ 2012-09-07  7:56 UTC (permalink / raw)
  To: linux-wireless; +Cc: mcgrof

When calling pci_find_capability and pci_read_config_word, struct pci_dev
needs to be passed without const.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 compat/compat-3.7.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/compat/compat-3.7.c b/compat/compat-3.7.c
index b37b73a..f591f16 100644
--- a/compat/compat-3.7.c
+++ b/compat/compat-3.7.c
@@ -29,7 +29,7 @@ EXPORT_SYMBOL_GPL(mod_delayed_work);
  * pci_dev but if we found it we likely would remove it from
  * the kernel anyway right? Bite me.
  */
-static inline u16 pcie_flags_reg(const struct pci_dev *dev)
+static inline u16 pcie_flags_reg(struct pci_dev *dev)
 {
 	int pos;
 	u16 reg16;
@@ -43,12 +43,12 @@ static inline u16 pcie_flags_reg(const struct pci_dev *dev)
 	return reg16;
 }
 
-static inline int pci_pcie_type(const struct pci_dev *dev)
+static inline int pci_pcie_type(struct pci_dev *dev)
 {
 	return (pcie_flags_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4;
 }
 
-static inline int pcie_cap_version(const struct pci_dev *dev)
+static inline int pcie_cap_version(struct pci_dev *dev)
 {
 	return pcie_flags_reg(dev) & PCI_EXP_FLAGS_VERS;
 }
@@ -58,7 +58,7 @@ static inline bool pcie_cap_has_devctl(const struct pci_dev *dev)
 	return true;
 }
 
-static inline bool pcie_cap_has_lnkctl(const struct pci_dev *dev)
+static inline bool pcie_cap_has_lnkctl(struct pci_dev *dev)
 {
 	int type = pci_pcie_type(dev);
 
@@ -68,7 +68,7 @@ static inline bool pcie_cap_has_lnkctl(const struct pci_dev *dev)
 	       type == PCI_EXP_TYPE_LEG_END;
 }
 
-static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
+static inline bool pcie_cap_has_sltctl(struct pci_dev *dev)
 {
 	int type = pci_pcie_type(dev);
 
@@ -78,7 +78,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
 		pcie_flags_reg(dev) & PCI_EXP_FLAGS_SLOT);
 }
 
-static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
+static inline bool pcie_cap_has_rtctl(struct pci_dev *dev)
 {
 	int type = pci_pcie_type(dev);
 
-- 
1.7.9.6 (Apple Git-31.1)


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

* Re: [PATCH] compat: drop const to fix compiler warnings
  2012-09-07  7:56 [PATCH] compat: drop const to fix compiler warnings Felix Fietkau
@ 2012-09-07  9:04 ` Luis R. Rodriguez
  2012-09-07  9:12   ` Felix Fietkau
  2012-09-07 12:59   ` Andy Gospodarek
  2012-09-11 23:36 ` Luis R. Rodriguez
  1 sibling, 2 replies; 5+ messages in thread
From: Luis R. Rodriguez @ 2012-09-07  9:04 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, backports

On Fri, Sep 7, 2012 at 12:56 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> When calling pci_find_capability and pci_read_config_word, struct pci_dev
> needs to be passed without const.

Thanks! I guess because at certain kernel version pci_dev was const ?

  Luis

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

* Re: [PATCH] compat: drop const to fix compiler warnings
  2012-09-07  9:04 ` Luis R. Rodriguez
@ 2012-09-07  9:12   ` Felix Fietkau
  2012-09-07 12:59   ` Andy Gospodarek
  1 sibling, 0 replies; 5+ messages in thread
From: Felix Fietkau @ 2012-09-07  9:12 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, backports

On 2012-09-07 11:04 AM, Luis R. Rodriguez wrote:
> On Fri, Sep 7, 2012 at 12:56 AM, Felix Fietkau <nbd@openwrt.org> wrote:
>> When calling pci_find_capability and pci_read_config_word, struct pci_dev
>> needs to be passed without const.
> 
> Thanks! I guess because at certain kernel version pci_dev was const ?
Probably, I didn't really check. Either way, this patch should be safe
for all kernel versions.

- Felix


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

* Re: [PATCH] compat: drop const to fix compiler warnings
  2012-09-07  9:04 ` Luis R. Rodriguez
  2012-09-07  9:12   ` Felix Fietkau
@ 2012-09-07 12:59   ` Andy Gospodarek
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Gospodarek @ 2012-09-07 12:59 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Felix Fietkau, linux-wireless, backports

On Fri, Sep 07, 2012 at 02:04:37AM -0700, Luis R. Rodriguez wrote:
> On Fri, Sep 7, 2012 at 12:56 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> > When calling pci_find_capability and pci_read_config_word, struct pci_dev
> > needs to be passed without const.
> 
> Thanks! I guess because at certain kernel version pci_dev was const ?
> 

Similar issues exist with ethtool_ops, but it's not a huge deal, imo.

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

* Re: [PATCH] compat: drop const to fix compiler warnings
  2012-09-07  7:56 [PATCH] compat: drop const to fix compiler warnings Felix Fietkau
  2012-09-07  9:04 ` Luis R. Rodriguez
@ 2012-09-11 23:36 ` Luis R. Rodriguez
  1 sibling, 0 replies; 5+ messages in thread
From: Luis R. Rodriguez @ 2012-09-11 23:36 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless

On Fri, Sep 7, 2012 at 12:56 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> When calling pci_find_capability and pci_read_config_word, struct pci_dev
> needs to be passed without const.
>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>

Applied and pushed, thanks!

  Luis

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

end of thread, other threads:[~2012-09-11 23:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07  7:56 [PATCH] compat: drop const to fix compiler warnings Felix Fietkau
2012-09-07  9:04 ` Luis R. Rodriguez
2012-09-07  9:12   ` Felix Fietkau
2012-09-07 12:59   ` Andy Gospodarek
2012-09-11 23:36 ` Luis R. Rodriguez

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