Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1655235 > unrolled thread

Re: [PATCH 2/3] staging: typec: Fix one defect of incorrect type assignment.

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2017-06-01 17:10 +0200
Last post2017-06-01 17:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/3] staging: typec: Fix one defect of incorrect type  assignment. Dan Carpenter <dan.carpenter@oracle.com> - 2017-06-01 17:10 +0200

#1655235 — Re: [PATCH 2/3] staging: typec: Fix one defect of incorrect type assignment.

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-06-01 17:10 +0200
SubjectRe: [PATCH 2/3] staging: typec: Fix one defect of incorrect type assignment.
Message-ID<tNzTA-491-23@gated-at.bofh.it>
On Thu, Jun 01, 2017 at 07:21:22AM +0000, ? ? wrote:
> From: Pan Li <incarnation.p.lee@outlook.com>
> 
>     Convert type le16 to cpu for consistent type assignment.
> 
> Signed-off-by: Pan Li <incarnation.p.lee@outlook.com>
> ---
>  drivers/staging/typec/tcpci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
> index 405c9cc..18d2e06 100644
> --- a/drivers/staging/typec/tcpci.c
> +++ b/drivers/staging/typec/tcpci.c
> @@ -292,7 +292,7 @@ static int tcpci_pd_transmit(struct tcpc_dev *tcpc,
>  	if (ret < 0)
>  		return ret;
>  
> -	header = msg ? msg->header : 0;
> +	header = msg ? le16_to_cpu(msg->header) : 0;
>  	ret = tcpci_write16(tcpci, TCPC_TX_HDR, header);

This looks like it introduces bugs.  We normally write endian data and
you've changed it to write CPU endian data.

regards,
dan carpenter

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web