Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks

2020-07-10 Thread Paolo Bonzini
On 10/07/20 09:40, Markus Elfring wrote: >>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/virtio_scsi.c?id=42f82040ee66db13525dc6f14b8559890b2f4c1c#n980 >>> >>> if (!virtscsi_cmd_cache) { >>> pr_err("kmem_cache_create() for virtscsi_cmd_cache

Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks

2020-07-10 Thread Markus Elfring
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/virtio_scsi.c?id=42f82040ee66db13525dc6f14b8559890b2f4c1c#n980 >> >> if (!virtscsi_cmd_cache) { >> pr_err("kmem_cache_create() for virtscsi_cmd_cache failed\n"); >> -goto error; >>

Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks

2020-07-10 Thread Paolo Bonzini
On 10/07/20 08:32, Markus Elfring wrote: + mempool_destroy(virtscsi_cmd_pool); + virtscsi_cmd_pool = NULL; + kmem_cache_destroy(virtscsi_cmd_cache); + virtscsi_cmd_cache = NULL; return ret; } >>> >>> How do you think about to add a jump target so that the execu

Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks

2020-07-09 Thread Markus Elfring
>>> + mempool_destroy(virtscsi_cmd_pool); >>> + virtscsi_cmd_pool = NULL; >>> + kmem_cache_destroy(virtscsi_cmd_cache); >>> + virtscsi_cmd_cache = NULL; >>> return ret; >>> } >> >> How do you think about to add a jump target so that the execution >> of a few statements can be avoided a

Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks

2020-07-09 Thread Markus Elfring
>>> + mempool_destroy(virtscsi_cmd_pool); >>> + virtscsi_cmd_pool = NULL; >>> + kmem_cache_destroy(virtscsi_cmd_cache); >>> + virtscsi_cmd_cache = NULL; >>> return ret; >>> } >> >> How do you think about to add a jump target so that the execution >> of a few statements can be avoided a

Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks

2020-07-09 Thread Paolo Bonzini
On 09/07/20 19:16, Markus Elfring wrote: >> +mempool_destroy(virtscsi_cmd_pool); >> +virtscsi_cmd_pool = NULL; >> +kmem_cache_destroy(virtscsi_cmd_cache); >> +virtscsi_cmd_cache = NULL; >> return ret; >> } > > How do you think about to add a jump target so that the execution

Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks

2020-07-09 Thread Markus Elfring
> kmem_cache_destroy and mempool_destroy can correctly handle > null pointer parameter, so there is no need to check if the > parameter is null before calling kmem_cache_destroy and > mempool_destroy. Can another imperative wording be preferred for the change description? … > +++ b/drivers/scsi/