Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3700086ybv; Mon, 10 Feb 2020 04:58:12 -0800 (PST) X-Google-Smtp-Source: APXvYqw/P8YzUSf9gl7a2QQfW3fFzoYFdBUxRIDxOtX5/8eTAR5s7h6aUAUOnwR6P5fjAO431Mog X-Received: by 2002:aca:f1c6:: with SMTP id p189mr731173oih.159.1581339492775; Mon, 10 Feb 2020 04:58:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581339492; cv=none; d=google.com; s=arc-20160816; b=Osq6nvW3X8vmxRif7GrbkQaelqW5YfW/fi/QFQAIG2825p2f0kODY/GOdQA3kJ4xuD BTJuKm/FsO/5Wb9iYka0f0ozIVPFgjN0hkoHXhgxMwCRbgxKX8qPp73G0rX5iUFvtYTz ckrNbekWZBPoD2R/32OyQvpYwQ7brgCrQTEcjKFL9JEm+Lnn57srI0aBZm1QMATA8b0b fS3C/Tja9HQAI2sttmjuHPKn8f/z/BJl/5FftH8ia66bp+JyHNoX/AdgkJHrtDu7cS30 Ou7iuAGQCD435Ov5QZJsSL2sWHOMRz2fRqRL3d0iaZBDCmacrWkbPZ17d1GLcqbAyRzs 7gAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EWP3sqSZC1NaUW8yxdh53W/54KcgnEwkxC+1k4k+RCc=; b=IaqCexSg9MF2F5WMy+57Td0o9Jhr9TrhKPY95ANE+uqwp3NREHU9vciL7vyX52lWZJ YXoZK1EMxMc+gUqz0ge9AdDtz8AJUllSWqLld98hniYHRPWhrNnJ5yiEZUafOKLwNOcO RxAR9ph6x356u06I2WfwYkFrQnRv3h0iXxgRhobRBJBUOhb92wArBtQpGnuiopH6Y2BQ 6xjyB9zGLD+ukyqvUiFZIECj3XTAcF4ty7OGkvLSbwSB5SBTK5mGp4kDAoWo1yXcvdBz udytCBdaY7T3D+yGjU+AnB66msTv+1qi6moXrx6vUhpODBDNC6fOAlIKe7zIfXPuZh5v pviw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yEWNHWeR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j74si165793otj.246.2020.02.10.04.58.01; Mon, 10 Feb 2020 04:58:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yEWNHWeR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729804AbgBJM5B (ORCPT + 99 others); Mon, 10 Feb 2020 07:57:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:44092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730019AbgBJMle (ORCPT ); Mon, 10 Feb 2020 07:41:34 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 716A32051A; Mon, 10 Feb 2020 12:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338493; bh=JijeiRR22X5vx0KO2KWcPuv8NQm7np4aQBgIfpzr/zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yEWNHWeRPyo88LU5tGVLVBr3uuL28FOEeWPXiZmVTsUJTmHP4KQ0qyQSE5cuTNy+E XpQ1ElEe1OCC1u26tiiMHTBiH8oioq/Oxg2b0pU5YfY+YTXVZhZI6+FpnVrGSAfHox tT/kOSqR+ykgiiSdsZUOXPgMVyV3KWWKlEHwVY08= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Himanshu Madhani , Quinn Tran , Martin Wilck , Daniel Wagner , Roman Bolshakov , Bart Van Assche , "Martin K. Petersen" Subject: [PATCH 5.5 280/367] scsi: qla2xxx: Fix the endianness of the qla82xx_get_fw_size() return type Date: Mon, 10 Feb 2020 04:33:13 -0800 Message-Id: <20200210122449.904942547@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bart Van Assche commit 3f5f7335e5e234e340b48ecb24c2aba98a61f934 upstream. Since qla82xx_get_fw_size() returns a number in CPU-endian format, change its return type from __le32 into u32. This patch does not change any functionality. Fixes: 9c2b297572bf ("[SCSI] qla2xxx: Support for loading Unified ROM Image (URI) format firmware file.") Cc: Himanshu Madhani Cc: Quinn Tran Cc: Martin Wilck Cc: Daniel Wagner Cc: Roman Bolshakov Link: https://lore.kernel.org/r/20191219004905.39586-1-bvanassche@acm.org Reviewed-by: Daniel Wagner Reviewed-by: Roman Bolshakov Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_nx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -1612,8 +1612,7 @@ qla82xx_get_bootld_offset(struct qla_hw_ return (u8 *)&ha->hablob->fw->data[offset]; } -static __le32 -qla82xx_get_fw_size(struct qla_hw_data *ha) +static u32 qla82xx_get_fw_size(struct qla_hw_data *ha) { struct qla82xx_uri_data_desc *uri_desc = NULL; @@ -1624,7 +1623,7 @@ qla82xx_get_fw_size(struct qla_hw_data * return cpu_to_le32(uri_desc->size); } - return cpu_to_le32(*(u32 *)&ha->hablob->fw->data[FW_SIZE_OFFSET]); + return get_unaligned_le32(&ha->hablob->fw->data[FW_SIZE_OFFSET]); } static u8 * @@ -1816,7 +1815,7 @@ qla82xx_fw_load_from_blob(struct qla_hw_ } flashaddr = FLASH_ADDR_START; - size = (__force u32)qla82xx_get_fw_size(ha) / 8; + size = qla82xx_get_fw_size(ha) / 8; ptr64 = (u64 *)qla82xx_get_fw_offs(ha); for (i = 0; i < size; i++) {