public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kbuild] [vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'
       [not found] <50f70feb.ZSR7zBYc69/bckGk%fengguang.wu@intel.com>
@ 2013-01-17  1:21 ` Fengguang Wu
  2013-01-17  3:47   ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Fengguang Wu @ 2013-01-17  1:21 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm


Hi Alex,

FYI, there are new smatch warnings show up in

tree:   git://github.com/awilliam/linux-vfio.git vfio-vga
head:   2c2e21fa66c40ed7b8e434c86a9f2ab0c879f21d
commit: f4d38f216ef420595d12f74b256b3961eb4c3c14 [3/5] vfio-pci: Cleanup BAR access

New smatch warnings:
drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'

vim +169 drivers/vfio/pci/vfio_pci_rdwr.c

f4d38f21 Alex Williamson 2013-01-16  153  		if (!io) {
f4d38f21 Alex Williamson 2013-01-16  154  			pci_release_selected_regions(pdev, 1 << bar);
f4d38f21 Alex Williamson 2013-01-16  155  			return -ENOMEM;
89e1f7d4 Alex Williamson 2012-07-31  156  		}
89e1f7d4 Alex Williamson 2012-07-31  157  
f4d38f21 Alex Williamson 2013-01-16  158  		vdev->barmap[bar] = io;
f4d38f21 Alex Williamson 2013-01-16  159  	} else
89e1f7d4 Alex Williamson 2012-07-31  160  		io = vdev->barmap[bar];
89e1f7d4 Alex Williamson 2012-07-31  161  
f4d38f21 Alex Williamson 2013-01-16  162  	if (bar == vdev->msix_bar) {
f4d38f21 Alex Williamson 2013-01-16  163  		x_start = vdev->msix_offset;
f4d38f21 Alex Williamson 2013-01-16  164  		x_end = vdev->msix_offset + vdev->msix_size;
89e1f7d4 Alex Williamson 2012-07-31  165  	}
89e1f7d4 Alex Williamson 2012-07-31  166  
f4d38f21 Alex Williamson 2013-01-16  167  	done = do_io_rw(io, buf, pos, count, x_start, x_end, iswrite);
89e1f7d4 Alex Williamson 2012-07-31  168  
f4d38f21 Alex Williamson 2013-01-16 @169  	if (done >= 0)
f4d38f21 Alex Williamson 2013-01-16  170  		*ppos += done;
89e1f7d4 Alex Williamson 2012-07-31  171  
89e1f7d4 Alex Williamson 2012-07-31  172  	if (bar == PCI_ROM_RESOURCE)
89e1f7d4 Alex Williamson 2012-07-31  173  		pci_unmap_rom(pdev, io);
89e1f7d4 Alex Williamson 2012-07-31  174  
f4d38f21 Alex Williamson 2013-01-16  175  	return done;
89e1f7d4 Alex Williamson 2012-07-31  176  }

---
0-DAY kernel build testing backend              Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [kbuild] [vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'
  2013-01-17  1:21 ` [kbuild] [vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)' Fengguang Wu
@ 2013-01-17  3:47   ` Alex Williamson
  2013-01-17 14:59     ` Fengguang Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Williamson @ 2013-01-17  3:47 UTC (permalink / raw)
  To: Fengguang Wu; +Cc: kvm

On Thu, 2013-01-17 at 09:21 +0800, Fengguang Wu wrote:
> Hi Alex,
> 
> FYI, there are new smatch warnings show up in
> 
> tree:   git://github.com/awilliam/linux-vfio.git vfio-vga

Thanks for the bug report.  I never would have expected but reports from
an unadvertised branch but it's a really cool service.  Thanks for
providing it!

Alex

> head:   2c2e21fa66c40ed7b8e434c86a9f2ab0c879f21d
> commit: f4d38f216ef420595d12f74b256b3961eb4c3c14 [3/5] vfio-pci: Cleanup BAR access
> 
> New smatch warnings:
> drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'
> 
> vim +169 drivers/vfio/pci/vfio_pci_rdwr.c
> 
> f4d38f21 Alex Williamson 2013-01-16  153  		if (!io) {
> f4d38f21 Alex Williamson 2013-01-16  154  			pci_release_selected_regions(pdev, 1 << bar);
> f4d38f21 Alex Williamson 2013-01-16  155  			return -ENOMEM;
> 89e1f7d4 Alex Williamson 2012-07-31  156  		}
> 89e1f7d4 Alex Williamson 2012-07-31  157  
> f4d38f21 Alex Williamson 2013-01-16  158  		vdev->barmap[bar] = io;
> f4d38f21 Alex Williamson 2013-01-16  159  	} else
> 89e1f7d4 Alex Williamson 2012-07-31  160  		io = vdev->barmap[bar];
> 89e1f7d4 Alex Williamson 2012-07-31  161  
> f4d38f21 Alex Williamson 2013-01-16  162  	if (bar == vdev->msix_bar) {
> f4d38f21 Alex Williamson 2013-01-16  163  		x_start = vdev->msix_offset;
> f4d38f21 Alex Williamson 2013-01-16  164  		x_end = vdev->msix_offset + vdev->msix_size;
> 89e1f7d4 Alex Williamson 2012-07-31  165  	}
> 89e1f7d4 Alex Williamson 2012-07-31  166  
> f4d38f21 Alex Williamson 2013-01-16  167  	done = do_io_rw(io, buf, pos, count, x_start, x_end, iswrite);
> 89e1f7d4 Alex Williamson 2012-07-31  168  
> f4d38f21 Alex Williamson 2013-01-16 @169  	if (done >= 0)
> f4d38f21 Alex Williamson 2013-01-16  170  		*ppos += done;
> 89e1f7d4 Alex Williamson 2012-07-31  171  
> 89e1f7d4 Alex Williamson 2012-07-31  172  	if (bar == PCI_ROM_RESOURCE)
> 89e1f7d4 Alex Williamson 2012-07-31  173  		pci_unmap_rom(pdev, io);
> 89e1f7d4 Alex Williamson 2012-07-31  174  
> f4d38f21 Alex Williamson 2013-01-16  175  	return done;
> 89e1f7d4 Alex Williamson 2012-07-31  176  }
> 
> ---
> 0-DAY kernel build testing backend              Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> _______________________________________________
> kbuild mailing list
> kbuild@lists.01.org
> https://lists.01.org/mailman/listinfo/kbuild




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [kbuild] [vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)'
  2013-01-17  3:47   ` Alex Williamson
@ 2013-01-17 14:59     ` Fengguang Wu
  0 siblings, 0 replies; 3+ messages in thread
From: Fengguang Wu @ 2013-01-17 14:59 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm

On Wed, Jan 16, 2013 at 08:47:57PM -0700, Alex Williamson wrote:
> On Thu, 2013-01-17 at 09:21 +0800, Fengguang Wu wrote:
> > Hi Alex,
> > 
> > FYI, there are new smatch warnings show up in
> > 
> > tree:   git://github.com/awilliam/linux-vfio.git vfio-vga
> 
> Thanks for the bug report.  I never would have expected but reports from
> an unadvertised branch but it's a really cool service.  Thanks for
> providing it!

My pleasure! :)

Thanks,
Fengguang

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-17 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <50f70feb.ZSR7zBYc69/bckGk%fengguang.wu@intel.com>
2013-01-17  1:21 ` [kbuild] [vfio:vfio-vga 3/5] drivers/vfio/pci/vfio_pci_rdwr.c:169 vfio_pci_bar_rw() warn: always true condition '(done >= 0) => (0-u32max >= 0)' Fengguang Wu
2013-01-17  3:47   ` Alex Williamson
2013-01-17 14:59     ` Fengguang Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox