[Prism54-devel] [Bug 49] New: compilation failure: wrongly placed DEFINE_WAIT/DECLARE_WAITQUEUE macros

bugzilla-daemon@mcgrof.com bugzilla-daemon@mcgrof.com
Thu, 29 Jan 2004 08:25:20 +0000 (UTC)


http://prism54.org/cgi-bin/bugzilla/show_bug.cgi?id=49

           Summary: compilation failure: wrongly placed
                    DEFINE_WAIT/DECLARE_WAITQUEUE macros
           Product: prim54
           Version: 1.0.2.2
          Platform: all
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Device Driver
        AssignedTo: prism54-devel@prism54.org
        ReportedBy: fedorov@inp.nsk.su


Merge mgmt_rework branch introduced compilation failure:
DEFINE_WAIT/DECLARE_WAITQUEUE macros are variable declaration
and must not be placed after executable code in function.
Patch applied:

diff -11rubp prism.cvs/prism54-ng/ksrc/islpci_mgt.c
prism.new/prism54-ng/ksrc/islpci_mgt.c
--- prism.cvs/prism54-ng/ksrc/islpci_mgt.c	Thu Jan 29 04:07:09 2004
+++ prism.new/prism54-ng/ksrc/islpci_mgt.c	Thu Jan 29 13:01:07 2004
@@ -458,30 +458,34 @@ islpci_mgt_cleanup_transmit(struct net_d
 int
 islpci_mgt_transaction(struct net_device *ndev,
 		       int operation, unsigned long oid,
 		       void *senddata, int sendlen,
 		       struct islpci_mgmtframe **recvframe)
 {
 	islpci_private *priv = ndev->priv;
 	const long wait_cycle_jiffies = (ISL38XX_WAIT_CYCLE * 10 * HZ) / 1000;
 	long timeout_left = ISL38XX_MAX_WAIT_CYCLES * wait_cycle_jiffies;
 	int err;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	DEFINE_WAIT(wait);
+#else
+	DECLARE_WAITQUEUE(wait, current);
+#endif
+
 	if (down_interruptible(&priv->mgmt_sem))
 		return -ERESTARTSYS;
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	DEFINE_WAIT(wait);
 	prepare_to_wait(&priv->reset_done, &wait, TASK_UNINTERRUPTIBLE);
 #else
-	DECLARE_WAITQUEUE(wait, current);
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	add_wait_queue(&priv->mgmt_wqueue, &wait);
 #endif
 	err = islpci_mgt_transmit(ndev, operation, oid, senddata, sendlen);
 	if(err)
 		goto out;
 
 	err = -ETIMEDOUT;
 	while (timeout_left > 0) {
 		int timeleft;
 		struct islpci_mgmtframe *frame;



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.