From: Felipe Contreras <felipe.contreras@nokia.com>
To: fernando.lugo@ti.com, felipe.contreras@gmail.com
Cc: hiroshi.doyu@nokia.com, david.cohen@nokia.com,
ameya.palande@nokia.com, linux-kernel@vger.kernel.org,
andy.shevchenko@gmail.com, linux-omap@vger.kernel.org
Subject: RE: [PATCHv2 2/3] iovmm: add superpages support to fixed da address
Date: Wed, 13 Oct 2010 19:43:50 +0300 [thread overview]
Message-ID: <1286988203-notmuch-felipe.contreras@nokia.com> (raw)
In-Reply-To: <496565EC904933469F292DDA3F1663E602F47B2FDA@dlee06.ent.ti.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]
fernando.lugo@ti.com wrote:
> > On Mon, Oct 11, 2010 at 6:33 PM, Guzman Lugo, Fernando
> > <fernando.lugo@ti.com> wrote:
> > >> > @@ -420,7 +431,8 @@ static void sgtable_fill_kmalloc(struct
> > >> sg_table
> > >> > *sgt, u32 pa, size_t len)
> > >> > for_each_sg(sgt->sgl, sg, sgt->nents, i) {
> > >> > size_t bytes;
> > >> >
> > >> > - bytes = iopgsz_max(len);
> > >> > + bytes = max_alignment(da | pa);
> > >> > + bytes = min(bytes, (size_t)iopgsz_max(len));
> > >>
> > >> Why the size_t casting?
> > >
> > > To void this warning:
> > > arch/arm/plat-omap/iovmm.c:440: warning: comparison of distinct
> > > pointer types lacks a cast
> >
> > But how is that possible? iopgsz_max is returning constants,
> > like SZ_1M, so they should not need casts, if anything, the
> > cast should be done in iopgsz_max itself.
>
> The min macro make a "typeof" of the parameter, so the typeof of a
> Constants should be int I think and that's the reason of the warning.
>
> I can use min_t instead to avoid the warning, something like this:
>
> bytes = min_t(size_t, bytes, iopgsz_max(len));
>
> What do you think?
Right, I forgot about that one... much better.
--
Felipe Contreras
prev parent reply other threads:[~2010-10-13 16:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 21:02 [PATCHv2 0/3] iovmm: fixes for iovmm module Fernando Guzman Lugo
2010-10-04 21:02 ` [PATCHv2 1/3] iovmm: no gap checking for fixed address Fernando Guzman Lugo
2010-10-04 21:02 ` [PATCHv2 2/3] iovmm: add superpages support to fixed da address Fernando Guzman Lugo
2010-10-04 21:02 ` [PATCHv2 3/3] iovmm: replace __iounmap with omap_iounmap Fernando Guzman Lugo
2010-10-10 15:22 ` [PATCHv2 2/3] iovmm: add superpages support to fixed da address Felipe Contreras
2010-10-11 15:33 ` Guzman Lugo, Fernando
2010-10-12 11:09 ` Felipe Contreras
2010-10-12 14:10 ` Guzman Lugo, Fernando
2010-10-13 16:43 ` Felipe Contreras [this message]
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=1286988203-notmuch-felipe.contreras@nokia.com \
--to=felipe.contreras@nokia.com \
--cc=ameya.palande@nokia.com \
--cc=andy.shevchenko@gmail.com \
--cc=david.cohen@nokia.com \
--cc=felipe.contreras@gmail.com \
--cc=fernando.lugo@ti.com \
--cc=hiroshi.doyu@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@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
all inboxes | Powered by JetHome®