On 06/01/2025 07:58, Christoph Hellwig wrote:
On Mon, Jan 06, 2025 at 08:35:20AM +0100, Christoph Hellwig wrote:
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -378,7 +378,7 @@ static const struct scsi_host_template sil24_sht = {
.can_queue = SIL24_MAX_CMDS,
.sg_tablesize = SIL24_MAX_SGE,
.dma_boundary = ATA_DMA_BOUNDARY,
- .tag_alloc_policy = BLK_TAG_ALLOC_FIFO,
+ .tag_alloc_policy = SCSI_TAG_ALLOC_FIFO,
do we actually need to set tag_alloc_policy to the default
(SCSI_TAG_ALLOC_FIFO)?
libata uses weird inheritance where __ATA_BASE_SHT sets default fields
that can then later be override, so this is indeed needed to set the
field back to the original default after the previous assignment changed
it. (Did I mentioned I hate this style of programming? :))
It turns out the clearning is not needed here, as the driver only
uses __ATA_BASE_SHT and not ATA_BASE_SHT
Yeah, if you build with W=1, you get "initialized field overwritten"
error when trying to set a value more than once in the structure.
(did I mentioned I hate this
templating?
Sure, but it reduces lots of code. Maybe a nicer model is something like
scsi_host_alloc(), which sets defaults (when not set).
)