all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Wolfgang Bumiller <w.bumiller@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 11:40:30 +0200	[thread overview]
Message-ID: <39cf646b-3e48-4aa6-eeac-c574ed5784f9@proxmox.com> (raw)
In-Reply-To: <1839417922.3844.1618821531697@webmail.proxmox.com>

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
* use bitflags or the like

When reading the actual code and having the SCSI reference open (which is a must
when working on such code anyway) it's actually quite clear what the intention
is.




  reply	other threads:[~2021-04-19  9:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  8:38 Wolfgang Bumiller
2021-04-19  9:40 ` Thomas Lamprecht [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-19 15:46 Dietmar Maurer
2021-04-19 12:09 Wolfgang Bumiller
2021-04-19  9:35 Dietmar Maurer
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=39cf646b-3e48-4aa6-eeac-c574ed5784f9@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=w.bumiller@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal