Re: [PATCH] fix kzalloc in scsi device handler

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

 



On Wed, Nov 17, 2010 at 6:04 PM, Boaz Harrosh <bharrosh@xxxxxxxxxxx> wrote:
> On 11/16/2010 07:35 PM, Rolf Eike Beer wrote:
>>
>> How about:
>> Â Â Â scsi_dh_data = kzalloc(sizeof(*scsi_dh_data) + sizeof(*h), GFP_KERNEL)?
>>
>> Eike
>

I like the above, very cool :)

> I always prefer this form because this way I have all the information in
> that single statement. I'm allocating space for scsi_dh_data for what ever
> that would be. The other form I have to go looking up to see what is
> scsi_dh_data's type and there is place for error.
>
> Naturally for above it would follow:
> Â Â Â Âh = typeof(h)(scsi_dh_data + 1);
>
> My $0.017
> Boaz
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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