* [linux-next:master 11037/11394] drivers/usb/dwc2/hcd.c:2418 dwc2_alloc_split_dma_aligned_buf() warn: Please consider using kmem_cache_zalloc instead of kmem_cache_alloc
@ 2024-03-02 2:03 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-03-02 2:03 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Suren Baghdasaryan <surenb@google.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: Kees Cook <keescook@chromium.org>
CC: Pasha Tatashin <pasha.tatashin@soleen.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 1870cdc0e8dee32e3c221704a2977898ba4c10e8
commit: d9886d99439ab03c75e2a736e6bc37d45e3af95f [11037/11394] mm: enumerate all gfp flags
:::::: branch date: 20 hours ago
:::::: commit date: 30 hours ago
config: i386-randconfig-141-20240301 (https://download.01.org/0day-ci/archive/20240302/202403020932.w14NIOOC-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202403020932.w14NIOOC-lkp@intel.com/
smatch warnings:
drivers/usb/dwc2/hcd.c:2418 dwc2_alloc_split_dma_aligned_buf() warn: Please consider using kmem_cache_zalloc instead of kmem_cache_alloc
drivers/mtd/devices/mchp48l640.c:175 mchp48l640_write_page() warn: Please consider using kzalloc instead of kmalloc
drivers/mtd/devices/mchp48l640.c:243 mchp48l640_read_page() warn: Please consider using kzalloc instead of kmalloc
vim +2418 drivers/usb/dwc2/hcd.c
3bc04e28a030a8b Douglas Anderson 2016-01-28 2408
af424a410749ed7 William Wu 2018-05-11 2409 static int dwc2_alloc_split_dma_aligned_buf(struct dwc2_hsotg *hsotg,
af424a410749ed7 William Wu 2018-05-11 2410 struct dwc2_qh *qh,
af424a410749ed7 William Wu 2018-05-11 2411 struct dwc2_host_chan *chan)
af424a410749ed7 William Wu 2018-05-11 2412 {
af424a410749ed7 William Wu 2018-05-11 2413 if (!hsotg->unaligned_cache ||
af424a410749ed7 William Wu 2018-05-11 2414 chan->max_packet > DWC2_KMEM_UNALIGNED_BUF_SIZE)
af424a410749ed7 William Wu 2018-05-11 2415 return -ENOMEM;
af424a410749ed7 William Wu 2018-05-11 2416
af424a410749ed7 William Wu 2018-05-11 2417 if (!qh->dw_align_buf) {
af424a410749ed7 William Wu 2018-05-11 @2418 qh->dw_align_buf = kmem_cache_alloc(hsotg->unaligned_cache,
af424a410749ed7 William Wu 2018-05-11 2419 GFP_ATOMIC | GFP_DMA);
af424a410749ed7 William Wu 2018-05-11 2420 if (!qh->dw_align_buf)
af424a410749ed7 William Wu 2018-05-11 2421 return -ENOMEM;
af424a410749ed7 William Wu 2018-05-11 2422 }
af424a410749ed7 William Wu 2018-05-11 2423
af424a410749ed7 William Wu 2018-05-11 2424 qh->dw_align_buf_dma = dma_map_single(hsotg->dev, qh->dw_align_buf,
af424a410749ed7 William Wu 2018-05-11 2425 DWC2_KMEM_UNALIGNED_BUF_SIZE,
af424a410749ed7 William Wu 2018-05-11 2426 DMA_FROM_DEVICE);
af424a410749ed7 William Wu 2018-05-11 2427
af424a410749ed7 William Wu 2018-05-11 2428 if (dma_mapping_error(hsotg->dev, qh->dw_align_buf_dma)) {
af424a410749ed7 William Wu 2018-05-11 2429 dev_err(hsotg->dev, "can't map align_buf\n");
af424a410749ed7 William Wu 2018-05-11 2430 chan->align_buf = 0;
af424a410749ed7 William Wu 2018-05-11 2431 return -EINVAL;
af424a410749ed7 William Wu 2018-05-11 2432 }
af424a410749ed7 William Wu 2018-05-11 2433
af424a410749ed7 William Wu 2018-05-11 2434 chan->align_buf = qh->dw_align_buf_dma;
af424a410749ed7 William Wu 2018-05-11 2435 return 0;
af424a410749ed7 William Wu 2018-05-11 2436 }
af424a410749ed7 William Wu 2018-05-11 2437
:::::: The code at line 2418 was first introduced by commit
:::::: af424a410749ed7e0c2bffd3cedbc7c274d0ff6f usb: dwc2: alloc dma aligned buffer for isoc split in
:::::: TO: William Wu <william.wu@rock-chips.com>
:::::: CC: Felipe Balbi <felipe.balbi@linux.intel.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-02 2:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-02 2:03 [linux-next:master 11037/11394] drivers/usb/dwc2/hcd.c:2418 dwc2_alloc_split_dma_aligned_buf() warn: Please consider using kmem_cache_zalloc instead of kmem_cache_alloc 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.