From patchwork Sun Sep 20 14:07:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 7226011 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9BB049F32B for ; Sun, 20 Sep 2015 14:12:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0BA2209BE for ; Sun, 20 Sep 2015 14:12:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7687206E2 for ; Sun, 20 Sep 2015 14:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754984AbbITOMp (ORCPT ); Sun, 20 Sep 2015 10:12:45 -0400 Received: from mx1.polytechnique.org ([129.104.30.34]:44750 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754455AbbITOMp (ORCPT ); Sun, 20 Sep 2015 10:12:45 -0400 X-Greylist: delayed 303 seconds by postgrey-1.27 at vger.kernel.org; Sun, 20 Sep 2015 10:12:44 EDT Received: from iosakhe.localdomain (32.206.133.77.rev.sfr.net [77.133.206.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 27BF41408EFA8; Sun, 20 Sep 2015 16:07:39 +0200 (CEST) From: Nicolas Iooss To: Mike Marciniszyn , Doug Ledford , Sean Hefty , Hal Rosenstock , Greg Kroah-Hartman , linux-rdma@vger.kernel.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Nicolas Iooss Subject: [PATCH] staging/rdma/hfi1: do not use u8 to store a 32-bit integer Date: Sun, 20 Sep 2015 16:07:15 +0200 Message-Id: <1442758035-1056-1-git-send-email-nicolas.iooss_linux@m4x.org> X-Mailer: git-send-email 2.5.2 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sun Sep 20 16:07:39 2015 +0200 (CEST)) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP hfi1_rc_hdrerr() stores the result of be32_to_cpu() into opcode, which is a local variable declared as u8. Later this variable is used in a 24-bit logical right shift, which makes clang complains (when building an allmodconfig kernel with LLVMLinux patches): drivers/staging/rdma/hfi1/rc.c:2399:9: warning: shift count >= width of type [-Wshift-count-overflow] opcode >>= 24; ^ ~~ All of this lead to the point that opcode may have been designed to be a 32-bit integer instead of an 8-bit one. Therefore make this variable u32. Signed-off-by: Nicolas Iooss Acked-by: Mike Marciniszyn --- drivers/staging/rdma/hfi1/rc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rdma/hfi1/rc.c b/drivers/staging/rdma/hfi1/rc.c index 632dd5ba7dfd..1e9caebb0281 100644 --- a/drivers/staging/rdma/hfi1/rc.c +++ b/drivers/staging/rdma/hfi1/rc.c @@ -2383,7 +2383,7 @@ void hfi1_rc_hdrerr( struct hfi1_other_headers *ohdr; struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num); int diff; - u8 opcode; + u32 opcode; u32 psn; /* Check for GRH */