On Thu, 4 Apr 2024 18:38:39 -0400 Kent Overstreet <kent.overstreet@xxxxxxxxx> wrote: > On Thu, Apr 04, 2024 at 11:33:22PM +0100, Matthew Wilcox wrote: > > 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. > > Except you can't. We've been over this; using that approach for tracing > is one thing, using it for actual accounting isn't workable. I missed that. There have been many emails. Please remind us of the reasoning here.