[PATCH 1/2] fbdev: Move two variable assignments in fb_alloc_cmap_gfp()

Markus Elfring Markus.Elfring at web.de
Thu May 25 05:02:44 UTC 2023


>> Move the assignment for the local variables “size” and “flags”
>> because the computed values were only used in a single if branch.
>
> Please do not move such variables without real need.

Is there a need to explain desirable effects better?


> It makes backporting (of this and maybe follow-up patches) much more complicated

I suggest to reconsider such development concerns a bit more.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/drivers/video/fbdev/core/fbcmap.c?h=v6.4-rc3


> and the compiler will optimize it anyway.

How much do expectations fit to supported and documented software optimisations?

Regards,
Markus


More information about the dri-devel mailing list