Re: [PATCH v2 01/14] mpt3sas: Bug fix for big endian systems.

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

 



Hi Chaitra,

>>  		for (i = 0; i < ioc->combined_reply_index_count; i++) {
>> -			ioc->replyPostRegisterIndex[i] = (resource_size_t
> *)
>> -			     ((u8 *)&ioc->chip->Doorbell +
>> +			ioc->replyPostRegisterIndex[i] =
>> +			    (volatile void __iomem *)
>> +			     ((u8 __force *)&ioc->chip->Doorbell +
>>  			     MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET +
>>  			     (i *
> MPT3_SUP_REPLY_POST_HOST_INDEX_REG_OFFSET));
>
> Why the double type casts? You've already changed replyPostRegisterIndex
> to be 'volatile void __iomem **' in the header file. So why not:
>
>                         ioc->replyPostRegisterIndex[i] =
>                                 &ioc->chip->Doorbell +
>                                 MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET +
>                                 i * MPT3_SUP_REPLY_POST_HOST_INDEX_REG_OFFSET;

You didn't address my question about why the type casts were required in
the first place? I get cautious when I see nested casting...

> Also looks like ioc->reply_post_host_index handling a few lines further
> down could lose the type casts.

See above.

-- 
Martin K. Petersen	Oracle Linux Engineering



[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