From patchwork Mon Apr 20 12:34:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 6242101 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 56AFEBF4A6 for ; Mon, 20 Apr 2015 13:12:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58EA32041B for ; Mon, 20 Apr 2015 13:12:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43A7D203EB for ; Mon, 20 Apr 2015 13:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754989AbbDTNM2 (ORCPT ); Mon, 20 Apr 2015 09:12:28 -0400 Received: from mail-bl2lp0205.outbound.protection.outlook.com ([207.46.163.205]:53600 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751843AbbDTNM1 (ORCPT ); Mon, 20 Apr 2015 09:12:27 -0400 Received: from BN1PR07MB358.namprd07.prod.outlook.com (10.141.60.144) by BN1PR07MB182.namprd07.prod.outlook.com (10.242.216.153) with Microsoft SMTP Server (TLS) id 15.1.136.25; Mon, 20 Apr 2015 13:12:26 +0000 Received: from BN1PR07CA0045.namprd07.prod.outlook.com (10.255.193.20) by BN1PR07MB358.namprd07.prod.outlook.com (10.141.60.144) with Microsoft SMTP Server (TLS) id 15.1.136.25; Mon, 20 Apr 2015 13:12:25 +0000 Received: from BN1AFFO11FD031.protection.gbl (2a01:111:f400:7c10::154) by BN1PR07CA0045.outlook.office365.com (2a01:111:e400:45::20) with Microsoft SMTP Server (TLS) id 15.1.136.25 via Frontend Transport; Mon, 20 Apr 2015 13:12:24 +0000 Authentication-Results: spf=softfail (sender IP is 192.19.192.197) smtp.mailfrom=avagotech.com; oracle.com; dkim=none (message not signed) header.d=none; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning avagotech.com discourages use of 192.19.192.197 as permitted sender) Received: from PALEXCH12.lsi.com (192.19.192.197) by BN1AFFO11FD031.mail.protection.outlook.com (10.58.52.185) with Microsoft SMTP Server (TLS) id 15.1.148.11 via Frontend Transport; Mon, 20 Apr 2015 13:12:24 +0000 Received: from palmhbs0.lsi.com (128.94.222.181) by PALEXCH12-EXT.lsi.com (128.94.222.103) with Microsoft SMTP Server id 14.3.158.1; Mon, 20 Apr 2015 09:12:22 -0400 Received: from localhost (dhcp-135-24-192-138.lsi.com [135.24.192.138]) by palmhbs0.lsi.com (8.13.8/8.12.11) with ESMTP id t3KCagKv016670; Mon, 20 Apr 2015 08:36:43 -0400 From: Message-ID: <201504201236.t3KCagKv016670@palmhbs0.lsi.com> Date: Mon, 20 Apr 2015 18:04:30 +0530 To: Subject: [PATCH RESEND 13/18] megaraid_sas : add endianess conversions for all ones CC: , , , , , User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.19.192.197; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(2220100001)(106466001)(4001350100001)(46406003)(2351001)(19580395003)(19580405001)(62966003)(92566002)(77156002)(229853001)(46102003)(57986006)(76506005)(47776003)(86362001)(50986999)(16796002)(54356999)(105596002)(87936001)(97756001)(6806004)(83506001)(110136001)(86152002)(50466002)(23726002)(4001430100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR07MB358; H:PALEXCH12.lsi.com; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BN1PR07MB358; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:BN1PR07MB182; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:BN1PR07MB358; BCL:0; PCL:0; RULEID:; SRVR:BN1PR07MB358; X-Forefront-PRVS: 05529C6FDB X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2015 13:12:24.2472 (UTC) X-MS-Exchange-CrossTenant-Id: 33102e38-078a-4484-9fb5-731e8b59db69 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=33102e38-078a-4484-9fb5-731e8b59db69; Ip=[192.19.192.197]; Helo=[PALEXCH12.lsi.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR07MB358 X-OriginatorOrg: lsicorp.onmicrosoft.com Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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=ham 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 Add noop conversions for all ones to make sparse happy. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_base.c | 2 +- drivers/scsi/megaraid/megaraid_sas_fp.c | 7 ++++--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 +++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 9467b05..cb34b48 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -1225,7 +1225,7 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp, */ if (scp->device->type == TYPE_TAPE) { if ((scp->request->timeout / HZ) > 0xFFFF) - pthru->timeout = 0xFFFF; + pthru->timeout = cpu_to_le16(0xFFFF); else pthru->timeout = cpu_to_le16(scp->request->timeout / HZ); } diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index e9138a2..2001ffb 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c @@ -769,7 +769,7 @@ static u8 mr_spanset_get_phy_params(struct megasas_instance *instance, u32 ld, if (pd != MR_PD_INVALID) *pDevHandle = MR_PdDevHandleGet(pd, map); else { - *pDevHandle = MR_PD_INVALID; + *pDevHandle = cpu_to_le16(MR_PD_INVALID); if ((raid->level >= 5) && (!do_invader || (do_invader && (raid->regTypeReqOnRead != REGION_TYPE_UNUSED)))) @@ -864,7 +864,8 @@ u8 MR_GetPhyParams(struct megasas_instance *instance, u32 ld, u64 stripRow, /* Get dev handle from Pd. */ *pDevHandle = MR_PdDevHandleGet(pd, map); else { - *pDevHandle = MR_PD_INVALID; /* set dev handle as invalid. */ + /* set dev handle as invalid. */ + *pDevHandle = cpu_to_le16(MR_PD_INVALID); if ((raid->level >= 5) && (!do_invader || (do_invader && (raid->regTypeReqOnRead != REGION_TYPE_UNUSED)))) @@ -1109,7 +1110,7 @@ MR_BuildRaidContext(struct megasas_instance *instance, ref_in_start_stripe, io_info, pRAID_Context, map); /* If IO on an invalid Pd, then FP is not possible.*/ - if (io_info->devHandle == MR_PD_INVALID) + if (io_info->devHandle == cpu_to_le16(MR_PD_INVALID)) io_info->fpOkForIo = FALSE; return retval; } else if (isRead) { diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 42d9c2e..7d34fe8 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -433,7 +433,7 @@ megasas_alloc_cmds_fusion(struct megasas_instance *instance) reply_desc = fusion->reply_frames_desc; for (i = 0; i < fusion->reply_q_depth * count; i++, reply_desc++) - reply_desc->Words = ULLONG_MAX; + reply_desc->Words = cpu_to_le64(ULLONG_MAX); io_frames_sz = fusion->io_frames_alloc_sz; @@ -2030,7 +2030,8 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex) num_completed = 0; - while ((d_val.u.low != UINT_MAX) && (d_val.u.high != UINT_MAX)) { + while (d_val.u.low != cpu_to_le32(UINT_MAX) && + d_val.u.high != cpu_to_le32(UINT_MAX)) { smid = le16_to_cpu(reply_desc->SMID); cmd_fusion = fusion->cmd_list[smid - 1]; @@ -2094,7 +2095,7 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex) fusion->reply_q_depth) fusion->last_reply_idx[MSIxIndex] = 0; - desc->Words = ULLONG_MAX; + desc->Words = cpu_to_le64(ULLONG_MAX); num_completed++; threshold_reply_count++; @@ -2531,7 +2532,7 @@ void megasas_reset_reply_desc(struct megasas_instance *instance) fusion->last_reply_idx[i] = 0; reply_desc = fusion->reply_frames_desc; for (i = 0 ; i < fusion->reply_q_depth * count; i++, reply_desc++) - reply_desc->Words = ULLONG_MAX; + reply_desc->Words = cpu_to_le64(ULLONG_MAX); } /*