kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks
@ 2020-07-09 17:16 Markus Elfring
  2020-07-09 17:25 ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Elfring @ 2020-07-09 17:16 UTC (permalink / raw)
  To: Xianting Tian, linux-scsi, virtualization
  Cc: kernel-janitors, linux-kernel, James E. J. Bottomley, Jason Wang,
	Paolo Bonzini, Martin K. Petersen, Michael S. Tsirkin,
	Stefan Hajnoczi

> 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/virtio_scsi.c
> @@ -1003,14 +1003,10 @@ static int __init init(void)
>  	return 0;
>
>  error:

Can such a label be questionable?


…
> +	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 according to a previous
null pointer check?

Regards,
Markus

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-10  8:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-09 17:16 [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks Markus Elfring
2020-07-09 17:25 ` Paolo Bonzini
2020-07-09 20:55   ` Markus Elfring
2020-07-10  6:32   ` Markus Elfring
2020-07-10  7:17     ` Paolo Bonzini
2020-07-10  7:40       ` Markus Elfring
2020-07-10  7:46         ` Paolo Bonzini
2020-07-10  8:11           ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).