All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: xen-devel@lists.xenproject.org
Subject: [Xen-devel] [bug report] xen-pcifront: Xen PCI frontend driver.
Date: Tue, 25 Jun 2019 15:31:21 +0300	[thread overview]
Message-ID: <20190625123121.GA6674@mwanda> (raw)

Hi Xen devs,

I get the following static checker warning:

	drivers/pci/xen-pcifront.c:107 schedule_pcifront_aer_op()
	warn: passing casted pointer '&pdev->sh_info->flags' to 'test_bit()' 32 vs 64.

drivers/pci/xen-pcifront.c
   105  static inline void schedule_pcifront_aer_op(struct pcifront_device *pdev)
   106  {
   107          if (test_bit(_XEN_PCIB_active, (unsigned long *)&pdev->sh_info->flags)

->flags is a u32 so this cast only works on little endian systems.  I
don't know if that matters at all.  This driver has a bunch of similar
issues.  Is Xen x86 only?  It's pretty normal for Intel code to rely on
little endianness...

   108                  && !test_and_set_bit(_PDEVB_op_active, &pdev->flags)) {
   109                  dev_dbg(&pdev->xdev->dev, "schedule aer frontend job\n");
   110                  schedule_work(&pdev->op_work);
   111          }
   112  }

drivers/pci/xen-pcifront.c:107 schedule_pcifront_aer_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/pci/xen-pcifront.c:129 do_pci_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'set_bit()' 32 vs 64.
drivers/pci/xen-pcifront.c:142 do_pci_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/pci/xen-pcifront.c:150 do_pci_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'clear_bit()' 32 vs 64.
drivers/pci/xen-pcifront.c:162 do_pci_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/pci/xen-pcifront.c:670 pcifront_do_aer() warn: passing casted pointer '&pdev->sh_info->flags' to 'clear_bit()' 32 vs 64.
drivers/xen/mcelog.c:209 xen_mce_log() warn: passing casted pointer '&xen_mcelog.flags' to 'set_bit()' 32 vs 64.
drivers/xen/privcmd.c:350 mmap_batch_fn() warn: passing casted pointer 'gfnp' to 'xen_remap_domain_gfn_array()' 64 vs 32.
drivers/xen/privcmd.c:827 privcmd_ioctl_mmap_resource() warn: passing casted pointer 'pfns' to 'xen_remap_domain_mfn_array()' 64 vs 32.
drivers/xen/xen-pciback/conf_space.c:172 xen_pcibk_config_read() warn: passing casted pointer '&value' to 'pci_read_config_word()' 32 vs 16.
drivers/xen/xen-pciback/conf_space.c:57 conf_space_read() warn: passing casted pointer 'value' to 'field->u.w.read()' 32 vs 16.
drivers/xen/xen-pciback/pciback_ops.c:310 xen_pcibk_test_and_schedule_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pciback_ops.c:316 xen_pcibk_test_and_schedule_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pciback_ops.c:396 xen_pcibk_do_op() warn: passing casted pointer '&pdev->sh_info->flags' to 'clear_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:731 common_process() warn: passing casted pointer '&sh_info->flags' to 'set_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:736 common_process() warn: passing casted pointer '&sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:741 common_process() warn: passing casted pointer '&sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:745 common_process() warn: passing casted pointer '&sh_info->flags' to 'clear_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:753 common_process() warn: passing casted pointer '&sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:799 xen_pcibk_slot_reset() warn: passing casted pointer '&psdev->pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:857 xen_pcibk_mmio_enabled() warn: passing casted pointer '&psdev->pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:916 xen_pcibk_error_detected() warn: passing casted pointer '&psdev->pdev->sh_info->flags' to 'test_bit()' 32 vs 64.
drivers/xen/xen-pciback/pci_stub.c:969 xen_pcibk_error_resume() warn: passing casted pointer '&psdev->pdev->sh_info->flags' to 'test_bit()' 32 vs 64.

regards,
dan carpenter

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

             reply	other threads:[~2019-06-25 12:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 12:31 Dan Carpenter [this message]
2019-06-25 13:26 ` [Xen-devel] [bug report] xen-pcifront: Xen PCI frontend driver Juergen Gross

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=20190625123121.GA6674@mwanda \
    --to=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 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.