Skip to contentSkip to conversation

mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 14, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: memcontrol: use the preferred form for passing the size of a structure type
has been removed from the -mm tree. Its filename was
mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: "Gustavo A. R. Silva" <[email protected]>
Subject: mm: memcontrol: use the preferred form for passing the size of a structure type

Use the preferred form for passing the size of a structure type. The alternative form where the structure type is spelled out hurts readability and introduces an opportunity for a bug when the object type is changed but the corresponding object identifier to which the sizeof operator is applied is not.

---

 mm/memcontrol.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c renamed from mm/memcontrol.c~mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type +1 -1
@@ -4264,7 +4264,7 @@ static int __mem_cgroup_usage_register_e
 	new->entries[size - 1].threshold = threshold;
 
 	/* Sort thresholds. Registering of new threshold isn't time-critical */
-	sort(new->entries, size, sizeof(struct mem_cgroup_threshold),
+	sort(new->entries, size, sizeof(*new->entries),
 			compare_thresholds, NULL);
 
 	/* Find current threshold */

_

Patches currently in -mm which might be from [email protected] are