of: Drop superfluous ULL suffix for ~0
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 2 Nov 2020 10:54:22 +0000 (11:54 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 2 Nov 2020 17:32:46 +0000 (09:32 -0800)
There is no need to specify a "ULL" suffix for "all bits set": "~0" is
sufficient, and works regardless of type.  In fact adding the suffix
makes the code more fragile.

Fixes: 48ab6d5d1f09 ("dma-mapping: fix 32-bit overflow with CONFIG_ARM_LPAE=n")
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/of/device.c

index 3a469c79e6b05de483f9340b6bf24ce6d1f8ddc2..aedfaaafd3e7edb73a4468cba26cf2c177ea1164 100644 (file)
@@ -112,7 +112,7 @@ int of_dma_configure_id(struct device *dev, struct device_node *np,
                u64 dma_end = 0;
 
                /* Determine the overall bounds of all DMA regions */
-               for (dma_start = ~0ULL; r->size; r++) {
+               for (dma_start = ~0; r->size; r++) {
                        /* Take lower and upper limits */
                        if (r->dma_start < dma_start)
                                dma_start = r->dma_start;