[pbs-devel] [PATCH proxmox-backup v2 03/14] tape/drive: clippy fixes
Dietmar Maurer
dietmar at proxmox.com
Mon Apr 19 17:46:34 CEST 2021
> > But it is though, they are from the SCSI reference
> > "Mode Parameter Header for Mode Select"
> >
> > +--+--+--+--+--+--+--+--+
> > |WP| B.MODE | SPEED |
> > +--+--+--+--+--+--+--+--+
> >
> > (write protect, buffer mode, speed)
> >
> > so this is the wrong solution, the right one would be:
> > * keep as is
> > * introduce constant like BUFFER_MODE_MASK 0b01110000 and use it negated here
>
> ^ So let's do this then.
>
> I do think this particular lint is the least useful one TBH. When working on embedded
> riscv code I was pretty much constantly fighting with it...
>
> And maybe when the base is done we should also go through all the data structures and
> add doc comments referencing the corresponding scsi documentation to make it easier
> to navigate?
Instead, I would search for a real solution, some kind of bitfield:
https://immunant.com/blog/2020/01/bitfields/
Not sure whats best ...
More information about the pbs-devel
mailing list