Skip to contentSkip to conversation

Remove unused variable in ktrace_free()

PATCH In review Lachlan McIlroy 3 participants 3 messages Dec 4, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove unused variable in ktrace_free()

entries_size is probably left over from when we used to pass the size to kmem_free().

fs/xfs/support/ktrace.c +2 -7
@@ -113,21 +113,16 @@ ktrace_alloc(int nentries, unsigned int
  void
  ktrace_free(ktrace_t *ktp)
  {
-	int     entries_size;
-
  	if (ktp == (ktrace_t *)NULL)
  		return;
 
  	/*
  	 * Special treatment for the Vnode trace buffer.
  	 */
-	if (ktp->kt_nentries == ktrace_zentries) {
+	if (ktp->kt_nentries == ktrace_zentries)
  		kmem_zone_free(ktrace_ent_zone, ktp->kt_entries);
-	} else {
-		entries_size = (int)(ktp->kt_nentries * sizeof(ktrace_entry_t));
-
+	else
  		kmem_free(ktp->kt_entries);
-	}
 
  	kmem_zone_free(ktrace_hdr_zone, ktp);
  }

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#2 lore raw
In reply to Lachlan McIlroy
Quoted 2 lines · Lachlan McIlroy

entries_size is probably left over from when we used to pass the size to kmem_free().

Quoted 27 lines
fs/xfs/support/ktrace.c +2 -7
@@ -113,21 +113,16 @@ ktrace_alloc(int nentries, unsigned int
  void
  ktrace_free(ktrace_t *ktp)
  {
-	int     entries_size;
-
  	if (ktp == (ktrace_t *)NULL)
  		return;
 
  	/*
  	 * Special treatment for the Vnode trace buffer.
  	 */
-	if (ktp->kt_nentries == ktrace_zentries) {
+	if (ktp->kt_nentries == ktrace_zentries)
  		kmem_zone_free(ktrace_ent_zone, ktp->kt_entries);
-	} else {
-		entries_size = (int)(ktp->kt_nentries * sizeof(ktrace_entry_t));
-
+	else
  		kmem_free(ktp->kt_entries);
-	}
 
  	kmem_zone_free(ktrace_hdr_zone, ktp);
  }
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs