From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751274AbdFAPRU (ORCPT ); Thu, 1 Jun 2017 11:17:20 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:34032 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbdFAPRS (ORCPT ); Thu, 1 Jun 2017 11:17:18 -0400 Date: Thu, 1 Jun 2017 08:17:15 -0700 From: Guenter Roeck To: Dan Carpenter Cc: ? ? , "gregkh@linuxfoundation.org" , "yueyao.zhu@gmail.com" , "devel@driverdev.osuosl.org" , "o_leveque@orange.fr" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 1/3] staging: typec: Fix one defect of incorrect type in argument. Message-ID: <20170601151715.GA6820@roeck-us.net> References: <20170601145714.bjsywgifv2vxaa3o@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170601145714.bjsywgifv2vxaa3o@mwanda> User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 01, 2017 at 05:57:14PM +0300, Dan Carpenter wrote: > On Thu, Jun 01, 2017 at 07:21:00AM +0000, ? ? wrote: > > From: Pan Li > > > > Convert type le16 to cpu of argument 1 in function pd_header_cnt. > > > > Signed-off-by: Pan Li > > --- > > 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 df72d8b..405c9cc 100644 > > --- a/drivers/staging/typec/tcpci.c > > +++ b/drivers/staging/typec/tcpci.c > > @@ -287,7 +287,7 @@ static int tcpci_pd_transmit(struct tcpc_dev *tcpc, > > unsigned int reg, cnt, header; > > int ret; > > > > - cnt = msg ? pd_header_cnt(msg->header) * 4 : 0; > > + cnt = msg ? pd_header_cnt(le16_to_cpu(msg->header)) * 4 : 0; > > I guess this one is probably correct... > Yes. Overall though the series only touches the surface; the driver as-is is just not endianness clean. Someone will have to go through it and fix all problems. For example, tcpci_read16() is flawed since it reads 16 bits into a unrestricted 32 bit variable pointer. This needs some active work and can not rely on code analysis to find and fix the all flaws. Something to add to TODO. Side note: The subject lines in this series are all messed up. Thanks, Guenter