lkml.org 
[lkml]   [2000]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectPatch: linux-2.3.47pre6 has conflicting definitions of QUEUE_EMPTY
	In linux-2.3.46 and linux-2.3.47pre6, QUEUE_EMPTY is
defined in conflicting ways in <linux/blk.h> and <linux/lists.h>.
In <linux/blk.h>, the declaration is bracketed in "#ifndef QUEUE_EMPTY...
#endif", so the conflict is only reported when a driver attempts
to use one version of QUEUE_EMPTY and gets another, which occurs
in drivers/block/nbd.c if I attempt to configure everything as a module.

The QUEUE_EMPTY macro is <linux/lists.h> is currently only
used in drivers/char/h8.c. So, here is a patch that solves the
problem by renaming the macro to QUEUE_IS_EMPTY.

Warning: because of other major changes going on in
2.3.47pre6, I have not been able to get it to compile yet, although
I think this patch should be correct. (You've been warned.)

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
-----------------------CUT HERE--------------------------------------

--- linux-2.3.47pre6/include/linux/lists.h Mon Mar 30 00:21:41 1998
+++ linux/include/linux/lists.h Sun Feb 20 12:59:27 2000
@@ -48,7 +48,7 @@

#define QUEUE_FIRST(head, listnam) (head)->DLIST_NEXT(listnam)
#define QUEUE_LAST(head, listnam) (head)->DLIST_PREV(listnam)
-#define QUEUE_EMPTY(head, listnam) \
+#define QUEUE_IS_EMPTY(head, listnam) \
((QUEUE_FIRST(head, listnam) == QUEUE_LAST(head, listnam)) && \
((u_long)QUEUE_FIRST(head, listnam) == (u_long)head))

--- linux-2.3.47pre6/drivers/char/h8.c Tue Jan 25 14:13:47 2000
+++ linux/drivers/char/h8.c Sun Feb 20 12:59:53 2000
@@ -260,7 +260,7 @@
return;
} else if (data_reg == H8_SYNC_BYTE) {
h8_state = H8_IDLE;
- if (!QUEUE_EMPTY(&h8_actq, link))
+ if (!QUEUE_IS_EMPTY(&h8_actq, link))
h8_send_next_cmd_byte();
} else {
Dprintk ("h8_intr: resync unknown data 0x%x \n", data_reg);
@@ -279,7 +279,7 @@
QUEUE_REMOVE(&h8_actq, qp, link);
h8_cmd_done (qp);
/* More commands to send over? */
- if (!QUEUE_EMPTY(&h8_cmdq, link))
+ if (!QUEUE_IS_EMPTY(&h8_cmdq, link))
h8_start_new_cmd();
}
return;
@@ -458,7 +458,7 @@

/* get cmd buf */
save_flags(flags); cli();
- while (QUEUE_EMPTY(&h8_freeq, link)) {
+ while (QUEUE_IS_EMPTY(&h8_freeq, link)) {
Dprintk("H8: need to allocate more cmd buffers\n");
restore_flags(flags);
h8_alloc_queues();
@@ -500,13 +500,13 @@
return;
}

- if (!QUEUE_EMPTY(&h8_actq, link)) {
+ if (!QUEUE_IS_EMPTY(&h8_actq, link)) {
Dprintk("h8_start_new_cmd: inconsistency: IDLE with non-empty active queue!\n");
restore_flags(flags);
return;
}

- if (QUEUE_EMPTY(&h8_cmdq, link)) {
+ if (QUEUE_IS_EMPTY(&h8_cmdq, link)) {
Dprintk("h8_start_new_cmd: no command to dequeue\n");
restore_flags(flags);
return;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.053 / U:11.504 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site