xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: xen/gntdev: add ioctl for grant copy
Date: Thu, 14 Jan 2016 10:07:30 +0000	[thread overview]
Message-ID: <56977362.2070804@citrix.com> (raw)
In-Reply-To: <20160113195654.GA17620@mwanda>

On 13/01/16 19:56, Dan Carpenter wrote:
> Hello David Vrabel,
> 
> The patch a4cdb556cae0: "xen/gntdev: add ioctl for grant copy" from
> Dec 2, 2014, leads to the following static checker warning:
> 
> 	drivers/xen/gntdev.c:775 gntdev_get_page()
> 	warn: mask and shift to zero
> 
> drivers/xen/gntdev.c
>    761  static int gntdev_get_page(struct gntdev_copy_batch *batch, void __user *virt,
>    762                             bool writeable, unsigned long *gfn)
>    763  {
>    764          unsigned long addr = (unsigned long)virt;
>    765          struct page *page;
>    766          unsigned long xen_pfn;
>    767          int ret;
>    768  
>    769          ret = get_user_pages_fast(addr, 1, writeable, &page);
>    770          if (ret < 0)
>    771                  return ret;
>    772  
>    773          batch->pages[batch->nr_pages++] = page;
>    774  
>    775          xen_pfn = page_to_xen_pfn(page) + XEN_PFN_DOWN(addr & ~PAGE_MASK);
>                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This is zero most of the time.  Did you intend the bitwise negate?

This is non-zero if XEN_PAGE_SIZE < PAGE_SIZE and is needed for this case.

David

      reply	other threads:[~2016-01-14 10:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 19:56 xen/gntdev: add ioctl for grant copy Dan Carpenter
2016-01-14 10:07 ` David Vrabel [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=56977362.2070804@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=dan.carpenter@oracle.com \
    --cc=xen-devel@lists.xenproject.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).