Re: [PATCH 4/4] block: simplify tag allocation policy selection

Christoph Hellwig
2025-01-06T08:55:59Z

On Mon, Jan 06, 2025 at 08:50:20AM +0000, John Garry wrote:
>> .can_queue = SIL24_MAX_CMDS,
>> .sg_tablesize = SIL24_MAX_SGE,
>> .dma_boundary = ATA_DMA_BOUNDARY,
>> - .tag_alloc_policy = BLK_TAG_ALLOC_FIFO,
>
> nit: maybe that could be a separate patch, but no biggie

I though about that, but if felt a bit overkill.

>> + /*
>> + * Allocate tags starting from last allocated tag.
>> + */
>> + bool tag_alloc_policy_rr : 1;
>
> Is it proper to use bool here? I am not sure. Others use unsigned int or
> unsigned.

Yes, you can use any unsigned type for a single-bit bitfield. Most of
the existing uses just predate the availability of bool or were copy
and pasted after that.

>
> nit: coding style elsewhere in scsi_host_template would be to use
> "tag_alloc_policy_rr:1;"

Yes, but that's against the normal kernel coding style, so we'd better
stop adding more of that.