public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net #6
@ 2001-05-30  0:44 Andrzej Krzysztofowicz
  2001-05-30  8:01 ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Andrzej Krzysztofowicz @ 2001-05-30  0:44 UTC (permalink / raw)
  To: Alan Cox, Jeff Garzik, Philip.Blundell; +Cc: kernel list


The following patch removes unnecessary #ifdefs from eexpress.c

Andrzej

************************** PATCH 6 *******************************
diff -uNr linux-2.4.5-ac4/drivers/net/eexpress.c linux/drivers/net/eexpress.c
--- linux-2.4.5-ac4/drivers/net/eexpress.c	Wed May 30 01:08:54 2001
+++ linux/drivers/net/eexpress.c	Wed May 30 01:13:49 2001
@@ -574,9 +574,7 @@
 static void eexp_timeout(struct net_device *dev)
 {
 	struct net_local *lp = (struct net_local *)dev->priv;
-#ifdef CONFIG_SMP
-	unsigned long flags;
-#endif
+	unsigned long __attribute__((unused)) flags;
 	int status;
 	
 	disable_irq(dev->irq);
@@ -586,10 +584,7 @@
 	 *	lets make it work first..
 	 */
 	 
-#ifdef CONFIG_SMP
 	spin_lock_irqsave(&lp->lock, flags);
-#endif
-
 	status = scb_status(dev);
 	unstick_cu(dev);
 	printk(KERN_INFO "%s: transmit timed out, %s?\n", dev->name,
@@ -602,9 +597,7 @@
 		outb(0,dev->base_addr+SIGNAL_CA);
 	}
 	netif_wake_queue(dev);	
-#ifdef CONFIG_SMP
 	spin_unlock_irqrestore(&lp->lock, flags);
-#endif
 }
 
 /*
@@ -614,9 +607,7 @@
 static int eexp_xmit(struct sk_buff *buf, struct net_device *dev)
 {
 	struct net_local *lp = (struct net_local *)dev->priv;
-#ifdef CONFIG_SMP
-	unsigned long flags;
-#endif
+	unsigned long __attribute__((unused)) flags;
 
 #if NET_DEBUG > 6
 	printk(KERN_DEBUG "%s: eexp_xmit()\n", dev->name);
@@ -629,10 +620,7 @@
 	 *	lets make it work first..
 	 */
 	 
-#ifdef CONFIG_SMP
 	spin_lock_irqsave(&lp->lock, flags);
-#endif
-  
 	{
 		unsigned short length = (ETH_ZLEN < buf->len) ? buf->len :
 			ETH_ZLEN;
@@ -643,9 +631,7 @@
 	        eexp_hw_tx_pio(dev,data,length);
 	}
 	dev_kfree_skb(buf);
-#ifdef CONFIG_SMP
 	spin_unlock_irqrestore(&lp->lock, flags);
-#endif
 	enable_irq(dev->irq);
 	return 0;
 }


-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Technical University of Gdansk

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

* Re: [PATCH] net #6
  2001-05-30  0:44 [PATCH] net #6 Andrzej Krzysztofowicz
@ 2001-05-30  8:01 ` Alan Cox
  2001-05-30 10:35   ` Andrzej Krzysztofowicz
  2001-05-30 22:24   ` Pavel Machek
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Cox @ 2001-05-30  8:01 UTC (permalink / raw)
  To: Andrzej Krzysztofowicz
  Cc: Alan Cox, Jeff Garzik, Philip.Blundell, kernel list

> The following patch removes unnecessary #ifdefs from eexpress.c

They are neccessary

> @@ -643,9 +631,7 @@
>  	        eexp_hw_tx_pio(dev,data,length);
>  	}
>  	dev_kfree_skb(buf);
> -#ifdef CONFIG_SMP
>  	spin_unlock_irqrestore(&lp->lock, flags);
> -#endif
>  	enable_irq(dev->irq);
>  	return 0;

They are done this way to get good non SMP performance. Your changes would
ruin that.


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

* Re: [PATCH] net #6
  2001-05-30  8:01 ` Alan Cox
@ 2001-05-30 10:35   ` Andrzej Krzysztofowicz
  2001-05-30 22:24   ` Pavel Machek
  1 sibling, 0 replies; 5+ messages in thread
From: Andrzej Krzysztofowicz @ 2001-05-30 10:35 UTC (permalink / raw)
  To: Alan Cox; +Cc: Alan Cox, Jeff Garzik, Philip.Blundell, kernel list

> 
> > The following patch removes unnecessary #ifdefs from eexpress.c
> 
> They are neccessary

Yes, you are right.
I was suggested by improper part of spinlock.h ...

Forget this patch.
 
> > @@ -643,9 +631,7 @@
> >  	        eexp_hw_tx_pio(dev,data,length);
> >  	}
> >  	dev_kfree_skb(buf);
> > -#ifdef CONFIG_SMP
> >  	spin_unlock_irqrestore(&lp->lock, flags);
> > -#endif
> >  	enable_irq(dev->irq);
> >  	return 0;
> 
> They are done this way to get good non SMP performance. Your changes would
> ruin that.

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  tel.  (0-58) 347 14 61
Wydz.Fizyki Technicznej i Matematyki Stosowanej Politechniki Gdanskiej

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

* Re: [PATCH] net #6
  2001-05-30  8:01 ` Alan Cox
  2001-05-30 10:35   ` Andrzej Krzysztofowicz
@ 2001-05-30 22:24   ` Pavel Machek
  2001-05-31 21:35     ` Alan Cox
  1 sibling, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2001-05-30 22:24 UTC (permalink / raw)
  To: Alan Cox, Andrzej Krzysztofowicz
  Cc: Jeff Garzik, Philip.Blundell, kernel list

Hi!

> They are neccessary
> 
> > @@ -643,9 +631,7 @@
> >  	        eexp_hw_tx_pio(dev,data,length);
> >  	}
> >  	dev_kfree_skb(buf);
> > -#ifdef CONFIG_SMP
> >  	spin_unlock_irqrestore(&lp->lock, flags);
> > -#endif
> >  	enable_irq(dev->irq);
> >  	return 0;
> 
> They are done this way to get good non SMP performance. Your changes would
> ruin that.

Maybe macro "spin_lock_irqsave_on_smp()" would be good idea? These
ifdefs look ugly. Maybe local to driver, maybe even global.
								Pavel
-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

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

* Re: [PATCH] net #6
  2001-05-30 22:24   ` Pavel Machek
@ 2001-05-31 21:35     ` Alan Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2001-05-31 21:35 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Alan Cox, Andrzej Krzysztofowicz, Jeff Garzik, Philip.Blundell,
	kernel list

> > They are done this way to get good non SMP performance. Your changes would
> > ruin that.
> 
> Maybe macro "spin_lock_irqsave_on_smp()" would be good idea? These
> ifdefs look ugly. Maybe local to driver, maybe even global.

I had that argument with Linus about globally and ended up with ifdefs. 
I agree about locally - feel free


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

end of thread, other threads:[~2001-05-31 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-30  0:44 [PATCH] net #6 Andrzej Krzysztofowicz
2001-05-30  8:01 ` Alan Cox
2001-05-30 10:35   ` Andrzej Krzysztofowicz
2001-05-30 22:24   ` Pavel Machek
2001-05-31 21:35     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox