From: kernel test robot <lkp@intel.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>
Subject: [PATCH] swiotlb: fix alloc_cast.cocci warnings
Date: Sat, 26 Mar 2022 16:09:00 +0800 [thread overview]
Message-ID: <20220326080900.GA72334@bd57dd6d74fb> (raw)
In-Reply-To: <202203261644.zQlZ2Jw4-lkp@intel.com>
From: kernel test robot <lkp@intel.com>
kernel/dma/swiotlb.c:433:15-33: WARNING: casting value returned by memory allocation function to (struct io_tlb_area *) is useless.
Remove casting the values returned by memory allocation functions
like kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc.
Semantic patch information:
This makes an effort to find cases of casting of values returned by
kmalloc, kzalloc, kcalloc, kmem_cache_alloc, kmem_cache_zalloc,
kmem_cache_alloc_node, kmalloc_node and kzalloc_node and removes
the casting as it is not required. The result in the patch case may
need some reformatting.
Generated by: scripts/coccinelle/api/alloc/alloc_cast.cocci
Fixes: 4ab45cefa80f ("swiotlb: Split up single swiotlb lock")
CC: Andi Kleen <ak@linux.intel.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://github.com/intel/tdx.git guest-rebased
head: 4c095660b91dbdd18042456e395af0deeef93485
commit: 4ab45cefa80f97ba2bdc31226523c891832d1080 [65/83] swiotlb: Split up single swiotlb lock
:::::: branch date: 13 hours ago
:::::: commit date: 3 days ago
kernel/dma/swiotlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -430,7 +430,7 @@ swiotlb_late_init_with_tbl(char *tlb, un
return -ENOMEM;
}
- mem->areas = (struct io_tlb_area *)kcalloc(num_areas,
+ mem->areas = kcalloc(num_areas,
sizeof(struct io_tlb_area),
GFP_KERNEL);
if (!mem->areas) {
next prev parent reply other threads:[~2022-03-26 8:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-26 8:10 [intel-tdx:guest-rebased 65/83] kernel/dma/swiotlb.c:433:15-33: WARNING: casting value returned by memory allocation function to (struct io_tlb_area *) is useless kernel test robot
2022-03-26 8:09 ` kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-02-16 4:19 [intel-tdx:guest-rebased 115/133] " kernel test robot
2022-02-16 4:11 ` [PATCH] swiotlb: fix alloc_cast.cocci warnings kernel test robot
2022-02-16 4:11 ` kernel test robot
2021-11-20 8:33 [intel-tdx:guest 129/144] kernel/dma/swiotlb.c:389:15-33: WARNING: casting value returned by memory allocation function to (struct io_tlb_area *) is useless kernel test robot
2021-11-20 8:33 ` [PATCH] swiotlb: fix alloc_cast.cocci warnings kernel test robot
2021-11-20 8:33 ` kernel test robot
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=20220326080900.GA72334@bd57dd6d74fb \
--to=lkp@intel.com \
--cc=ak@linux.intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
/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.