Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: stm32 - Drop if block with always false condition

stm32_hash_remove() is only called after stm32_hash_probe() succeeded. In
this case platform_set_drvdata() was called with a non-NULL data patameter.

The check for hdev being non-NULL can be dropped because hdev is never NULL
(or something bad like memory corruption happened and then the check
doesn't help any more either).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Uwe Kleine-König and committed by
Herbert Xu
3feec4ef aec48805

+1 -5
+1 -5
drivers/crypto/stm32/stm32-hash.c
··· 2114 2114 2115 2115 static int stm32_hash_remove(struct platform_device *pdev) 2116 2116 { 2117 - struct stm32_hash_dev *hdev; 2117 + struct stm32_hash_dev *hdev = platform_get_drvdata(pdev); 2118 2118 int ret; 2119 - 2120 - hdev = platform_get_drvdata(pdev); 2121 - if (!hdev) 2122 - return -ENODEV; 2123 2119 2124 2120 ret = pm_runtime_get_sync(hdev->dev); 2125 2121