Skip to contentSkip to conversation

sh: cache: remove unused but set variables in sh4_flush_cache_range

PATCH Superseded Thorsten Blum 3 participants 5 messages Apr 23 SuperH

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sh: cache: remove unused but set variables in sh4_flush_cache_range

Remove 'start' and 'end' to avoid two "variable set but not used" warnings triggered by -Wunused-but-set-variable.

---
 arch/sh/mm/cache-sh4.c | 3 ---
 1 file changed, 3 deletions(-)
arch/sh/mm/cache-sh4.c +0 -3
index 83fb34b39ca7..9776027382cc 100644
@@ -284,11 +284,8 @@ static void sh4_flush_cache_range(void *args)
 {
 	struct flusher_data *data = args;
 	struct vm_area_struct *vma;
-	unsigned long start, end;
 
 	vma = data->vma;
-	start = data->addr1;
-	end = data->addr2;
 
 	if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
 		return;
#1 lore raw

PATCH 2/2 gdrom: remove unused but set variable in gdrom_get_last_session

Remove 'lentry' to avoid a "variable set but not used" warning triggered by -Wunused-but-set-variable.

---
 drivers/cdrom/gdrom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cdrom/gdrom.c +1 -2
index 4ba4dd06cbf4..5cc830501fdf 100644
@@ -312,7 +312,7 @@ static int get_entry_track(int track)
 static int gdrom_get_last_session(struct cdrom_device_info *cd_info,
 	struct cdrom_multisession *ms_info)
 {
-	int fentry, lentry, track, data, err;
+	int fentry, track, data, err;
 
 	if (!gd.toc)
 		return -ENOMEM;
@@ -329,7 +329,6 @@ static int gdrom_get_last_session(struct cdrom_device_info *cd_info,
 	}
 
 	fentry = get_entry_track(gd.toc->first);
-	lentry = get_entry_track(gd.toc->last);
 	/* Find the first data track */
 	track = get_entry_track(gd.toc->last);
 	do {
#2 lore raw
In reply to Thorsten Blum
Quoted 2 lines · Thorsten Blum

Remove 'start' and 'end' to avoid two "variable set but not used" warnings triggered by -Wunused-but-set-variable.

Looks like the actual uses of them were removed in 654d364e26c7. 2009!

Reviewed-by on v1 1/2
#3 lore raw
In reply to Thorsten Blum
Quoted 14 lines · Thorsten Blum

Remove 'start' and 'end' to avoid two "variable set but not used" warnings triggered by -Wunused-but-set-variable.

---
 arch/sh/mm/cache-sh4.c | 3 ---
 1 file changed, 3 deletions(-)
arch/sh/mm/cache-sh4.c +0 -0
index 83fb34b39ca7..9776027382cc 100644
@@ -284,11 +284,8 @@ static void sh4_flush_cache_range(void *args)
 {

arch/sh/mm/cache-sh4.c static void sh4_flush_cache_range(void *args) · line 291

Quoted 10 lines
arch/sh/mm/cache-sh4.c +0 -3
 	struct flusher_data *data = args;
 	struct vm_area_struct *vma;
-	unsigned long start, end;
 
 	vma = data->vma;
-	start = data->addr1;
-	end = data->addr2;
 
 	if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
 		return;

Is the comment above the function considered stale too?

“START, END: Virtual Address (U0 address)” and the NOTE.

The change looks good to me.

Best Regards,
Yan, Zi

#4 lore raw
Quoted 20 lines · Zi Yan
Quoted 18 lines · Thorsten Blum

Remove 'start' and 'end' to avoid two "variable set but not used" warnings triggered by -Wunused-but-set-variable.

---
 arch/sh/mm/cache-sh4.c | 3 ---
 1 file changed, 3 deletions(-)
arch/sh/mm/cache-sh4.c +0 -1
index 83fb34b39ca7..9776027382cc 100644
@@ -284,11 +284,8 @@ static void sh4_flush_cache_range(void *args)
 {
 	struct flusher_data *data = args;
 	struct vm_area_struct *vma;
-	unsigned long start, end;
 
Quoted 8 lines

arch/sh/mm/cache-sh4.c static void sh4_flush_cache_range(void *args) · line 291

Quoted 6 lines
arch/sh/mm/cache-sh4.c +0 -2
 	vma = data->vma;
-	start = data->addr1;
-	end = data->addr2;
 
 	if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
 		return;

Is the comment above the function considered stale too?

Yes, that should be removed too. I will send a v2.

Quoted 1 line

“START, END: Virtual Address (U0 address)” and the NOTE.

I think the NOTE is still relevant as it explains why flush_dcache_all() is used.

Quoted 1 line

Thanks,
Thorsten