* [patch 3/3] vfio-mdev: remove some dead code
@ 2017-01-07 6:30 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-01-07 6:30 UTC (permalink / raw)
To: Kirti Wankhede; +Cc: kvm, kernel-janitors
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
index 353666d68207..d6ddc31fa729 100644
--- a/samples/vfio-mdev/mtty.c
+++ b/samples/vfio-mdev/mtty.c
@@ -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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [patch 3/3] vfio-mdev: remove some dead code
@ 2017-01-07 6:30 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-01-07 6:30 UTC (permalink / raw)
To: Kirti Wankhede; +Cc: kvm, kernel-janitors
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
index 353666d68207..d6ddc31fa729 100644
--- a/samples/vfio-mdev/mtty.c
+++ b/samples/vfio-mdev/mtty.c
@@ -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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [patch 3/3] vfio-mdev: remove some dead code
2017-01-07 6:30 ` Dan Carpenter
@ 2017-01-09 18:54 ` Kirti Wankhede
-1 siblings, 0 replies; 4+ messages in thread
From: Kirti Wankhede @ 2017-01-09 18:42 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kvm, kernel-janitors, Alex Williamson
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 <kwankhede@nvidia.com>
Thanks,
Kirti
On 1/7/2017 12:00 PM, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
> index 353666d68207..d6ddc31fa729 100644
> --- a/samples/vfio-mdev/mtty.c
> +++ b/samples/vfio-mdev/mtty.c
> @@ -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;
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 3/3] vfio-mdev: remove some dead code
@ 2017-01-09 18:54 ` Kirti Wankhede
0 siblings, 0 replies; 4+ messages in thread
From: Kirti Wankhede @ 2017-01-09 18:54 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kvm, kernel-janitors, Alex Williamson
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 <kwankhede@nvidia.com>
Thanks,
Kirti
On 1/7/2017 12:00 PM, Dan Carpenter wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/samples/vfio-mdev/mtty.c b/samples/vfio-mdev/mtty.c
> index 353666d68207..d6ddc31fa729 100644
> --- a/samples/vfio-mdev/mtty.c
> +++ b/samples/vfio-mdev/mtty.c
> @@ -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;
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-09 18:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-07 6:30 [patch 3/3] vfio-mdev: remove some dead code Dan Carpenter
2017-01-07 6:30 ` Dan Carpenter
2017-01-09 18:42 ` Kirti Wankhede
2017-01-09 18:54 ` Kirti Wankhede
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.