All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khalil Blaiech <kblaiech@nvidia.com>
To: <linux-i2c@vger.kernel.org>
Cc: <kblaiech@nvidia.com>, <wsa+renesas@sang-engineering.com>,
	"kernel test robot" <lkp@intel.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Vadim Pasternak <vadimp@nvidia.com>
Subject: [PATCH i2c-next v1 2/6] i2c: mlxbf: Fix resrticted cast warning of sparse
Date: Wed, 28 Oct 2020 18:54:18 -0400	[thread overview]
Message-ID: <aa2a06696f4461b7481c1407daf37a4aecce6610.1603925077.git.kblaiech@nvidia.com> (raw)
In-Reply-To: <cover.1603925077.git.kblaiech@nvidia.com>

Address warnings "warning: cast to restricted __be32" reported
by sparse.

Fixes: b5b5b32081cd206b ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Khalil Blaiech <kblaiech@nvidia.com>
---
 drivers/i2c/busses/i2c-mlxbf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index e18f595b37a7..4bd80b1b6a29 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -510,7 +510,7 @@ static u32 mlxbf_i2c_read(void __iomem *io, int reg)
  */
 static u32 mlxbf_i2c_read_data(void __iomem *io, int reg)
 {
-	return (u32)be32_to_cpu(mlxbf_i2c_read(io, reg));
+	return ioread32be(io + reg);
 }
 
 /*
@@ -524,7 +524,7 @@ static u32 mlxbf_i2c_read_data(void __iomem *io, int reg)
  */
 static void mlxbf_i2c_write_data(void __iomem *io, int reg, u32 val)
 {
-	mlxbf_i2c_write(io, reg, (u32)cpu_to_be32(val));
+	iowrite32be(val, io + reg);
 }
 
 /*
-- 
2.24.1


  parent reply	other threads:[~2020-10-28 22:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 22:54 [PATCH i2c-next v1 0/6] i2c: Incremental fixes for Mellanox BlueField I2C Khalil Blaiech
2020-10-28 22:54 ` [PATCH i2c-next v1 1/6] i2c: mlxbf: Add CONFIG_ACPI to guard ACPI function call Khalil Blaiech
2020-10-28 22:54 ` Khalil Blaiech [this message]
2020-10-28 22:54 ` [PATCH i2c-next v1 3/6] i2c: mlxbf: Remove unecessary wrapper functions Khalil Blaiech
2020-10-28 22:54 ` [PATCH i2c-next v1 4/6] i2c: mlxbf: Update reference clock frequency Khalil Blaiech
2020-10-28 22:54 ` [PATCH i2c-next v1 5/6] i2c: mlxbf: Update author and maintainer email info Khalil Blaiech
2020-10-28 22:55 ` [PATCH i2c-next v1 6/6] dt-bindings: i2c: Convert DT file to YAML schema Khalil Blaiech
2020-10-29 15:33   ` Rob Herring
2020-11-03 14:08     ` Khalil Blaiech
2020-10-29 15:33   ` Rob Herring
2020-11-03 14:06     ` Khalil Blaiech

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa2a06696f4461b7481c1407daf37a4aecce6610.1603925077.git.kblaiech@nvidia.com \
    --to=kblaiech@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=vadimp@nvidia.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.