]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[S390] sparse: fix sparse symbol shadow warning
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 24 Oct 2011 09:48:06 +0000 (11:48 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 24 Oct 2011 09:47:38 +0000 (11:47 +0200)
to_kvmdev and dev_to_virtio both use container_of. Avoid to nest the
two macros to quiet the following sparse warning:

drivers/s390/kvm/kvm_virtio.c:337:20: warning: symbol '__mptr' shadows an earlier one
drivers/s390/kvm/kvm_virtio.c:337:20: originally declared here

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/kvm/kvm_virtio.c

index 83c69fbc43fc9ce32913c1ef260b35413cabe1a9..3c2c923d5c0ae6d77a61ec7cac392b4aee4a8f71 100644 (file)
@@ -334,10 +334,10 @@ static void scan_devices(void)
  */
 static int match_desc(struct device *dev, void *data)
 {
-       if ((ulong)to_kvmdev(dev_to_virtio(dev))->desc == (ulong)data)
-               return 1;
+       struct virtio_device *vdev = dev_to_virtio(dev);
+       struct kvm_device *kdev = to_kvmdev(vdev);
 
-       return 0;
+       return kdev->desc == data;
 }
 
 /*