Re: [PATCH] scsi: qla2xxx: avoid stack frame size warning in qla_dfs
From: Arnd Bergmann
Date: Fri Jun 20 2025 - 10:47:18 EST
On Fri, Jun 20, 2025, at 15:34, ALOK TIWARI wrote:
> On 6/20/2025 5:09 PM, Arnd Bergmann wrote:
>
> remove extra " " after pd
Done
>> + "Failed to allocate port database structure.\n");
>> + goto done_free_sp;
>
> -> goto done
> as pd is NULL it wont called dma_pool_free at all.
> dma_pool_free, trying to free a pd (NULL) confusing.
Done
>> + memset(&mc, 0, sizeof(mc));
>> + mc.mb[0] = MBC_GET_PORT_DATABASE;
>> + mc.mb[1] = loop_id;
>> + mc.mb[2] = MSW(pd_dma);
>> + mc.mb[3] = LSW(pd_dma);
>> + mc.mb[6] = MSW(MSD(pd_dma));
>> + mc.mb[7] = LSW(MSD(pd_dma));
>> + mc.mb[9] = vha->vp_idx;
>> + mc.mb[10] = 0;
>
> seems Redundant, as already called memset ?
Done reluctantly: I see the driver is a bit inconsistent here,
with some functions skipping the memset() and initializing all
array entries, some functions do both, and rely on the memset
but skip the individual fields.
The compiler should be smart enough produce the same result
in any of those combinations at least for small structures,
so to me this is mostly about documenting what fields are
actually being accessed by the firmware later.
Arnd