linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] compat: remove stray #endif from compat-2.6.23.c
@ 2011-08-03  5:03 Pavel Roskin
  2011-08-03  5:03 ` [PATCH 2/3] compat: fix iteration over destination multicast addresses Pavel Roskin
  2011-08-03  5:03 ` [PATCH 3/3] compat: don't define genl_register_mc_group() for Linux 2.6.22 and older Pavel Roskin
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Roskin @ 2011-08-03  5:03 UTC (permalink / raw)
  To: Luis R. Rodriguez, linux-wireless

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 compat/compat-2.6.23.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/compat/compat-2.6.23.c b/compat/compat-2.6.23.c
index 67d0075..d31cfb4 100644
--- a/compat/compat-2.6.23.c
+++ b/compat/compat-2.6.23.c
@@ -235,5 +235,4 @@ int pci_try_set_mwi(struct pci_dev *dev)
 	return rc;
 }
 EXPORT_SYMBOL(pci_try_set_mwi);
-#endif
 

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

* [PATCH 2/3] compat: fix iteration over destination multicast addresses
  2011-08-03  5:03 [PATCH 1/3] compat: remove stray #endif from compat-2.6.23.c Pavel Roskin
@ 2011-08-03  5:03 ` Pavel Roskin
  2011-08-03  5:03 ` [PATCH 3/3] compat: don't define genl_register_mc_group() for Linux 2.6.22 and older Pavel Roskin
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Roskin @ 2011-08-03  5:03 UTC (permalink / raw)
  To: Luis R. Rodriguez, linux-wireless

Fix dev_mc_sync() and dev_mc_unsync() in compat-2.6.23.c.  When looking
for synchronized addresses, put "break" inside the above "if" to break
the loop only if there is a match.  Otherwise, advance da_to to the next
address.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 compat/compat-2.6.23.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/compat/compat-2.6.23.c b/compat/compat-2.6.23.c
index d31cfb4..365f941 100644
--- a/compat/compat-2.6.23.c
+++ b/compat/compat-2.6.23.c
@@ -104,9 +104,11 @@ int dev_mc_sync(struct net_device *to, struct net_device *from)
 		/* 2.6.22 does not have da->da_synced so lets take the long route */
 		while (da_to != NULL) {
 			if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 &&
-				da->da_addrlen == da_to->da_addrlen)
+			    da->da_addrlen == da_to->da_addrlen) {
 				synced = 1;
 				break;
+			}
+			da_to = da_to->next;
 		}
 		if (!synced) {
 			err = __dev_addr_add(&to->mc_list, &to->mc_count,
@@ -160,9 +162,11 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from)
 		/* 2.6.22 does not have da->da_synced so lets take the long route */
 		while (da_to != NULL) {
 			if (memcmp(da_to->da_addr, da->da_addr, da_to->da_addrlen) == 0 &&
-				da->da_addrlen == da_to->da_addrlen)
+			    da->da_addrlen == da_to->da_addrlen) {
 				synced = true;
 				break;
+			}
+			da_to = da_to->next;
 		}
 		if (!synced) {
 			da = next;

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

* [PATCH 3/3] compat: don't define genl_register_mc_group() for Linux 2.6.22 and older
  2011-08-03  5:03 [PATCH 1/3] compat: remove stray #endif from compat-2.6.23.c Pavel Roskin
  2011-08-03  5:03 ` [PATCH 2/3] compat: fix iteration over destination multicast addresses Pavel Roskin
@ 2011-08-03  5:03 ` Pavel Roskin
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Roskin @ 2011-08-03  5:03 UTC (permalink / raw)
  To: Luis R. Rodriguez, linux-wireless

compat-2.6.23.h has a different definition of genl_register_mc_group().
Likewise, don't define genl_unregister_mc_group() for old kernels.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 include/linux/compat-2.6.37.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h
index d375746..78b0b38 100644
--- a/include/linux/compat-2.6.37.h
+++ b/include/linux/compat-2.6.37.h
@@ -91,8 +91,11 @@ int genl_unregister_family(struct genl_family *family);
 
 #define genlmsg_reply(_msg, _info) genlmsg_reply(_msg, (_info)->info)
 #define genlmsg_put(_skb, _pid, _seq, _fam, _flags, _cmd) genlmsg_put(_skb, _pid, _seq, &(_fam)->family, _flags, _cmd)
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
 #define genl_register_mc_group(_fam, _grp) genl_register_mc_group(&(_fam)->family, _grp)
 #define genl_unregister_mc_group(_fam, _grp) genl_unregister_mc_group(&(_fam)->family, _grp)
+#endif
 
 
 extern void led_blink_set(struct led_classdev *led_cdev,

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

end of thread, other threads:[~2011-08-03  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-03  5:03 [PATCH 1/3] compat: remove stray #endif from compat-2.6.23.c Pavel Roskin
2011-08-03  5:03 ` [PATCH 2/3] compat: fix iteration over destination multicast addresses Pavel Roskin
2011-08-03  5:03 ` [PATCH 3/3] compat: don't define genl_register_mc_group() for Linux 2.6.22 and older Pavel Roskin

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