On Thu, 19 Apr 2018 10:10:41 +0200 Johannes Thumshirn <jthumshirn@xxxxxxx> wrote: > 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. > I wouldn't got that far; in quite some area the 'result' is build incrementally, so we cannot call set_scsi_result here. Cheers, Hannes