[ofw] patch: [mlx4] Add minor function (is_power_of_2) and fixcompilation issues on C++.

Tzachi Dar tzachid at mellanox.co.il
Wed May 21 08:13:00 PDT 2008


The main reason for this changes is to allow including this files from
C++.
 
Since new is a keyword in C++ things simply don't compile.
 
As for the option to remove this lists all together:
In an ideal world you are probably right. Given the limited time that we
had, we have found that using the 
Linux code without changes saves us a lot of time.
 
Thanks
Tzachi


________________________________

	From: Sean Hefty [mailto:sean.hefty at intel.com] 
	Sent: Wednesday, May 21, 2008 6:09 PM
	To: Tzachi Dar; ofw at lists.openfabrics.org
	Subject: RE: [ofw] patch: [mlx4] Add minor function
(is_power_of_2) and fixcompilation issues on C++.
	
	

	Index: mlx4/kernel/inc/l2w_list.h
	
===================================================================
	--- mlx4/kernel/inc/l2w_list.h (revision 1197)
	+++ mlx4/kernel/inc/l2w_list.h (working copy)
	@@ -38,14 +38,14 @@
	 * This is only for internal list manipulation where we know
	 * the prev/next entries already!
	 */
	-static inline void __list_add(struct list_head *new,
	+static inline void __list_add(struct list_head *new1,
	                              struct list_head *prev,
	                              struct list_head *next)
	 {
	-       next->prev = new;
	-       new->next = next;
	-       new->prev = prev;
	-       prev->next = new;
	+       next->prev = new1;
	+       new1->next = next;
	+       new1->prev = prev;
	+       prev->next = new1;
	 }
	 
	 /**
	@@ -56,9 +56,9 @@
	 * Insert a new entry after the specified head.
	 * This is good for implementing stacks.
	 */
	-static inline void list_add(struct list_head *new, struct
list_head *head)
	+static inline void list_add(struct list_head *new1, struct
list_head *head)
	 {
	-       __list_add(new, head, head->next);
	+       __list_add(new1, head, head->next);
	 }
	 
	 /**
	@@ -69,9 +69,9 @@
	 * Insert a new entry before the specified head.
	 * This is useful for implementing queues.
	 */
	-static inline void list_add_tail(struct list_head *new, struct
list_head *head)
	+static inline void list_add_tail(struct list_head *new1, struct
list_head *head)
	 {
	-       __list_add(new, head->prev, head);
	+       __list_add(new1, head->prev, head);
	 }
	
	

	I don't understand the need for these changes.  Also, Windows
provides list management functions that we should use, rather than
porting the calls from Linux.

	 

	- Sean

	 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080521/f1affed5/attachment.html>


More information about the ofw mailing list