From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer
Date: Wed, 7 Dec 2016 10:21:10 +0200 [thread overview]
Message-ID: <20161207082110.GA11857@mtr-leonro.local> (raw)
In-Reply-To: <a8d3dbb7-aafa-c5af-5d06-78d1f4914c5d-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]
On Tue, Dec 06, 2016 at 08:29:56AM -0800, Bart Van Assche wrote:
> On 12/06/2016 05:59 AM, Leon Romanovsky wrote:
> > On Mon, Dec 05, 2016 at 05:18:08PM -0800, Bart Van Assche wrote:
> > > Detected by sparse.
> > >
> > > Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> > > Cc: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > > ---
> > > drivers/infiniband/hw/mlx5/main.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > > index 32b09f059c84..abd200e3e299 100644
> > > --- a/drivers/infiniband/hw/mlx5/main.c
> > > +++ b/drivers/infiniband/hw/mlx5/main.c
> > > @@ -127,7 +127,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
> > >
> > > if ((upper == ndev || (!upper && ndev == ibdev->roce.netdev))
> > > && ibdev->ib_active) {
> > > - struct ib_event ibev = {0};
> > > + struct ib_event ibev = { NULL };
> >
> > I afraid that it is sparse anomality and because NULL==0, the ibev.event
> > will be initialized to zero, but it is a matter of time when the sparse
> > will complain about wrong initialization again.
>
> Hello Leon,
>
> The first member of struct ib_event is a pointer so I think the sparse
> complaint is correct.
Yes, sparse didn't iterate all fields of this struct. This is why I
called it "sparse anomality".
> Anyway, how about one of the following two
> alternatives:
> * Change {0} into { }.
Yes, please.
Thanks
> * Use memset() instead of an initializer.
>
> Bart.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2016-12-07 8:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 1:17 [PATCH 0/5] mlx5 patches for kernel v4.10 Bart Van Assche
[not found] ` <9ff07804-492c-c67a-e729-b31e0f863027-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 1:18 ` [PATCH 1/5] mlx5: Use NULL instead of 0 to represent a pointer Bart Van Assche
[not found] ` <16dc2a07-86f7-ce47-7b0c-1da03e58d99f-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 13:59 ` Leon Romanovsky
[not found] ` <20161206135917.GC2437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-06 16:28 ` Jason Gunthorpe
2016-12-06 16:29 ` Bart Van Assche
[not found] ` <a8d3dbb7-aafa-c5af-5d06-78d1f4914c5d-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-07 8:21 ` Leon Romanovsky [this message]
[not found] ` <20161207082110.GA11857-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-14 18:44 ` Doug Ledford
2016-12-06 1:18 ` [PATCH 2/5] mlx5: Remove a set-but-not-used variable Bart Van Assche
[not found] ` <f1351e2c-915d-9883-838b-d3c50f27da17-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 14:24 ` Leon Romanovsky
[not found] ` <20161206142441.GA3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-14 18:45 ` Doug Ledford
2016-12-06 1:19 ` [PATCH 3/5] mlx5: Avoid that sparse complains about dubious !x & y expressions Bart Van Assche
[not found] ` <572c702f-589f-2d5a-9e13-45223191db85-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-08 9:26 ` Or Gerlitz
[not found] ` <CAJ3xEMjPZYgLhDi_6Jxkx_dg_RaehD=3SchMt_noLzQEChPrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-08 17:52 ` Bart Van Assche
2016-12-08 17:53 ` Jason Gunthorpe
[not found] ` <20161208175322.GB11025-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-12-14 18:46 ` Doug Ledford
2016-12-06 1:19 ` [PATCH 4/5] mlx5: Fix mlx5_srq_attr.pas endianness annotation Bart Van Assche
[not found] ` <3d4f5ffa-e9bf-cd28-d200-74c5dd3d68ce-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 13:55 ` Leon Romanovsky
2016-12-06 1:19 ` [PATCH 5/5] mlx5, calc_sq_size(): Make a debug message more informative Bart Van Assche
[not found] ` <4387aa0f-5097-d456-eee2-b480dfa5af87-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-12-06 14:31 ` Leon Romanovsky
[not found] ` <20161206143159.GB3437-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2016-12-14 18:46 ` Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161207082110.GA11857@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.