Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1036976pxj; Thu, 17 Jun 2021 20:51:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1dNO69U9DZsQPb+i2C4yt2QAbxTppJ6R14aMnl2YPbakjd/3WY6ot1BDutiyEr5KRZGaL X-Received: by 2002:aa7:d801:: with SMTP id v1mr2113230edq.349.1623988313713; Thu, 17 Jun 2021 20:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623988313; cv=none; d=google.com; s=arc-20160816; b=beMvKdiKhtNIcNDb4rzVqL4DRR97XCmIY4gizeh211x6RQFSvgRqAeH3WoTDSrby/P aYvMlWqH3l7fs1FEemoM4pdnDkx6CfiVPj7BkJ2mdYRCtpSOsqThjw8JGfWYdctzRvyX ze7ZZ/GA/gntycLzK0XM0asra6J8ierYaBBvYoXG2I6iTGJKNMgaWy45f/x/4HDjTVWS 3NnxMoT3zmQKfypcrA2O81OkPUEQcQ/1bxhzoWSwUfMLA68TlSNRxqjahvt1LaZ5vkrH RuAw5T7AlZqn3QVwPvjeFuFoxFbBQL7Fm19dXlTphWcD32cglokthgYsQWhf+jWyVz8B +uyA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+SDIAl1yRq88xHUi/034WTzhHZGtGTRjCc92oLsrTe8=; b=DIrdDKP4aNfn2JLT4Z1HoRUnRdLQ0atGKjuygawrQkA86GZ/y6g7vXW4gjF00XpKWE vy5RdzxKTcnNNrGIXd3+RwMw8WVfRu+GrHJbjw35UjsUSkJRHY3XlK+FntDmI6U5elJ1 LkhpyJtol0bnEWbc+cAwVCZjfKweGc0Nzg89/jRjFF+3gWKyOuK2LXLvUYR+A689qITc rRc0mcbkAGoZriKmqe63n4B3ZROJP4BttTAx1/iAhsMoDHbS2o72Taf3YaxUwi23oaoL 1kAZhgRU5a9F8ZwDb2jy43Vju9Mue0/saU0lnyC12mrF6C9O4jXYPuiPtn4WUV1vseaG gocA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b="ErU/mSfM"; 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=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn1si7501109edb.105.2021.06.17.20.51.31; Thu, 17 Jun 2021 20:51:53 -0700 (PDT) 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=@alliedtelesis.co.nz header.s=mail181024 header.b="ErU/mSfM"; 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=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232221AbhFRDeR (ORCPT + 99 others); Thu, 17 Jun 2021 23:34:17 -0400 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:38627 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232072AbhFRDeN (ORCPT ); Thu, 17 Jun 2021 23:34:13 -0400 Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id D7B1A83640; Fri, 18 Jun 2021 15:31:58 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1623987118; bh=+SDIAl1yRq88xHUi/034WTzhHZGtGTRjCc92oLsrTe8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ErU/mSfM/Do/OekKIY1oCEGtlelwYFSIp/RuF70STJgT6ONzlM+1oxQaaL3ylPElf v6txtRWXlRAddYW9wLgpUZNauKf6hEtdiZb0rGCiXP6+Lk+SQdWFUSh75AlGAnAxjF h4+pdBDjFQ3g4Vt1JxRTZxN2QmUX4pZDtiSv4Z6bUIBUZMedkAGH8/66gRm0IwD0It jBAt3uqqFkg/RQ68TYbepZEltyeb1/74NKJ2g0CbrPBGKtoMBkY0Q47OAhFi9AjHb0 bYK1oTEydXbFvRS3ZkEKfLVfPj91KEjkE9qyuLrVCp6qgXC9a2y7QNQmXkczA8f+aG 7OqJ0TeNG2lfA== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Fri, 18 Jun 2021 15:31:58 +1200 Received: from pauld-dl.ws.atlnz.lc (pauld-dl.ws.atlnz.lc [10.33.23.37]) by pat.atlnz.lc (Postfix) with ESMTP id 92BFC13EEAF; Fri, 18 Jun 2021 15:31:58 +1200 (NZST) Received: by pauld-dl.ws.atlnz.lc (Postfix, from userid 1684) id 8BD9E1E0550; Fri, 18 Jun 2021 15:31:58 +1200 (NZST) From: Paul Davey To: Manivannan Sadhasivam Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Davey Subject: [PATCH 1/2] bus: mhi: Fix pm_state conversion to string Date: Fri, 18 Jun 2021 15:31:31 +1200 Message-Id: <20210618033132.24839-2-paul.davey@alliedtelesis.co.nz> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210618033132.24839-1-paul.davey@alliedtelesis.co.nz> References: <20210618033132.24839-1-paul.davey@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.3 cv=IOh89TnG c=1 sm=1 tr=0 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=r6YtysWOX24A:10 a=SQbU7SH2vTJutzk7rhIA:9 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On big endian architectures the mhi debugfs files which report pm state give "Invalid State" for all states. Fix to_mhi_pm_state_str by using a local unsigned long as an intemediate to pass the state to find_last_bit to avoid endianness issues with cast from enum mhi_pm_state * to unsigned long *. Signed-off-by: Paul Davey --- drivers/bus/mhi/core/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c index c81b377fca8f..87cc0c449078 100644 --- a/drivers/bus/mhi/core/init.c +++ b/drivers/bus/mhi/core/init.c @@ -79,7 +79,8 @@ static const char * const mhi_pm_state_str[] =3D { =20 const char *to_mhi_pm_state_str(enum mhi_pm_state state) { - int index =3D find_last_bit((unsigned long *)&state, 32); + unsigned long tmp =3D state; + int index =3D find_last_bit((unsigned long *)&tmp, 32); =20 if (index >=3D ARRAY_SIZE(mhi_pm_state_str)) return "Invalid State"; --=20 2.32.0