All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix LIST_INSERT breakage
@ 2004-03-24  1:02 Phil Oester
  2004-03-28 18:40 ` Harald Welte
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Oester @ 2004-03-24  1:02 UTC (permalink / raw)
  To: netfilter-devel

In 2.4.25, this patch was included:

http://linux.bkbits.net:8080/linux-2.4/cset@3fcc5cc99cChx6Q0shnhIlekWT1-5Q?nav=index.html|ChangeSet@-4M

which has a questionable change in LIST_INSERT due to the disappearing
cmpfn.  But it appears this macro is unused anywhere in the tree, so perhaps
removing it is better than fixing it?

Phil Oester



--- include/linux/netfilter_ipv4/listhelp.h-orig        2004-03-23 19:57:00.696775216 -0500
+++ include/linux/netfilter_ipv4/listhelp.h     2004-03-23 20:01:09.603032216 -0500
@@ -89,17 +89,6 @@
        list_add(new, head);
 }
 
-/* Insert according to ordering function; insert before first true. */
-#define LIST_INSERT(head, new, cmpfn)                          \
-do {                                                           \
-       struct list_head *__i;                                  \
-       ASSERT_WRITE_LOCK(head);                                \
-       list_for_each(__i, (head))                              \
-               if ((new), (typeof (new))__i)                   \
-                       break;                                  \
-       list_add((struct list_head *)(new), __i->prev);         \
-} while(0)
-
 /* If the field after the list_head is a nul-terminated string, you
    can use these functions. */
 static inline int __list_cmp_name(const void *i, const char *name)

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

* Re: [PATCH] Fix LIST_INSERT breakage
  2004-03-24  1:02 [PATCH] Fix LIST_INSERT breakage Phil Oester
@ 2004-03-28 18:40 ` Harald Welte
  2004-03-28 23:36   ` Phil Oester
  0 siblings, 1 reply; 3+ messages in thread
From: Harald Welte @ 2004-03-28 18:40 UTC (permalink / raw)
  To: Phil Oester; +Cc: netfilter-devel, Jozsef Kadlecsik

[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

On Tue, Mar 23, 2004 at 05:02:30PM -0800, Phil Oester wrote:
> In 2.4.25, this patch was included:
> 
> http://linux.bkbits.net:8080/linux-2.4/cset@3fcc5cc99cChx6Q0shnhIlekWT1-5Q?nav=index.html|ChangeSet@-4M
> 
> which has a questionable change in LIST_INSERT due to the disappearing
> cmpfn.  

Could you be more specific about your objections against that changeset?

> But it appears this macro is unused anywhere in the tree, so perhaps
> removing it is better than fixing it?

mh, we also don't use it in patch-o-matic-ng.  So we could remove it,
true.

> Phil Oester

-- 
- Harald Welte <laforge@netfilter.org>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [PATCH] Fix LIST_INSERT breakage
  2004-03-28 18:40 ` Harald Welte
@ 2004-03-28 23:36   ` Phil Oester
  0 siblings, 0 replies; 3+ messages in thread
From: Phil Oester @ 2004-03-28 23:36 UTC (permalink / raw)
  To: Harald Welte, netfilter-devel, Jozsef Kadlecsik

LIST_INSERT takes a 'cmpfn' argument, and is used pre-change:

-	for (__i = (head)->next;				\
-	     !cmpfn((new), (typeof (new))__i) && __i != (head);	\
-	     __i = __i->next);					\

but not post-change:

+	list_for_each(__i, (head))				\
+		if ((new), (typeof (new))__i)			\  <---
+			break;					\

'if (cmpfn((new), ......' is probably what was intended?

But either way, it is unused and thus moot.

Phil

On Sun, Mar 28, 2004 at 08:40:54PM +0200, Harald Welte wrote:
> On Tue, Mar 23, 2004 at 05:02:30PM -0800, Phil Oester wrote:
> > In 2.4.25, this patch was included:
> > 
> > http://linux.bkbits.net:8080/linux-2.4/cset@3fcc5cc99cChx6Q0shnhIlekWT1-5Q?nav=index.html|ChangeSet@-4M
> > 
> > which has a questionable change in LIST_INSERT due to the disappearing
> > cmpfn.  
> 
> Could you be more specific about your objections against that changeset?

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

end of thread, other threads:[~2004-03-28 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-24  1:02 [PATCH] Fix LIST_INSERT breakage Phil Oester
2004-03-28 18:40 ` Harald Welte
2004-03-28 23:36   ` Phil Oester

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.