linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Biju Das <biju.das@bp.renesas.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Simon Horman <horms@verge.net.au>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>
Subject: RE: [PATCH v3] nvmem: check invalid number of bytes in nvmem_{read,write}()
Date: Tue, 11 Dec 2018 10:54:54 +0000	[thread overview]
Message-ID: <OSBPR01MB210338DE328981500C6992F8B8A60@OSBPR01MB2103.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <9f1a2851-58ca-2971-69d5-c1322b20130c@linaro.org>

Hello Srini,

Thanks for the feedback.

> Subject: Re: [PATCH v3] nvmem: check invalid number of bytes in
> nvmem_{read,write}()
>
>
>
> After applying this patch I get below errors with W=1 C=1
>
> On 11/12/18 09:24, Biju Das wrote:
> > +if (unlikely(check_add_overflow(bytes, offset, &new_bytes)))
> > +return -EOVERFLOW;
> >   drivers/nvmem/core.c:82:13: error: incompatible types in comparison
> expression (different type sizes)
> drivers/nvmem/core.c:82:13: error: incompatible types in comparison
> expression (different type sizes)
> drivers/nvmem/core.c:113:13: error: incompatible types in comparison
> expression (different type sizes)
> drivers/nvmem/core.c:113:13: error: incompatible types in comparison
> expression (different type sizes)

I was trying with arm32 toolchain and compiler happy. Now tried with Arm64 toolchain, it provides a warning and the below typecast fixed the issue.
if (unlikely(check_add_overflow(bytes, (size_t)offset, &new_bytes)))

Does typecasting to (size_t)  fixed the issue in your environment? Please let  me know.

regards,
Biju




[https://www2.renesas.eu/media/email/unicef.jpg]

This Christmas, instead of sending out cards, Renesas Electronics Europe have decided to support Unicef with a donation. For further details click here<https://www.unicef.org/> to find out about the valuable work they do, helping children all over the world.
We would like to take this opportunity to wish you a Merry Christmas and a prosperous New Year.



Renesas Electronics Europe Ltd, Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK. Registered in England & Wales under Registered No. 04586709.

  reply	other threads:[~2018-12-11 10:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11  9:24 [PATCH v3] nvmem: check invalid number of bytes in nvmem_{read,write}() Biju Das
2018-12-11  9:55 ` Srinivas Kandagatla
2018-12-11 10:54   ` Biju Das [this message]
2018-12-11 11:06     ` Geert Uytterhoeven
2018-12-11 11:10       ` Srinivas Kandagatla
2018-12-11 11:27         ` Geert Uytterhoeven

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=OSBPR01MB210338DE328981500C6992F8B8A60@OSBPR01MB2103.jpnprd01.prod.outlook.com \
    --to=biju.das@bp.renesas.com \
    --cc=Chris.Paterson2@renesas.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.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).