Re: [PATCH for-next 4/7] RDMA/bnxt_re: Refactor net ring allocation function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 27, 2020 at 07:44:43PM +0530, Devesh Sharma wrote:
> > > I will have to duplicate it again to report the precise warning but
> > > based on my memory, sparse or smatch was shouting about "pointer
> > > converted to integer without cast"
> > > I guess that was because rattr.dma_arr is a pointer and static
> > > initialization was assigning value 0 while it should had been NULL. If
> > > you insist I would send you exact warning msg and tool-version-number
> > > soon.
> >
> > Yes, please, because NULL is 0 and has special meaning in C standard.
> This is what sparse warns about:
> make C=2 CHECK="/data2/upstream/tools/sparse/sparse"
> CF="-D__CHECK_ENDIAN__" drivers/infiniband/hw/bnxt_re/
>   CHECK   drivers/infiniband/hw/bnxt_re/main.c
> drivers/infiniband/hw/bnxt_re/main.c:1010:43: warning: Using plain
> integer as NULL pointer

Yes, this is entirely expected, you should not use the {0} pattern, it
is not reliable. '= {}' is preferred.

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux