public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v2 03/14] tape/drive: clippy fixes
Date: Mon, 19 Apr 2021 14:09:37 +0200 (CEST)	[thread overview]
Message-ID: <1564315045.4060.1618834178000@webmail.proxmox.com> (raw)


> On 04/19/2021 11:40 AM Thomas Lamprecht <t.lamprecht@proxmox.com> wrote:
> 
>  
> On 19.04.21 10:38, Wolfgang Bumiller wrote:
> >>          if let Some(buffer_mode) = buffer_mode {
> >> -            let mut mode = head.flags3 & 0b1_000_1111;
> >> +            let mut mode = head.flags3 & 0b1000_1111;
> > ^ I really wish those bits were documented or `bitflags!`, because maybe the 1/3/4 grouping is based on meaning :S
> > But since it's not, I agree with this hunk ;-)
> 
> 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?




             reply	other threads:[~2021-04-19 12:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 12:09 Wolfgang Bumiller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-19 15:46 Dietmar Maurer
2021-04-19  9:35 Dietmar Maurer
2021-04-19  8:38 Wolfgang Bumiller
2021-04-19  9:40 ` Thomas Lamprecht
2021-04-16 10:28 [pbs-devel] [PATCH proxmox-backup v2 00/14] various " Dominik Csapak
2021-04-16 10:28 ` [pbs-devel] [PATCH proxmox-backup v2 03/14] tape/drive: " Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1564315045.4060.1618834178000@webmail.proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal