Re: [PATCH] staging: lustre/lnet: Fix wrong type casting warning generated by sparse

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

 



On Sun, Feb 14, 2016 at 3:19 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> On Sat, Feb 13, 2016 at 11:34:35PM +0530, Niranjan Dighe wrote:
>> diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
>> index 366211e..64b6a70 100644
>> --- a/drivers/staging/lustre/lnet/selftest/console.c
>> +++ b/drivers/staging/lustre/lnet/selftest/console.c
>> @@ -1461,9 +1461,9 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg,
>>
>>       sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0];
>>       srpc_stat = (srpc_counters_t __user *)
>> -                                   ((char *)sfwk_stat + sizeof(*sfwk_stat));
>> +                             ((char __user *)sfwk_stat + sizeof(*sfwk_stat));
>
> This is uglier than necessary.  Do it either like this:
>
>         srpc_stat = (void __user *)sfwk_stat + sizeof(*sfwk_stat);
>
> Or probably it's actually nicer to say:
>
>         srpc_stat = sfwk_stat + 1;
>
> regards,
> dan carpenter
>

Yes, thanks Dan, I will send out a new patch. Please discard this one.
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux