All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: BALATON Zoltan <balaton@eik.bme.hu>,
	Richard Henderson <richard.henderson@linaro.org>
Cc: Fam Zheng <fam@euphon.net>,
	pbonzini@redhat.com, laurent@vivier.eu, qemu-block@nongnu.org,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 3/6] scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh
Date: Sun, 24 Apr 2022 15:50:41 +0100	[thread overview]
Message-ID: <3ce8410f-e908-f2e3-78e9-d858970ad190@ilande.co.uk> (raw)
In-Reply-To: <d98967a-4521-591f-f7b-d6c12eed353a@eik.bme.hu>

On 21/04/2022 23:00, BALATON Zoltan wrote:

> On Thu, 21 Apr 2022, Richard Henderson wrote:
>> On 4/21/22 08:29, Mark Cave-Ayland wrote:
>>>> You need (1 << SCSI_DISK_QUIRK_MODE_PAGE_APPLE) instead.
>>>
>>> Doh, you're absolutely right. I believe the current recommendation is to use the 
>>> BIT() macro in these cases.
> 
> I think it's not a recommendation (as in code style) but it often makes things 
> simpler by reducing the number of parenthesis so using it is probably a good idea for 
> readability. But if you never need the bit number only the value then you could 
> define the quirks constants as that in the first place. (Otherwise if you want bit 
> numbers maybe make it an enum.)
> 
>> We probably need to fix BIT() to use 1ULL.
>>
>> At present it's using 1UL, to match the other (unfortunate) uses of unsigned long 
>> within bitops.h.  The use of BIT() for things unrelated to bitops.h just bit a 
>> recent risc-v pull request, in that it failed to build on all 32-bit hosts.
> 
> There's already a BIT_ULL(nr) when ULL is needed but in this case quirks was declared 
> uint32_t so probably OK with UL as well. (Was this bitops.h taken from Linux? Keeping 
> it compatible then may be a good idea to avoid confusion.)

It seems there is still a bit of discussion around using BIT() here, so for v2 I'll 
add the shift directly with (1 << x). Then if the BIT() macro becomes suitable for 
more general use it can easily be updated as a separate patch later.


ATB,

Mark.


  reply	other threads:[~2022-04-24 14:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  6:51 [PATCH 0/6] scsi: add support for FORMAT UNIT command and quirks Mark Cave-Ayland
2022-04-21  6:51 ` [PATCH 1/6] scsi-disk: add FORMAT UNIT command Mark Cave-Ayland
2022-05-30 14:23   ` Philippe Mathieu-Daudé via
2022-04-21  6:51 ` [PATCH 2/6] scsi-disk: add new quirks bitmap to SCSIDiskState Mark Cave-Ayland
2022-04-21  6:51 ` [PATCH 3/6] scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh Mark Cave-Ayland
2022-04-21 13:27   ` Fam Zheng
2022-04-21 15:29     ` Mark Cave-Ayland
2022-04-21 18:11       ` Richard Henderson
2022-04-21 22:00         ` BALATON Zoltan
2022-04-24 14:50           ` Mark Cave-Ayland [this message]
2022-04-21  6:51 ` [PATCH 4/6] q800: implement compat_props to enable quirk_mode_page_apple for scsi-hd devices Mark Cave-Ayland
2022-04-21  6:51 ` [PATCH 5/6] q800: add default vendor, product and version information " Mark Cave-Ayland
2022-04-21  6:51 ` [PATCH 6/6] q800: add default vendor, product and version information for scsi-cd devices Mark Cave-Ayland
2022-04-24 14:54 ` [PATCH 0/6] scsi: add support for FORMAT UNIT command and quirks Mark Cave-Ayland

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=3ce8410f-e908-f2e3-78e9-d858970ad190@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=balaton@eik.bme.hu \
    --cc=fam@euphon.net \
    --cc=laurent@vivier.eu \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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.