Re: [PATCH 3/8] scsi: don't memset the entire scsi_cmnd in scsi_init_command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/02/2022 12:39, Christoph Hellwig wrote:
On Wed, Feb 23, 2022 at 12:21:10PM +0000, John Garry wrote:
I am just wondering did you consider using struct_group() for safety?

I don't think the scsi_cmnd members have special ordering apart from
co-locating related members.

Here's how it could look (on top of yours):

Besides being ugly as hell I don't see the benefit.  Quite contrary,
a lot of these fields are properly initialized later and we can drop
the zeroing as well, but I'd rather do that separately and with a proper
audit.

.

ok, fine - so the init may be removed later.

For the record, advantages now could include:
- prob more efficient
- somewhat safer coding practice
- more condense C code

But, for sure, it's not so pretty to have this sub-struct.

Anyway, I don't feel too strongly about it and it was just a suggestion.

Thanks,
John



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux