lkml.org 
[lkml]   [2018]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] drivers/scsi/fnic/fnic_trace.c: Use vzalloc
From
Date
On Tue, 2018-11-13 at 16:53 +0100, Johannes Thumshirn wrote:
> On 13/11/2018 16:44, John Garry wrote:
> > On 13/11/2018 15:08, Sabyasachi Gupta wrote:
[...]
> > > - fnic_trace_buf_p = (unsigned long)vmalloc((trace_max_pages *
> > > PAGE_SIZE));
> > > + fnic_trace_buf_p = (unsigned long)vzalloc((trace_max_pages *
> > > + PAGE_SIZE));
> >
> > If you remove the extra brackets in vzalloc() argument then you may
> > not spill onto the next line.
>
> And remove the unnecessary cast. vzalloc() (just like vmalloc())
> returns a void*, so no reason to cast it.

This is incorrect advice: there's no need to cast it to other *pointer*
types, but if you cast it to a non-pointer type (which this is doing)
the compiler will complain if there is no explicit cast.

James

\
 
 \ /
  Last update: 2018-11-13 17:12    [W:0.097 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site