lkml.org 
[lkml]   [2010]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRE: [PATCH]: hpilo: fix pointer warning in ilo_ccb_setup
I guess it would have helped if I asked David what the code did, first. 
":|


-----Original Message-----
From: Prarit Bhargava [mailto:prarit@redhat.com]
Sent: Tuesday, May 25, 2010 6:10 PM
To: Andrew Morton
Cc: linux-kernel@vger.kernel.org; stable@kernel.org; Altobelli, David; Camuso, Tony
Subject: Re: [PATCH]: hpilo: fix pointer warning in ilo_ccb_setup


On 05/25/2010 05:49 PM, Andrew Morton wrote:
> On Fri, 21 May 2010 20:50:41 -0400
> Prarit Bhargava<prarit@redhat.com> wrote:
>
>
>> Fixes warning:
>>
>> drivers/misc/hpilo.c: In function ___ilo_ccb_setup___:
>> drivers/misc/hpilo.c:274: warning: cast to pointer from integer of different size
>>
>> Signed-off-by: Prarit Bhargava<prarit@redhat.com>
>>
>> diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
>> index 98ad012..b07a541 100644
>> --- a/drivers/misc/hpilo.c
>> +++ b/drivers/misc/hpilo.c
>> @@ -272,7 +272,7 @@ static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
>> return -ENOMEM;
>>
>> dma_va = (char *)data->dma_va;
>> - dma_pa = (char *)data->dma_pa;
>> + dma_pa = (char *)(&data->dma_pa);
>>
>> memset(dma_va, 0, data->dma_size);
>>
> Seems very wrong - writes to *dmp_pa will now scribble over the `struct
> ccb_data'.
>
> Probably local variable dma_pa should have type dma_addr_t.
>

Ugh ... I even passed this by a colleague at HP :/. I'll fix it up and
repost.

P.



\
 
 \ /
  Last update: 2010-05-26 00:41    [W:0.048 / U:0.544 seconds]
©2003-2014 Jasper Spaans. Advertise on this site