* [jfern:rcu/dev 26/27] kernel/rcu/tree.c:3183:9-13: WARNING: casting value returned by memory allocation function to (void *) is useless.
@ 2020-04-08 6:00 kbuild test robot
2020-04-08 6:00 ` [PATCH] fix alloc_cast.cocci warnings kbuild test robot
0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2020-04-08 6:00 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 841 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git rcu/dev
head: 59c8c6df67765ffa1726cacb3cdb3021233566a7
commit: 8260ad7c243a4a9dfbdbb5ddb48a481a711de1fa [26/27] [RFC] Refactor object allocation and try harder even for array allocation
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
coccinelle warnings: (new ones prefixed by >>)
>> kernel/rcu/tree.c:3183:9-13: WARNING: casting value returned by memory allocation function to (void *) is useless.
kernel/rcu/tree.c:3196:9-13: WARNING: casting value returned by memory allocation function to (void *) is useless.
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] fix alloc_cast.cocci warnings
2020-04-08 6:00 [jfern:rcu/dev 26/27] kernel/rcu/tree.c:3183:9-13: WARNING: casting value returned by memory allocation function to (void *) is useless kbuild test robot
@ 2020-04-08 6:00 ` kbuild test robot
0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2020-04-08 6:00 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2173 bytes --]
From: kbuild test robot <lkp@intel.com>
kernel/rcu/tree.c:3183:9-13: WARNING: casting value returned by memory allocation function to (void *) is useless.
kernel/rcu/tree.c:3196:9-13: WARNING: casting value returned by memory allocation function to (void *) 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: 8260ad7c243a ("[RFC] Refactor object allocation and try harder even for array allocation")
CC: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: kbuild test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git rcu/dev
head: 59c8c6df67765ffa1726cacb3cdb3021233566a7
commit: 8260ad7c243a4a9dfbdbb5ddb48a481a711de1fa [26/27] [RFC] Refactor object allocation and try harder even for array allocation
tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3180,7 +3180,7 @@ static inline void *alloc_object_locked(
* First, do an allocation without waiting.
*/
ptr = (size == PAGE_SIZE) ? (void *)__get_free_page(gfp_flags | GFP_NOWAIT)
- : (void *)kmalloc(size, gfp_flags | GFP_NOWAIT);
+ : kmalloc(size, gfp_flags | GFP_NOWAIT);
/* If we cannot sleep, we are done */
if (ptr || !can_sleep)
return ptr;
@@ -3193,7 +3193,7 @@ static inline void *alloc_object_locked(
*/
krc_this_cpu_unlock(krcp, NULL);
ptr = (size == PAGE_SIZE) ? (void *)__get_free_page(gfp_flags | GFP_KERNEL)
- : (void *)kmalloc(size, gfp_flags | GFP_KERNEL);
+ : kmalloc(size, gfp_flags | GFP_KERNEL);
/* Take it back. We may have got migrated here */
*krcpp = krc_this_cpu_lock(NULL);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-08 6:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08 6:00 [jfern:rcu/dev 26/27] kernel/rcu/tree.c:3183:9-13: WARNING: casting value returned by memory allocation function to (void *) is useless kbuild test robot
2020-04-08 6:00 ` [PATCH] fix alloc_cast.cocci warnings kbuild 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.