All of lore.kernel.org
 help / color / mirror / Atom feed
* [arnd-playground:to-build 7/7] arch/arm/mm/dma-mapping.c:77:57: warning: Parameter 'virt' can be declared with const [constParameter]
@ 2022-04-28  1:59 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-04-28  1:59 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Christoph Hellwig <hch@lst.de>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git to-build
head:   78e0e09340fa7778055d35fc32d88a6b6d699c6a
commit: 78e0e09340fa7778055d35fc32d88a6b6d699c6a [7/7] ARM: use dma-direct unconditionally
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
compiler: arm-linux-gnueabi-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 78e0e09340fa7778055d35fc32d88a6b6d699c6a
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> arch/arm/mm/ioremap.c:72:46: warning: Parameter 'vaddr' can be declared with const [constParameter]
   struct static_vm *find_static_vm_vaddr(void *vaddr)
                                                ^
>> arch/arm/mm/ioremap.c:85:11: warning: Uninitialized variables: svm.vm, svm.list [uninitvar]
      return svm;
             ^
   arch/arm/mm/ioremap.c:81:16: note: Assuming condition is false
     if (vm->addr > vaddr)
                  ^
   arch/arm/mm/ioremap.c:81:16: note: Assuming condition is false
     if (vm->addr > vaddr)
                  ^
   arch/arm/mm/ioremap.c:85:11: note: Uninitialized variables: svm.vm, svm.list
      return svm;
             ^
--
>> arch/arm/mm/dma-mapping.c:77:57: warning: Parameter 'virt' can be declared with const [constParameter]
   static struct arm_dma_buffer *arm_dma_buffer_find(void *virt)
                                                           ^
>> arch/arm/mm/dma-mapping.c:84:12: warning: Uninitialized variable: buf->virt [uninitvar]
     if (buf->virt == virt) {
              ^

vim +/virt +77 arch/arm/mm/dma-mapping.c

19e6e5e5392bd64 Rabin Vincent 2016-03-03  76  
19e6e5e5392bd64 Rabin Vincent 2016-03-03 @77  static struct arm_dma_buffer *arm_dma_buffer_find(void *virt)
19e6e5e5392bd64 Rabin Vincent 2016-03-03  78  {
19e6e5e5392bd64 Rabin Vincent 2016-03-03  79  	struct arm_dma_buffer *buf, *found = NULL;
19e6e5e5392bd64 Rabin Vincent 2016-03-03  80  	unsigned long flags;
19e6e5e5392bd64 Rabin Vincent 2016-03-03  81  
19e6e5e5392bd64 Rabin Vincent 2016-03-03  82  	spin_lock_irqsave(&arm_dma_bufs_lock, flags);
19e6e5e5392bd64 Rabin Vincent 2016-03-03  83  	list_for_each_entry(buf, &arm_dma_bufs, list) {
19e6e5e5392bd64 Rabin Vincent 2016-03-03 @84  		if (buf->virt == virt) {
19e6e5e5392bd64 Rabin Vincent 2016-03-03  85  			list_del(&buf->list);
19e6e5e5392bd64 Rabin Vincent 2016-03-03  86  			found = buf;
19e6e5e5392bd64 Rabin Vincent 2016-03-03  87  			break;
19e6e5e5392bd64 Rabin Vincent 2016-03-03  88  		}
19e6e5e5392bd64 Rabin Vincent 2016-03-03  89  	}
19e6e5e5392bd64 Rabin Vincent 2016-03-03  90  	spin_unlock_irqrestore(&arm_dma_bufs_lock, flags);
19e6e5e5392bd64 Rabin Vincent 2016-03-03  91  	return found;
19e6e5e5392bd64 Rabin Vincent 2016-03-03  92  }
19e6e5e5392bd64 Rabin Vincent 2016-03-03  93  

:::::: The code at line 77 was first introduced by commit
:::::: 19e6e5e5392bd646c93d9e2c7b2b58c8558cb041 ARM: 8547/1: dma-mapping: store buffer information

:::::: TO: Rabin Vincent <rabin@rab.in>
:::::: CC: Russell King <rmk+kernel@arm.linux.org.uk>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-28  1:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28  1:59 [arnd-playground:to-build 7/7] arch/arm/mm/dma-mapping.c:77:57: warning: Parameter 'virt' can be declared with const [constParameter] kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.