From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CFD2C004C9 for ; Mon, 29 Apr 2019 06:15:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 236CB206BF for ; Mon, 29 Apr 2019 06:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727445AbfD2GPe (ORCPT ); Mon, 29 Apr 2019 02:15:34 -0400 Received: from www.osadl.org ([62.245.132.105]:41153 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbfD2GPc (ORCPT ); Mon, 29 Apr 2019 02:15:32 -0400 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3T6FCqA007063; Mon, 29 Apr 2019 08:15:12 +0200 From: Nicholas Mc Guire To: Santosh Shilimkar Cc: "David S. Miller" , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] rds: ib: force endiannes annotation Date: Mon, 29 Apr 2019 08:09:38 +0200 Message-Id: <1556518178-13786-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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