software node: Imply kobj_to_swnode() to be no-op
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 29 Mar 2021 15:12:05 +0000 (18:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 11:18:22 +0000 (13:18 +0200)
Since we don't use structure field layout randomization
the manual shuffling can affect some macros, in particular
kobj_to_swnode(), which becomes a no-op when kobj member
is the first one in the struct swnode.

Bloat-o-meter statistics for swnode.o:

  add/remove: 0/0 grow/shrink: 2/10 up/down: 9/-100 (-91)
  Total: Before=7217, After=7126, chg -1.26%

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210329151207.36619-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/swnode.c

index 082e0b07e5c3fffc405eb5af8b00cee578fcc647..740333629b4202f4a109721f6166700a3732c93f 100644 (file)
 #include <linux/slab.h>
 
 struct swnode {
-       int id;
        struct kobject kobj;
        struct fwnode_handle fwnode;
        const struct software_node *node;
+       int id;
 
        /* hierarchy */
        struct ida child_ids;