diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index bbede1ce818caed3f96b31d72674295906557dd0..305c6029f9b210759a2f389a4324d698db7a7c94 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -985,7 +985,6 @@ static void ide_ident(block_dev_desc_t *dev_desc)
 
 #ifdef CONFIG_ATAPI
 	int retries = 0;
-	int do_retry = 0;
 #endif
 
 #ifdef CONFIG_TUNE_PIO
@@ -1007,7 +1006,6 @@ static void ide_ident(block_dev_desc_t *dev_desc)
 	dev_desc->if_type = IF_TYPE_IDE;
 #ifdef CONFIG_ATAPI
 
-	do_retry = 0;
 	retries = 0;
 
 	/* Warning: This will be tricky to read */