Re: …: Reduce scope for the variable “…” in …()

Markus Elfring Markus.Elfring at
Mon Dec 14 05:27:47 EST 2020

> Probably the other people are right that making scopes shorter is more
> important when the function is very long.

How much will sizes of function implementations influence the acceptance
for possible source code refactorings?

* Would you find another conversion of an extra null pointer initialisation
  to a later variable definition helpful then at other places?

  [PATCH] dm snapshot: Reduce scope for the variable “pe” in snapshot_map()

* How do you think about to omit the initialisation for the variable “ret”
  in the implementation of the function “w1_uevent”
  (because it will be reassigned by a function call a bit later)?

  Would any adjustment with the tag “Addresses-Coverity: ("Unused value")”
  become relevant here?


More information about the linux-arm-kernel mailing list