[PATCH] staging: wlan-ng: improved readability of function prism2_add_key

Dan Carpenter dan.carpenter at oracle.com
Wed Jun 20 20:08:29 UTC 2018


On Wed, Jun 20, 2018 at 07:10:26PM +0200, Chris Opperman wrote:
> b) Added temporary "key" variable to reduce line length.

No, that's nonsense.  Just fix the original variable so that it's not a
million characters long.

Using a shorter variable is good if it simplifies the code like so:

	struct foo *foo = &my->random_variable[INDEX].whatever;

You've reduced 4 variable names and a butt load of punctuation down to
just "foo" so that we don't have to look at it repeated over and over
on every line.

But if you're just using a temporary variable because the original
variable name was poorly chosen, that's not the right thing.

regards,
dan carpenter



More information about the devel mailing list