[PATCH 12/12] blspec: fix dead assignment

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Sep 30 03:20:05 EDT 2020


cdev is assigned for each loop iteration and consumed inside.
The initial value is never read, so drop it.

Reported-by: clang-analyzer-10
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/blspec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/blspec.c b/common/blspec.c
index 9499d32477d9..a07343f4274e 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -766,7 +766,7 @@ int blspec_scan_devices(struct bootentries *bootentries)
 		device_detect(dev);
 
 	for_each_block_device(bdev) {
-		struct cdev *cdev = &bdev->cdev;
+		struct cdev *cdev;
 
 		list_for_each_entry(cdev, &bdev->dev->cdevs, devices_list) {
 			ret = blspec_scan_cdev(bootentries, cdev);
-- 
2.28.0




More information about the barebox mailing list