Skip to content

Commit 669f1f4

Browse files
Redecoratingjwrdegoede
authored andcommitted
platform/x86: apple-gmux: don't use be32_to_cpu and cpu_to_be32
Sparce doesn't seem to like using be32_to_cpu and cpu_to_be32 to convert values for the MMIO gmux to/from the host architecture. Instead use iowrite32be and ioread32be to always convert, which should be fine because apple-gmux is only used on x86 with is always little endian. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Orlando Chamberlain <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 966cca7 commit 669f1f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/platform/x86/apple-gmux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static u32 gmux_mmio_read32(struct apple_gmux_data *gmux_data, int port)
278278
iowrite8(GMUX_MMIO_READ | sizeof(val),
279279
gmux_data->iomem_base + GMUX_MMIO_COMMAND_SEND);
280280
gmux_mmio_wait(gmux_data);
281-
val = be32_to_cpu(ioread32(gmux_data->iomem_base));
281+
val = ioread32be(gmux_data->iomem_base);
282282
mutex_unlock(&gmux_data->index_lock);
283283

284284
return val;
@@ -288,7 +288,7 @@ static void gmux_mmio_write32(struct apple_gmux_data *gmux_data, int port,
288288
u32 val)
289289
{
290290
mutex_lock(&gmux_data->index_lock);
291-
iowrite32(cpu_to_be32(val), gmux_data->iomem_base);
291+
iowrite32be(val, gmux_data->iomem_base);
292292
iowrite8(port & 0xff, gmux_data->iomem_base + GMUX_MMIO_PORT_SELECT);
293293
iowrite8(GMUX_MMIO_WRITE | sizeof(val),
294294
gmux_data->iomem_base + GMUX_MMIO_COMMAND_SEND);

0 commit comments

Comments
 (0)