Skip to content

Commit

Permalink
ata: optimize struct ata_force_param size
Browse files Browse the repository at this point in the history
Optimize struct ata_force_param size by:
- using u8 for cbl and spd_limit fields
- using u16 for lflags field

Code size savings on m68k arch using (modified) atari_defconfig:

   text    data     bss     dec     hex filename
before:
  41064     573      40   41677    a2cd drivers/ata/libata-core.o
after:
  40654     573      40   41267    a133 drivers/ata/libata-core.o

Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
bzolnier authored and axboe committed Mar 26, 2020
1 parent bbf5a09 commit 8ba5a45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ atomic_t ata_print_id = ATOMIC_INIT(0);

struct ata_force_param {
const char *name;
unsigned int cbl;
int spd_limit;
u8 cbl;
u8 spd_limit;
unsigned long xfer_mask;
unsigned int horkage_on;
unsigned int horkage_off;
unsigned int lflags;
u16 lflags;
};

struct ata_force_ent {
Expand Down
1 change: 1 addition & 0 deletions include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ enum {
ATA_DEV_NONE = 11, /* no device */

/* struct ata_link flags */
/* NOTE: struct ata_force_param currently stores lflags in u16 */
ATA_LFLAG_NO_HRST = (1 << 1), /* avoid hardreset */
ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */
ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */
Expand Down

0 comments on commit 8ba5a45

Please sign in to comment.