Re: [PATCH 2/2] scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k

2015-10-06 Thread Rasmus Villemoes
On Mon, Oct 05 2015, Bart Van Assche wrote: > On 10/05/15 02:26, Rasmus Villemoes wrote: >> struct error_info { >> unsigned short code12; /* 0x0302 looks better than 0x03,0x02 */ >> -const char * text; >> +unsigned short size; >> }; > > Had you

[PATCH 2/2] scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k

2015-10-05 Thread Rasmus Villemoes
On 64 bit, struct error_info has 6 bytes of padding, which amounts to over 4k of wasted space in the additional[] array. We could easily get rid of that by instead using separate arrays for the codes and the pointers. However, we can do even better than that and save an additional 6 bytes per

Re: [PATCH 2/2] scsi: reduce CONFIG_SCSI_CONSTANTS=y impact by 8k

2015-10-05 Thread Bart Van Assche
On 10/05/15 02:26, Rasmus Villemoes wrote: struct error_info { unsigned short code12; /* 0x0302 looks better than 0x03,0x02 */ - const char * text; + unsigned short size; }; Had you considered to use the type uint16_t instead of unsigned short ? Bart. -- To