public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: John Calixto <john.calixto@modsystems.com>
To: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs
Date: Mon, 11 Apr 2011 16:32:42 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1104111626060.32082@peruna> (raw)
In-Reply-To: <m3ipuka3dm.fsf@pullcord.laptop.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1422 bytes --]

On Mon, 11 Apr 2011, Chris Ball wrote:
> This adds two gcc warnings here (compiling for ARM):
> 
>   CC      drivers/mmc/card/block.o
> drivers/mmc/card/block.c: In function ‘mmc_blk_ioctl_copy_from_user’:
> drivers/mmc/card/block.c:199:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> drivers/mmc/card/block.c: In function ‘mmc_blk_ioctl_acmd’:
> drivers/mmc/card/block.c:308:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 
> ...
> > +	if (copy_from_user(idata->buf, (u8 *) user->data_ptr, idata->buf_bytes)) {
> > +		err = -EFAULT;
> > +		goto copy_err;
> > +	}
> ...
> > +		if (copy_to_user((u8 *) ic_ptr->data_ptr, idata->buf, idata->buf_bytes)) {
> > +			err = -EFAULT;
> > +			goto acmd_rel_host;
> > +		}
> ...
> 

Hrmmm...  So, what's the correct way to do this compat_ioctl() stuff?
My first attempt at a compat_ioctl() implementation in v2 used a 32bit
version of the structure to marshall the data.  That was shot down as
being unnecessarily complicated since the buffer pointer was the only
thing that was not compat friendly.  It was recommended that I could
just make this a 64bit int field and let the callers do the appropriate
casting.  However, this latter solution (implemented in v3) causes the
compiler warning that you describe above.

Should I revert to the v2 implementation?

John

      reply	other threads:[~2011-04-11 23:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08  1:18 [PATCH v3] mmc: Add ioctl to let userspace apps send ACMDs John Calixto
2011-04-08  8:22 ` Andrei Warkentin
2011-04-08  8:46   ` Andrei Warkentin
2011-04-08 19:20   ` John Calixto
2011-04-08 19:58     ` Andrei Warkentin
2011-04-08 21:25       ` John Calixto
2011-04-08 21:39         ` Andrei Warkentin
2011-04-08 21:46           ` Chris Ball
2011-04-08 22:17           ` John Calixto
2011-04-11 21:23 ` Chris Ball
2011-04-11 23:32   ` John Calixto [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=alpine.DEB.2.00.1104111626060.32082@peruna \
    --to=john.calixto@modsystems.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@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