netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rds: ib: force endiannes annotation
@ 2019-04-29  6:09 Nicholas Mc Guire
  2019-04-29 11:00 ` Edward Cree
  0 siblings, 1 reply; 7+ messages in thread
From: Nicholas Mc Guire @ 2019-04-29  6:09 UTC (permalink / raw)
  To: Santosh Shilimkar
  Cc: David S. Miller, netdev, linux-rdma, rds-devel, linux-kernel,
	Nicholas Mc Guire

While the endiannes is being handled correctly as indicated by the comment
above the offending line - sparse was unhappy with the missing annotation
as be64_to_cpu() expects a __be64 argument. To mitigate this annotation
issue forced annotation is introduced. Note that this patch has no impact
on the generated binary.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem located by an experimental coccinelle script to locate
patters that make sparse unhappy (false positives):
net/rds/ib_recv.c:827:23: warning: cast to restricted __le64

Patch was compile-tested with: x86_64_defconfig + RDS_RDMA=m

Patch was verified not to change the binary by diffing the
generated object code before and after applying the patch.

Patch is against 5.1-rc6 (localversion-next is 20190426)

 net/rds/ib_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 7055985..a070a2d 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -824,7 +824,7 @@ static void rds_ib_cong_recv(struct rds_connection *conn,
 	}
 
 	/* the congestion map is in little endian order */
-	uncongested = le64_to_cpu(uncongested);
+	uncongested = le64_to_cpu((__force __le64)uncongested);
 
 	rds_cong_map_updated(map, uncongested);
 }
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-29 12:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-29  6:09 [PATCH] rds: ib: force endiannes annotation Nicholas Mc Guire
2019-04-29 11:00 ` Edward Cree
2019-04-29 11:18   ` Nicholas Mc Guire
2019-04-29 12:02     ` Edward Cree
2019-04-29 12:22       ` Christoph Hellwig
2019-04-29 12:21     ` Christoph Hellwig
2019-04-29 12:37       ` Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).