From: zhang jiao Date: Tue, 12 Nov 2024 08:16:37 +0000 (+0800) Subject: spi: Delete useless checks X-Git-Tag: v6.13-rc1~158^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1e7828cf9343e1da6c575f3ebaa0f511d8b8cbd;p=thirdparty%2Fkernel%2Flinux.git spi: Delete useless checks Since "res" will never be null, just delete this check. Signed-off-by: zhang jiao Link: https://patch.msgid.link/20241112081637.40962-1-zhangjiao2@cmss.chinamobile.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 74e04a4b0f196..460a49d9a0de0 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -984,9 +984,6 @@ static void spi_res_free(void *res) { struct spi_res *sres = container_of(res, struct spi_res, data); - if (!res) - return; - WARN_ON(!list_empty(&sres->entry)); kfree(sres); }