Skip to contentSkip to conversation

vfio-mdev: remove some dead code

PATCH In review Dan Carpenter 2 participants 2 messages Jan 7, 2017 – Jan 9, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 vfio-mdev: remove some dead code

We set info.count to 1 in mtty_get_irq_info() so static checkers complain that, "Why do we have impossible conditions?" The answer is that it seems to be left over dead code that can be safely removed.

samples/vfio-mdev/mtty.c +0 -3
index 353666d68207..d6ddc31fa729 100644
@@ -1230,9 +1230,6 @@ static long mtty_ioctl(struct mdev_device *mdev, unsigned int cmd,
 		if (ret)
 			return ret;
 
-		if (info.count = -1)
-			return -EINVAL;
-
 		if (copy_to_user((void __user *)arg, &info, minsz))
 			return -EFAULT;
 
maintainer
#1 lore raw

CC += Alex.

I think I wrote some code and then removed it, but forgot to remove this code. Thanks for cleaning up.

Reviewed by: Kirti Wankhede <[email protected]>

Thanks,
Kirti

Quoted 21 lines · Dan Carpenter

We set info.count to 1 in mtty_get_irq_info() so static checkers complain that, "Why do we have impossible conditions?" The answer is that it seems to be left over dead code that can be safely removed.

samples/vfio-mdev/mtty.c +0 -3
index 353666d68207..d6ddc31fa729 100644
@@ -1230,9 +1230,6 @@ static long mtty_ioctl(struct mdev_device *mdev, unsigned int cmd,
 		if (ret)
 			return ret;
 
-		if (info.count == -1)
-			return -EINVAL;
-
 		if (copy_to_user((void __user *)arg, &info, minsz))
 			return -EFAULT;