public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.5 patch] ULL postfixes for tg3.c
@ 2003-06-24 17:48 Adrian Bunk
  2003-06-24 20:12 ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2003-06-24 17:48 UTC (permalink / raw)
  To: David S. Miller, Jeff Garzik; +Cc: linux-net, linux-kernel, trivial

The patch below adds ULL postfixes to three constants in tg3.c .

There's no need to create an int constant and later cast it to u64.

The second case was also incorrect since the constant was too big for an 
int.

Please apply
Adrian

--- linux-2.5.73-not-full/drivers/net/tg3.c.old	2003-06-24 19:42:20.000000000 +0200
+++ linux-2.5.73-not-full/drivers/net/tg3.c	2003-06-24 19:43:47.000000000 +0200
@@ -6679,16 +6679,16 @@
 	}
 
 	/* Configure DMA attributes. */
-	if (!pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL)) {
+	if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
 		pci_using_dac = 1;
 		if (pci_set_consistent_dma_mask(pdev,
-						(u64) 0xffffffffffffffff)) {
+						0xffffffffffffffffULL)) {
 			printk(KERN_ERR PFX "Unable to obtain 64 bit DMA "
 			       "for consistent allocations\n");
 			goto err_out_free_res;
 		}
 	} else {
-		err = pci_set_dma_mask(pdev, (u64) 0xffffffff);
+		err = pci_set_dma_mask(pdev, 0xffffffffULL);
 		if (err) {
 			printk(KERN_ERR PFX "No usable DMA configuration, "
 			       "aborting.\n");

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

* RE: [2.5 patch] ULL postfixes for tg3.c
@ 2003-06-24 18:00 Eble, Dan
  2003-06-24 18:20 ` Adrian Bunk
  0 siblings, 1 reply; 6+ messages in thread
From: Eble, Dan @ 2003-06-24 18:00 UTC (permalink / raw)
  To: linux-net, linux-kernel

Q: Why not to use something even easier to read (and write), like "~0ULL" or
better yet "UINT64_MAX" (stdint.h)?

> -----Original Message-----
> From: Adrian Bunk [mailto:bunk@fs.tum.de] 
> Sent: Tuesday, June 24, 2003 1:48 PM
> To: David S. Miller; Jeff Garzik
> Cc: linux-net@vger.kernel.org; linux-kernel@vger.kernel.org; 
> trivial@rustcorp.com.au
> Subject: [2.5 patch] ULL postfixes for tg3.c
> 
> 
> The patch below adds ULL postfixes to three constants in tg3.c .
> 
> There's no need to create an int constant and later cast it to u64.
> 
> The second case was also incorrect since the constant was too 
> big for an 
> int.
> 
> Please apply
> Adrian
> 
> --- linux-2.5.73-not-full/drivers/net/tg3.c.old	
> 2003-06-24 19:42:20.000000000 +0200
> +++ linux-2.5.73-not-full/drivers/net/tg3.c	2003-06-24 
> 19:43:47.000000000 +0200
> @@ -6679,16 +6679,16 @@
>  	}
>  
>  	/* Configure DMA attributes. */
> -	if (!pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL)) {
> +	if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
>  		pci_using_dac = 1;
>  		if (pci_set_consistent_dma_mask(pdev,
> -						(u64) 
> 0xffffffffffffffff)) {
> +						
> 0xffffffffffffffffULL)) {
>  			printk(KERN_ERR PFX "Unable to obtain 
> 64 bit DMA "
>  			       "for consistent allocations\n");
>  			goto err_out_free_res;
>  		}
>  	} else {
> -		err = pci_set_dma_mask(pdev, (u64) 0xffffffff);
> +		err = pci_set_dma_mask(pdev, 0xffffffffULL);
>  		if (err) {
>  			printk(KERN_ERR PFX "No usable DMA 
> configuration, "
>  			       "aborting.\n");
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [2.5 patch] ULL postfixes for tg3.c
  2003-06-24 18:00 Eble, Dan
@ 2003-06-24 18:20 ` Adrian Bunk
  0 siblings, 0 replies; 6+ messages in thread
From: Adrian Bunk @ 2003-06-24 18:20 UTC (permalink / raw)
  To: Eble, Dan, Linus Torvalds; +Cc: linux-net, linux-kernel

On Tue, Jun 24, 2003 at 02:00:07PM -0400, Eble, Dan wrote:
> Q: Why not to use something even easier to read (and write), like "~0ULL" or
> better yet "UINT64_MAX" (stdint.h)?

A: This seems to be an excellent idea.

Linus, what's your opinion on adding constants like UINT64_MAX to 
kernel.h and use them where appropriate?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [2.5 patch] ULL postfixes for tg3.c
  2003-06-24 17:48 [2.5 patch] ULL postfixes for tg3.c Adrian Bunk
@ 2003-06-24 20:12 ` David S. Miller
  2003-06-24 20:32   ` Arjan van de Ven
  2003-06-24 20:34   ` Jeff Garzik
  0 siblings, 2 replies; 6+ messages in thread
From: David S. Miller @ 2003-06-24 20:12 UTC (permalink / raw)
  To: bunk; +Cc: jgarzik, linux-net, linux-kernel, trivial


I'll apply this, the INT64_MAX or whatever ideas are just
stupid.  We're saying what "bits" the device supports when
it does DMA, so we should pass in a "bit" mask.

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

* Re: [2.5 patch] ULL postfixes for tg3.c
  2003-06-24 20:12 ` David S. Miller
@ 2003-06-24 20:32   ` Arjan van de Ven
  2003-06-24 20:34   ` Jeff Garzik
  1 sibling, 0 replies; 6+ messages in thread
From: Arjan van de Ven @ 2003-06-24 20:32 UTC (permalink / raw)
  To: David S. Miller; +Cc: bunk, jgarzik, linux-net, linux-kernel, trivial

[-- Attachment #1: Type: text/plain, Size: 330 bytes --]

On Tue, 2003-06-24 at 22:12, David S. Miller wrote:
> I'll apply this, the INT64_MAX or whatever ideas are just
> stupid.  We're saying what "bits" the device supports when
> it does DMA, so we should pass in a "bit" mask.

however it might be a good idea to define a PCI_DMAMASK_64BIT (and 32
bit) with the right values ?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [2.5 patch] ULL postfixes for tg3.c
  2003-06-24 20:12 ` David S. Miller
  2003-06-24 20:32   ` Arjan van de Ven
@ 2003-06-24 20:34   ` Jeff Garzik
  1 sibling, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2003-06-24 20:34 UTC (permalink / raw)
  To: David S. Miller; +Cc: bunk, linux-net, linux-kernel, trivial

David S. Miller wrote:
> I'll apply this, the INT64_MAX or whatever ideas are just
> stupid.  We're saying what "bits" the device supports when
> it does DMA, so we should pass in a "bit" mask.


no need.  look what's in the pipe already.


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

end of thread, other threads:[~2003-06-24 20:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-24 17:48 [2.5 patch] ULL postfixes for tg3.c Adrian Bunk
2003-06-24 20:12 ` David S. Miller
2003-06-24 20:32   ` Arjan van de Ven
2003-06-24 20:34   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2003-06-24 18:00 Eble, Dan
2003-06-24 18:20 ` Adrian Bunk

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