From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: typec: tcpm: Fix incorrect 'and' operator
Date: Wed, 2 May 2018 17:07:12 +0300 [thread overview]
Message-ID: <20180502140712.GH12870@kuha.fi.intel.com> (raw)
On Mon, Apr 30, 2018 at 08:23:06AM -0500, Gustavo A. R. Silva wrote:
> Currently, logical and is being used instead of *bitwise* and.
>
> Fix this by using a proper bitwise and operator.
>
> Addresses-Coverity-ID: 1468455 ("Logical vs. bitwise operator")
> Fixes: 64f7c494a3c0 ("typec: tcpm: Add support for sink PPS related
> messages")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/tcpm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> index 1ee259b..7ee417a 100644
> --- a/drivers/usb/typec/tcpm.c
> +++ b/drivers/usb/typec/tcpm.c
> @@ -1772,7 +1772,7 @@ static void tcpm_pd_ext_msg_request(struct tcpm_port *port,
> enum pd_ext_msg_type type = pd_header_type_le(msg->header);
> unsigned int data_size = pd_ext_header_data_size_le(msg->ext_msg.header);
>
> - if (!(msg->ext_msg.header && PD_EXT_HDR_CHUNKED)) {
> + if (!(msg->ext_msg.header & PD_EXT_HDR_CHUNKED)) {
> tcpm_log(port, "Unchunked extended messages unsupported");
> return;
> }
Thanks,
next reply other threads:[~2018-05-02 14:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 14:07 Heikki Krogerus [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-04-30 14:44 typec: tcpm: Fix incorrect 'and' operator Opensource [Adam Thomson]
2018-04-30 13:23 Gustavo A. R. Silva
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=20180502140712.GH12870@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=Adam.Thomson.Opensource@diasemi.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo@embeddedor.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).