lkml.org 
[lkml]   [2024]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] mm: change inlined allocation helpers to account at the call site
On Thu, Apr 04, 2024 at 03:17:43PM -0700, Suren Baghdasaryan wrote:
> Ironically, checkpatch generates warnings for these type casts:
>
> WARNING: unnecessary cast may hide bugs, see
> http://c-faq.com/malloc/mallocnocast.html
> #425: FILE: include/linux/dma-fence-chain.h:90:
> + ((struct dma_fence_chain *)kmalloc(sizeof(struct dma_fence_chain),
> GFP_KERNEL))
>
> I guess I can safely ignore them in this case (since we cast to the
> expected type)?

I find ignoring checkpatch to be a solid move 99% of the time.

I really don't like the codetags. This is so much churn, and it could
all be avoided by just passing in _RET_IP_ or _THIS_IP_ depending on
whether we wanted to profile this function or its caller. vmalloc
has done it this way since 2008 (OK, using __builtin_return_address())
and lockdep has used _THIS_IP_ / _RET_IP_ since 2006.

\
 
 \ /
  Last update: 2024-05-27 16:24    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog