Re: [PATCH] Staging: bcm: Fix "cast to pointer from integer of different size" compile warning.

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

 



On Mon, Nov 5, 2012 at 1:50 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> On Sat, Nov 03, 2012 at 02:33:16PM -0400, Kevin McKinney wrote:
>> This patch fixes the following compile warning:
>> "cast to pointer from integer of different size
>> [-Wint-to-pointer-cast]" in CmHost.c. I am replacing
>> one statement with two.
>>
>> The address of the buffer locations are being
>> taken from user space and stored in three different
>> structures: pstAddIndication->AdmittedSet, pstAddIn
>> dication->ActiveSet, and pstAddIndication->AuthorizedSet.
>> Before reading the address we need to convert it to
>> little endian notation. Therefore, we create a local
>> unsigned long variable, addr_conn_params, and
>> store the results of "ntohl". This value is then
>> cast to a "bcm_connect_mgr_params" structure.
>>
>
> I don't think this is the right thing to do.  We are silencing the
> warning, but not fixing the bug.  It's better to leave the warning
> in so the bug is easier to find, when we have a proper fix for this.
>
Okay, I will keep researching.  But it just seems very strange that we
have this huge structure, and we need to convert this data from big
endian to little endian.  Typically we store addresses in an unsigned
long, right? I think this code will need to be restructured, but I
will verify that soon.  I should be able to test with the hardware
very soon.

Thanks,
Kevin
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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