Re: [PATCH v2] vfio/mdev: remove unnecessary NULL check in mbochs_create()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 29, 2021 at 12:53:27PM +0300, Dan Carpenter wrote:
> Originally "type" could be NULL and these checks were required, but we
> recently changed how "type" is assigned and that's no longer the case.
> Now "type" points to an element in the middle of a non-NULL array.
> 
> Removing the checks does not affect runtime at all, but it makes the
> code a little bit simpler to read.
> 
> Fixes: 3d3a360e570616 ("vfio/mbochs: Use mdev_get_type_group_id()")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> Update the commit message
> 
>  samples/vfio-mdev/mbochs.c | 2 --
>  samples/vfio-mdev/mdpy.c | 3 +--
>  2 files changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

There are problably several of these code removal oversights.

Thanks,
Jason



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux