Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp634pxb; Wed, 11 Nov 2020 17:45:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaTpfdxbflMDI7gnh7WDkVfgZufpO1gXHOwi7m7KSE+1dPqC/HVpXRaa9OqammUJsnvEFU X-Received: by 2002:a17:907:1008:: with SMTP id ox8mr27528495ejb.189.1605145525868; Wed, 11 Nov 2020 17:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605145525; cv=none; d=google.com; s=arc-20160816; b=L/Sgqmv7rJy2bdNxk0uo1m8Xz3zZD5aicMUaqqio/sl+eOfXufaJZALOYQGGmecJ+D N7TBg8VycXlpdxiRjHvxaOjrlExv7UmmUu2pGo3jjpoREoPY7/UyDyo5Nxe5MxlZVr8j jkUOxlEP++i2Jr1GCjMmEg+8Mo3D9fvdNldfgr1omdFFKo30Bu4LuetSfLxn5+9FPPzy C6FWV87gbda4TnaRwVc2VeKRaiTcQPCr90OzfNFiajjRL30aWXCHxXQ+8i8QungXhebS 0R1glLhjriGp93jgw5gYzM/gOyIJqHfb9bqresnrGfAGojXf17vN9NxJ5niO+tAvfiC4 LPoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RmsftSqeK+iTEilXtDQxEDiHH74AX0QOs+3P/fEMQIY=; b=mjhriez5aTBsJH+UXIw9pJ+WHV/HNRvd9qSjyvHWwvWU3t/9O2mGtlvACpxQI4dV37 vFR3+tqL3KVVa2O4ZFK+mWKqFt0/27Y434QkVMv5XWDX0cdcDKT7qJZf4UH8hJAAsHL5 WJPwzkyeFO53rWyqTi6rj5PAPxNk0wsg3i24XmFtOPhIgoBmgYRXfNnktRbosASuV6UT 9IlW1iZHL2bSdWYBYu2/1ut1ZZ28MLrORpDOqQdWravTOvHT1T+5djN5ZXg58agzcUTd IpBHuXz/5+XweahUwjrMhCQHWs7FRzYnZ2HfJV6FrorgwDyDFLv1QvpSw7N49qycKDJw rU1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oSBX3tGP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si2910519edt.77.2020.11.11.17.45.02; Wed, 11 Nov 2020 17:45:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oSBX3tGP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729478AbgKLBkc (ORCPT + 99 others); Wed, 11 Nov 2020 20:40:32 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18058 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728186AbgKLBEy (ORCPT ); Wed, 11 Nov 2020 20:04:54 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0AC11lxY087370; Wed, 11 Nov 2020 20:04:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=RmsftSqeK+iTEilXtDQxEDiHH74AX0QOs+3P/fEMQIY=; b=oSBX3tGPgaPrwYcbfpc+YOtoGYRA33u57CszUSUubbVWIdg9kJPfDUjoF9S398zz8wgv UHV67dpg4SJqTnZIMCF27Ex+iaK8pTqtt7H1KJF+axaWh90KCsD0REPwynjiT9cW6Uae U5nOmBL76feV+iu6wNRY/Hvtqxa3G0hYEl1f7twFeM/HrNQJrpP4ckVitc9TZ7SrchKp DxyX3mliwzGUx5GhigJC0xQ5LlC9gof9bKv2JV6eLHXxBDev5Js8F2aHDsi2Zf4l1nE3 EmlbRFw6ZSv5xMfNH4QDhgjSjyC+v5x5iteRrYfXYkijssLqksXi68jT7/yCQxCYzYKx yQ== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 34rfyeur7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Nov 2020 20:04:46 -0500 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0AC0vSTE020667; Thu, 12 Nov 2020 01:04:45 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03dal.us.ibm.com with ESMTP id 34nk79y5sn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Nov 2020 01:04:45 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0AC14iMo11207194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Nov 2020 01:04:44 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B15E428058; Thu, 12 Nov 2020 01:04:44 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3AE002805E; Thu, 12 Nov 2020 01:04:44 +0000 (GMT) Received: from localhost.localdomain (unknown [9.40.195.188]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 12 Nov 2020 01:04:44 +0000 (GMT) From: Tyrel Datwyler To: james.bottomley@hansenpartnership.com Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, brking@linux.ibm.com, Tyrel Datwyler Subject: [PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions Date: Wed, 11 Nov 2020 19:04:37 -0600 Message-Id: <20201112010442.102589-1-tyreld@linux.ibm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312,18.0.737 definitions=2020-11-11_12:2020-11-10,2020-11-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 bulkscore=0 clxscore=1015 suspectscore=1 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011120001 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both ibmvfc_show_host_(capabilities|npiv_version) functions retrieve values from vhost->login_buf.resp buffer. This is the MAD response buffer from the VIOS and as such any multi-byte non-string values are in big endian format. Byte swap these values to host cpu endian format for better human readability. Signed-off-by: Tyrel Datwyler --- drivers/scsi/ibmvscsi/ibmvfc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 070cf516b98f..01fe65de9086 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -3025,7 +3025,7 @@ static ssize_t ibmvfc_show_host_npiv_version(struct device *dev, { struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%d\n", vhost->login_buf->resp.version); + return snprintf(buf, PAGE_SIZE, "%d\n", be32_to_cpu(vhost->login_buf->resp.version)); } static ssize_t ibmvfc_show_host_capabilities(struct device *dev, @@ -3033,7 +3033,7 @@ static ssize_t ibmvfc_show_host_capabilities(struct device *dev, { struct Scsi_Host *shost = class_to_shost(dev); struct ibmvfc_host *vhost = shost_priv(shost); - return snprintf(buf, PAGE_SIZE, "%llx\n", vhost->login_buf->resp.capabilities); + return snprintf(buf, PAGE_SIZE, "%llx\n", be64_to_cpu(vhost->login_buf->resp.capabilities)); } /** -- 2.27.0