Skip to content

Commit 929d2fa

Browse files
Matthew Wilcoxgregkh
Matthew Wilcox
authored andcommitted
driver core: Rearrange struct device for better packing
This minor rearrangement saves 16 bytes from sizeof(struct device) according to pahole. Signed-off-by: Matthew Wilcox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7f4f5d4 commit 929d2fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/linux/device.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,9 @@ struct device {
373373

374374
struct kobject kobj;
375375
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
376+
unsigned uevent_suppress:1;
376377
const char *init_name; /* initial name of the device */
377378
struct device_type *type;
378-
unsigned uevent_suppress:1;
379379

380380
struct semaphore sem; /* semaphore to synchronize calls to
381381
* its driver.
@@ -408,12 +408,13 @@ struct device {
408408
/* arch specific additions */
409409
struct dev_archdata archdata;
410410

411+
dev_t devt; /* dev_t, creates the sysfs "dev" */
412+
411413
spinlock_t devres_lock;
412414
struct list_head devres_head;
413415

414416
struct klist_node knode_class;
415417
struct class *class;
416-
dev_t devt; /* dev_t, creates the sysfs "dev" */
417418
struct attribute_group **groups; /* optional groups */
418419

419420
void (*release)(struct device *dev);

0 commit comments

Comments
 (0)