From: Guenter Roeck <linux@roeck-us.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: ? ? <incarnation.p.lee@outlook.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"yueyao.zhu@gmail.com" <yueyao.zhu@gmail.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"o_leveque@orange.fr" <o_leveque@orange.fr>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] staging: typec: Fix one defect of incorrect type in argument.
Date: Thu, 1 Jun 2017 08:17:15 -0700 [thread overview]
Message-ID: <20170601151715.GA6820@roeck-us.net> (raw)
In-Reply-To: <20170601145714.bjsywgifv2vxaa3o@mwanda>
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 <incarnation.p.lee@outlook.com>
> >
> > Convert type le16 to cpu of argument 1 in function pd_header_cnt.
> >
> > 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 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
next prev parent reply other threads:[~2017-06-01 15:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Task-16>
[not found] ` <CY4PR16MB1669E1E3C1E89F3199057AA9B7F60@CY4PR16MB1669.namprd16.prod.outlook.com>
2017-06-01 14:52 ` [PATCH 3/3] staging: typec: Fix one defect of incorrect type assignment Dan Carpenter
[not found] ` <CY4PR16MB1669D17AEAA092B236E59287B7F60@CY4PR16MB1669.namprd16.prod.outlook.com>
2017-06-01 14:57 ` [PATCH 1/3] staging: typec: Fix one defect of incorrect type in argument Dan Carpenter
2017-06-01 15:17 ` Guenter Roeck [this message]
[not found] ` <CY4PR16MB1669BD8D774D46F2C837E905B7F60@CY4PR16MB1669.namprd16.prod.outlook.com>
2017-06-01 14:58 ` [PATCH 2/3] staging: typec: Fix one defect of incorrect type assignment Dan Carpenter
[not found] ` <CY4PR16MB166944C4A3ACC08A513059BBB7F60@CY4PR16MB1669.namprd16.prod.outlook.com>
2017-06-02 13:45 ` [PATCH 0/3] staging:typec: Fix 3 defect of incorrect type Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170601151715.GA6820@roeck-us.net \
--to=linux@roeck-us.net \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=incarnation.p.lee@outlook.com \
--cc=linux-kernel@vger.kernel.org \
--cc=o_leveque@orange.fr \
--cc=yueyao.zhu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome