On Wed, Apr 18, 2018 at 04:00:43PM +0000, Bart Van Assche wrote: > Thank you for having come up with this so quickly. Something I do not > like about this patch series is that several new very short helper functions > are introduced, e.g. set_scsi_result(), clear_scsi_result(), to_scsi_result() > and from_scsi_result(). If we would make scsi_result a union of a 32-bit > integer and a struct with the driver, host, msg and status bytes then we > would not need any of these new helper functions. Additionally, that approach > would allow us to eliminate the {set,get}_{driver,host,msg,status}_byte() > functions. Honestly I don't really like these mini accessor functions as well. But when using a union we loose all the benefits of the enums as drivers still can touch the compound result value. I like Hannes' idea of gettting rid of clear_scsi_result() and use set_scsi_result() for it. This way we zap one of these helpers. Actually we could even use it for all and thus could eliminate all the set_{host,driver,msg}_byte() accessors. Thanks, Johannes -- Johannes Thumshirn Storage jthumshirn@xxxxxxx +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850