* [PATCH] iw_cxgb4: Convert a __force cast
@ 2016-04-12 21:45 Bart Van Assche
[not found] ` <570D6C74.60707-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2016-04-12 21:45 UTC (permalink / raw)
To: Doug Ledford
Cc: Steve Wise, Vipul Pandya,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
__force casts should be avoided if there is a better alternative.
Hence modify the comparison of s_addr with INADDR_ANY such that the
__force cast is no longer necessary.
Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Cc: Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
---
drivers/infiniband/hw/cxgb4/cm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 6517113..f1682ca 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -3108,7 +3108,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
/*
* Handle loopback requests to INADDR_ANY.
*/
- if ((__force int)raddr->sin_addr.s_addr == INADDR_ANY) {
+ if (raddr->sin_addr.s_addr == htonl(INADDR_ANY)) {
err = pick_local_ipaddrs(dev, cm_id);
if (err)
goto fail1;
--
2.8.1
--
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iw_cxgb4: Convert a __force cast
[not found] ` <570D6C74.60707-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-04-12 21:47 ` Steve Wise
0 siblings, 0 replies; 2+ messages in thread
From: Steve Wise @ 2016-04-12 21:47 UTC (permalink / raw)
To: Bart Van Assche, Doug Ledford
Cc: Vipul Pandya, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 4/12/2016 4:45 PM, Bart Van Assche wrote:
> __force casts should be avoided if there is a better alternative.
> Hence modify the comparison of s_addr with INADDR_ANY such that the
> __force cast is no longer necessary.
>
Looks good.
Acked-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-12 21:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-12 21:45 [PATCH] iw_cxgb4: Convert a __force cast Bart Van Assche
[not found] ` <570D6C74.60707-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-12 21:47 ` Steve Wise
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox