Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver

From: Greg KH
Date: Wed Jan 17 2018 - 08:34:16 EST


On Wed, Jan 10, 2018 at 02:59:12PM +0800, ShuFanLee wrote:
> +static inline int rt1711h_reg_write_word(struct rt1711h_chip *chip, uint8_t reg,
> + uint16_t data)
> +{
> + data = cpu_to_le16(data);
> + return rt1711h_reg_block_write(chip, reg, 2, (uint8_t *)&data);
> +}

Did you run sparse on this code? What are you doing casting the types
all over the place for data? That does not seem correct at all.

thanks,

greg k-h