From patchwork Mon Jan 4 03:44:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 7945031 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 517899F350 for ; Mon, 4 Jan 2016 03:44:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7834220259 for ; Mon, 4 Jan 2016 03:44:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 834D620204 for ; Mon, 4 Jan 2016 03:44:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752136AbcADDol (ORCPT ); Sun, 3 Jan 2016 22:44:41 -0500 Received: from mga02.intel.com ([134.134.136.20]:50613 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751974AbcADDol (ORCPT ); Sun, 3 Jan 2016 22:44:41 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 03 Jan 2016 19:44:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,519,1444719600"; d="scan'208";a="852894931" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by orsmga001.jf.intel.com with ESMTP; 03 Jan 2016 19:44:39 -0800 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id u043idUh006584; Sun, 3 Jan 2016 22:44:39 -0500 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id u043ic81006581; Sun, 3 Jan 2016 22:44:38 -0500 X-Authentication-Warning: phlsvsds.ph.intel.com: iweiny set sender to ira.weiny@intel.com using -f From: ira.weiny@intel.com To: dledford@redhat.com, linux-rdma@vger.kernel.org Cc: bart.vanassche@sandisk.com, Ira Weiny Subject: [PATCH] IB/sysfs: Fix sparse warning on attr_id Date: Sun, 3 Jan 2016 22:44:25 -0500 Message-Id: <1451879065-6513-1-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 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, 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 From: Ira Weiny Attributed ID was declared as an int while the value should really be big endian 16. Fixes: 35c4cbb17811 ("IB/core: Create get_perf_mad function in sysfs.c") Reported-by: Bart Van Assche Signed-off-by: Ira Weiny Reviewed-by: Bart Van Assche Reviewed-by: Christoph Lameter Reviewed-by: Hal Rosenstock --- drivers/infiniband/core/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index 2daf83276cdf..3de93517efe4 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c @@ -77,7 +77,7 @@ struct port_table_attribute { struct port_attribute attr; char name[8]; int index; - int attr_id; + __be16 attr_id; }; static ssize_t port_attr_show(struct kobject *kobj, @@ -413,7 +413,7 @@ struct port_table_attribute port_pma_attr_ext_##_name = { \ * Get a Perfmgmt MAD block of data. * Returns error code or the number of bytes retrieved. */ -static int get_perf_mad(struct ib_device *dev, int port_num, int attr, +static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr, void *data, int offset, size_t size) { struct ib_mad *in_mad;