Re: [VERY EARLY RFC 00/13] Rework SCSI results handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux