* kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) << (32)) - 1))) => (0-u32max <= u32max)'
@ 2020-08-25 5:45 kernel test robot
2020-08-25 7:04 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-08-25 5:45 UTC (permalink / raw)
To: Nicolas Saenz Julienne; +Cc: kbuild-all, linux-kernel, Christoph Hellwig
[-- Attachment #1: Type: text/plain, Size: 1860 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6a9dc5fd6170d0a41c8a14eb19e63d94bea5705a
commit: d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d dma-pool: Only allocate from CMA when in same memory zone
date: 11 days ago
config: arc-randconfig-m031-20200824 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
New smatch warnings:
kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) ?~0:((1 << (32)) - 1))) => (0-u32max <= u32max)'
Old smatch warnings:
arch/arc/include/asm/thread_info.h:65 current_thread_info() error: uninitialized symbol 'sp'.
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d
vim +79 kernel/dma/pool.c
59
60 static bool cma_in_zone(gfp_t gfp)
61 {
62 unsigned long size;
63 phys_addr_t end;
64 struct cma *cma;
65
66 cma = dev_get_cma_area(NULL);
67 if (!cma)
68 return false;
69
70 size = cma_get_size(cma);
71 if (!size)
72 return false;
73
74 /* CMA can't cross zone boundaries, see cma_activate_area() */
75 end = cma_get_base(cma) + size - 1;
76 if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA))
77 return end <= DMA_BIT_MASK(zone_dma_bits);
78 if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32))
> 79 return end <= DMA_BIT_MASK(32);
80 return true;
81 }
82
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28564 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) << (32)) - 1))) => (0-u32max <= u32max)'
2020-08-25 5:45 kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) << (32)) - 1))) => (0-u32max <= u32max)' kernel test robot
@ 2020-08-25 7:04 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2020-08-25 7:04 UTC (permalink / raw)
To: kernel test robot
Cc: Nicolas Saenz Julienne, kbuild-all, linux-kernel,
Christoph Hellwig
Looks like we might have to replace the IS_ENABLED with an ifdef to
cater for the 32-bit phys_addr_t and overzealous compilers.
On Tue, Aug 25, 2020 at 01:45:38PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 6a9dc5fd6170d0a41c8a14eb19e63d94bea5705a
> commit: d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d dma-pool: Only allocate from CMA when in same memory zone
> date: 11 days ago
> config: arc-randconfig-m031-20200824 (attached as .config)
> compiler: arc-elf-gcc (GCC) 9.3.0
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> New smatch warnings:
> kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) ?~0:((1 << (32)) - 1))) => (0-u32max <= u32max)'
>
> Old smatch warnings:
> arch/arc/include/asm/thread_info.h:65 current_thread_info() error: uninitialized symbol 'sp'.
>
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d
> vim +79 kernel/dma/pool.c
>
> 59
> 60 static bool cma_in_zone(gfp_t gfp)
> 61 {
> 62 unsigned long size;
> 63 phys_addr_t end;
> 64 struct cma *cma;
> 65
> 66 cma = dev_get_cma_area(NULL);
> 67 if (!cma)
> 68 return false;
> 69
> 70 size = cma_get_size(cma);
> 71 if (!size)
> 72 return false;
> 73
> 74 /* CMA can't cross zone boundaries, see cma_activate_area() */
> 75 end = cma_get_base(cma) + size - 1;
> 76 if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA))
> 77 return end <= DMA_BIT_MASK(zone_dma_bits);
> 78 if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32))
> > 79 return end <= DMA_BIT_MASK(32);
> 80 return true;
> 81 }
> 82
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
---end quoted text---
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-25 7:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-25 5:45 kernel/dma/pool.c:79 cma_in_zone() warn: always true condition '(end <= ((((32) == 64)) << (32)) - 1))) => (0-u32max <= u32max)' kernel test robot
2020-08-25 7:04 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox