All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	kernel-janitors@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Cristian Marussi <cristian.marussi@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware: arm_scpi: prevent ternary sign expansion bug
Date: Wed, 28 Apr 2021 11:03:06 +0100	[thread overview]
Message-ID: <161960405992.396847.5531876675862211477.b4-ty@arm.com> (raw)
In-Reply-To: <YIE7pdqV/h10tEAK@mwanda>

On Thu, 22 Apr 2021 12:02:29 +0300, Dan Carpenter wrote:
> How type promotion works in ternary expressions is a bit tricky.
> The problem is that scpi_clk_get_val() returns longs, "ret" is a int
> which holds a negative error code, and le32_to_cpu() is an unsigned int.
> We want the negative error code to be cast to a negative long.  But
> because le32_to_cpu() is an u32 then "ret" is type promoted to u32 and
> becomes a high positive and then it is promoted to long and it is still
> a high positive value.
>
> [...]

Applied to sudeep.holla/linux (for-next/scmi), thanks!

[1/1] firmware: arm_scpi: prevent ternary sign expansion bug
      https://git.kernel.org/sudeep.holla/c/d9cd78edb2

--
Regards,
Sudeep


WARNING: multiple messages have this Message-ID (diff)
From: Sudeep Holla <sudeep.holla@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	kernel-janitors@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Cristian Marussi <cristian.marussi@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware: arm_scpi: prevent ternary sign expansion bug
Date: Wed, 28 Apr 2021 11:03:06 +0100	[thread overview]
Message-ID: <161960405992.396847.5531876675862211477.b4-ty@arm.com> (raw)
In-Reply-To: <YIE7pdqV/h10tEAK@mwanda>

On Thu, 22 Apr 2021 12:02:29 +0300, Dan Carpenter wrote:
> How type promotion works in ternary expressions is a bit tricky.
> The problem is that scpi_clk_get_val() returns longs, "ret" is a int
> which holds a negative error code, and le32_to_cpu() is an unsigned int.
> We want the negative error code to be cast to a negative long.  But
> because le32_to_cpu() is an u32 then "ret" is type promoted to u32 and
> becomes a high positive and then it is promoted to long and it is still
> a high positive value.
>
> [...]

Applied to sudeep.holla/linux (for-next/scmi), thanks!

[1/1] firmware: arm_scpi: prevent ternary sign expansion bug
      https://git.kernel.org/sudeep.holla/c/d9cd78edb2

--
Regards,
Sudeep


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-04-28 10:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  9:02 [PATCH] firmware: arm_scpi: prevent ternary sign expansion bug Dan Carpenter
2021-04-22  9:02 ` Dan Carpenter
2021-04-22 10:17 ` Cristian Marussi
2021-04-22 10:17   ` Cristian Marussi
2021-04-22 11:34   ` Cristian Marussi
2021-04-22 11:34     ` Cristian Marussi
2021-04-22 17:46 ` Sudeep Holla
2021-04-22 17:46   ` Sudeep Holla
2021-04-24  6:43   ` Dan Carpenter
2021-04-24  6:43     ` Dan Carpenter
2021-04-28 10:03 ` Sudeep Holla [this message]
2021-04-28 10:03   ` Sudeep Holla

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=161960405992.396847.5531876675862211477.b4-ty@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=cristian.marussi@arm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.