From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Date: Thu, 09 Jul 2020 17:25:47 +0000 Subject: Re: [PATCH] scsi: virtio_scsi: Remove unnecessary condition checks Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Markus Elfring , Xianting Tian , linux-scsi@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, "James E. J. Bottomley" , Jason Wang , "Martin K. Petersen" , "Michael S. Tsirkin" , Stefan Hajnoczi 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 > of a few statements can be avoided according to a previous > null pointer check? The point of the patch is precisely to simplify the code, executing a couple more instruction is not an issue. Paolo