Re: [PATCH] i2c: amd756: Fix endianness handling for word data

Andi Shyti
2025-01-03T23:32:43Z

Hi again,

> @@ -211,7 +212,7 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
> SMB_HOST_ADDRESS);
> outb_p(command, SMB_HOST_COMMAND);
> if (read_write == I2C_SMBUS_WRITE)
> - outw_p(data->word, SMB_HOST_DATA); /* TODO: endian???? */
> + outw_p(cpu_to_le16((u16)data->word), SMB_HOST_DATA);
> size = AMD756_WORD_DATA;
> break;
> case I2C_SMBUS_BLOCK_DATA:
> @@ -256,7 +257,7 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
> data->byte = inw_p(SMB_HOST_DATA);
> break;
> case AMD756_WORD_DATA:
> - data->word = inw_p(SMB_HOST_DATA); /* TODO: endian???? */
> + data->word = (u16)le16_to_cpu(inw_p(SMB_HOST_DATA));

sorry, please do send a new version, the cast should not be
needed here.

If you have any questions, feel free to ask, after having read
Documentation/process/coding-style.rst.

Thanks,
Andi

> break;
> case AMD756_BLOCK_DATA:
> data->block[0] = inw_p(SMB_HOST_DATA) & 0x3f;
> --
> 2.39.5
>