> On 12. Dec 2024, at 0.14, Bart Van Assche <bvanassche@xxxxxxx> wrote: > > On 11/25/24 6:02 AM, Kai Mäkisara wrote: >> + unsigned char ua_new_media_ctr; /* Counter for New Media UNIT ATTENTIONs */ >> + unsigned char ua_por_ctr; /* Counter for Power On / Reset UAs */ > > Why unsigned char instead of e.g. u16 or u32? With one of the latter two data types, no cast would be necessary in the macros below. The purpose was to save memory. (Because of the alignment rules, probably nothing is saved now compared to u16.) I will change teh counters to u16. The const casts are there to prevent the users to use the macros to change the counter values. > >> +/* Macros to access the UNIT ATTENTION counters */ >> +#define scsi_get_ua_new_media_ctr(sdev) \ >> + ((const unsigned int)(sdev->ua_new_media_ctr)) >> +#define scsi_get_ua_por_ctr(sdev) \ >> + ((const unsigned int)(sdev->ua_por_ctr)) > > Please introduce macros in the patch that introduces the first user of these macros. I don't see any users of these macros in this patch? The idea was to introduce the mechanism in one patch and the user in the next. But I will move the macros to the next patch. Thanks, Kai