RE: [PATCH v2] RDMA/cma: silence GCC warning

From: Hefty, Sean
Date: Wed Jul 17 2013 - 14:07:32 EST


> Building cma.o triggers this GCC warning:
> drivers/infiniband/core/cma.c: In function ârdma_resolve_addrâ:
> drivers/infiniband/core/cma.c:465:23: warning: âportâ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> drivers/infiniband/core/cma.c:426:5: note: âportâ was declared here
>
> This is a false positive, as "port" will always be initialized if we're
> at "found". But if we assign to "id_priv->id.port_num" directly, we can
> drop "port". That will, obviously, silence GCC.
>
> Signed-off-by: Paul Bolle <pebolle@xxxxxxxxxx>

Acked-by: Sean Hefty <sean.hefty@xxxxxxxxx>

> ---
> 0) v2: assign to "id_priv->id.port_num" directly, instead of
> initializing "port" to 0, as discussed with Sean.
>
> 1) Still only compile tested.

tested - thanks
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i