From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [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
Date: Sat, 2 Mar 2024 10:03:49 +0800 [thread overview]
Message-ID: <202403020932.w14NIOOC-lkp@intel.com> (raw)
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
reply other threads:[~2024-03-02 2:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202403020932.w14NIOOC-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.