public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.4.10-ac11 parport_pc.c bugfix
@ 2001-10-11  2:20 Thomas Hood
  2001-10-11 13:40 ` J . A . Magallon
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Hood @ 2001-10-11  2:20 UTC (permalink / raw)
  To: linux-kernel

This fix makes the parport driver print the correct dma number
and makes explicit a couple of type casts.  Applies cleanly against
-ac11         // Thomas Hood

The patch:
--- linux-2.4.10-ac10/drivers/parport/parport_pc.c	Mon Oct  8 22:41:14 2001
+++ linux-2.4.10-ac10-fix/drivers/parport/parport_pc.c	Tue Oct  9 19:36:58 2001
@@ -2826,7 +2826,7 @@
 	if ( UNSET(dev->irq_resource[0]) ) {
 		irq = PARPORT_IRQ_NONE;
 	} else {
-		if ( dev->irq_resource[0].start == -1 ) {
+		if ( dev->irq_resource[0].start == (unsigned long)-1 ) {
 			irq = PARPORT_IRQ_NONE;
 			printk(", irq disabled");
 		} else {
@@ -2838,12 +2838,12 @@
 	if ( UNSET(dev->dma_resource[0]) ) {
 		dma = PARPORT_DMA_NONE;
 	} else {
-		if ( dev->dma_resource[0].start == -1 ) {
+		if ( dev->dma_resource[0].start == (unsigned long)-1 ) {
 			dma = PARPORT_DMA_NONE;
 			printk(", dma disabled");
 		} else {
 			dma = dev->dma_resource[0].start;
-			printk(", dma %d",irq);
+			printk(", dma %d",dma);
 		}
 	}
 


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [PATCH] 2.4.10-ac11 parport_pc.c bugfix
@ 2001-10-11 18:35 J.D. Hood
  0 siblings, 0 replies; 7+ messages in thread
From: J.D. Hood @ 2001-10-11 18:35 UTC (permalink / raw)
  To: linux-kernel

The fact that (unsigned long)-1 and ~0U have different 
values on different arches isn't a problem.

What would be a problem is if (unsigned long)-1 were liable
to be given different values by different compilers, and
especially if (unsigned long)-1 were liable to be cast to
some number between 0 and 15.  But I assume that the type
casting rules of C prohibit this---that (unsigned long)-1
is assured to be some very large positive integer.  (Indeed,
the largest.)  However I'm uncertain enough about this
assumption that I raise the present question about it.

Assuming that the assumption is correct [:)], the patch is fine
as it is and should go in.

BTW what problem is it you are having with PnP BIOS on your arch?
Can you refer me to a past thread title?

--
Thomas

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

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

end of thread, other threads:[~2001-10-12  1:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-11  2:20 [PATCH] 2.4.10-ac11 parport_pc.c bugfix Thomas Hood
2001-10-11 13:40 ` J . A . Magallon
2001-10-11 13:52   ` Thomas Hood
2001-10-11 14:52     ` Bob McElrath
2001-10-11 22:41     ` bill davidsen
2001-10-12  1:45       ` Thomas Hood
  -- strict thread matches above, loose matches on Subject: below --
2001-10-11 18:35 J.D. Hood

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