The patch titled Subject: mm: memcontrol: Use the preferred form for passing the size of a structure type has been added to the -mm tree. Its filename is mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx> 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. Link: https://lkml.kernel.org/r/773e013ff2f07fe2a0b47153f14dea054c0c04f1.1596214831.git.gustavoars@xxxxxxxxxx Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memcontrol.c~mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type +++ a/mm/memcontrol.c @@ -4262,7 +4262,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 gustavoars@xxxxxxxxxx are mm-memcontrol-use-flex_array_size-helper-in-memcpy.patch mm-memcontrol-use-the-preferred-form-for-passing-the-size-of-a-structure-type.patch