[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B733A@saturn3.aculab.com>
Date: Mon, 16 Sep 2013 09:59:41 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Jack Morgenstein" <jackm@....mellanox.co.il>,
"Or Gerlitz" <or.gerlitz@...il.com>
Cc: "Prarit Bhargava" <prarit@...hat.com>, <netdev@...r.kernel.org>,
"Doug Ledford" <dledford@...hat.com>,
"Amir Vadai" <amirv@...lanox.com>,
"Or Gerlitz" <ogerlitz@...lanox.com>
Subject: RE: [PATCH] net, mellanox mlx4 Fix compile warnings
> On Sat, 14 Sep 2013 22:10:19 +0300
> Or Gerlitz <or.gerlitz@...il.com> wrote:
>
> > > + struct res_cq *uninitialized_var(cq);
> > >
> > > err = cq_res_start_move_to(dev, slave, cqn,
> > > RES_CQ_ALLOCATED, &cq);
>
> I have no objection. However, I don't know if the compiler is being too
> clever here or too stupid. The cq variable is initialized in
> cq_res_start_move_to(), but the compiler is ignoring this -- or maybe
> it is simply not assuming that cq will in fact be
> initialized by the called procedure?
Possibly cq_res_start_move_to() got inlined - and the analysis
of the inlined code found a path where it wasn't initialised.
Most likely one of the paths where the return value is non-zero.
> In any event, this change cannot hurt.
It could hide a real 'used but not initialised' error later on...
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists