Skip to contentSkip to conversation

Possible no longer required cast in the function,usbhs_parse_dt in common.c

DISCUSSION Peter Chen 3 participants 5 messages Mar 17, 2015 4 messages not in the archive

lore
Share & tools
lore

Peter Chen

author
#1 lore raw
In reply to a message not in the archive
Quoted 15 lines

Greetings All,
I have been getting the below build warnings:
drivers/usb/renesas_usbhs/common.c: In function ‘usbhs_parse_dt’:
drivers/usb/renesas_usbhs/common.c:482:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dparam->type = of_id ? (u32)of_id->data : 0;
After looking into the function I am curious if the hardware is only 32 bit as if the supported hardware for this driver is then this cast is no longer required and I can send in a patch removing it. Furthermore, sorry for the simple question but I don't have access to the device specs for supported hardware so I though it would be better to ask before I send in patch fixing this issue. Thanks,
Nick

Patch is welcome, there will be comment if it is not suitable.

Peter ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

#3 lore raw
In reply to a message not in the archive
Quoted 19 lines · nick
Quoted 16 lines · Peter Chen
Quoted 15 lines

Greetings All,
I have been getting the below build warnings:
drivers/usb/renesas_usbhs/common.c: In function ‘usbhs_parse_dt’:
drivers/usb/renesas_usbhs/common.c:482:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dparam->type = of_id ? (u32)of_id->data : 0;
After looking into the function I am curious if the hardware is only 32 bit as if the supported hardware for this driver is then this cast is no longer required and I can send in a patch removing it. Furthermore, sorry for the simple question but I don't have access to the device specs for supported hardware so I though it would be better to ask before I send in patch fixing this issue. Thanks,
Nick

Quoted 5 lines
Quoted 4 lines

Patch is welcome, there will be comment if it is not suitable.

Peter

I understand that,my question was does the hardware for this driver support 64 bit.

regardless, it shouldn't produce a build warning.

Signature · 1 line
balbi
#5 lore raw
In reply to a message not in the archive
Quoted 25 lines · nick
Quoted 22 lines · Felipe Balbi
Quoted 21 lines · nick
Quoted 18 lines · Peter Chen
Quoted 15 lines

Greetings All,
I have been getting the below build warnings:
drivers/usb/renesas_usbhs/common.c: In function ‘usbhs_parse_dt’:
drivers/usb/renesas_usbhs/common.c:482:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dparam->type = of_id ? (u32)of_id->data : 0;
After looking into the function I am curious if the hardware is only 32 bit as if the supported hardware for this driver is then this cast is no longer required and I can send in a patch removing it. Furthermore, sorry for the simple question but I don't have access to the device specs for supported hardware so I though it would be better to ask before I send in patch fixing this issue. Thanks,
Nick

Patch is welcome, there will be comment if it is not suitable.

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

Peter

I understand that,my question was does the hardware for this driver support 64 bit.

regardless, it shouldn't produce a build warning.

It does for me.

yes, and I'm saying that's wrong. Regardless of the platform supporting 64bit or not, if the driver is allowed to build in 64bit configurations, there should be no warnings; if there are, they should be fixed and patches are very welcome.

Signature · 1 line
balbi
#7 lore raw
In reply to a message not in the archive
Quoted 32 lines · nick
Quoted 29 lines · nick
Quoted 26 lines · Felipe Balbi
Quoted 24 lines · nick
Quoted 16 lines · Peter Chen
Quoted 15 lines

Greetings All,
I have been getting the below build warnings:
drivers/usb/renesas_usbhs/common.c: In function ‘usbhs_parse_dt’:
drivers/usb/renesas_usbhs/common.c:482:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dparam->type = of_id ? (u32)of_id->data : 0;
After looking into the function I am curious if the hardware is only 32 bit as if the supported hardware for this driver is then this cast is no longer required and I can send in a patch removing it. Furthermore, sorry for the simple question but I don't have access to the device specs for supported hardware so I though it would be better to ask before I send in patch fixing this issue. Thanks,
Nick

Quoted 4 lines

Patch is welcome, there will be comment if it is not suitable.

Peter

I understand that,my question was does the hardware for this driver support 64 bit.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

regardless, it shouldn't produce a build warning.

It does for me.
Nick

After looking more closely it seems me are trying to convert a const void to a int. Does the data member need to be const as this may be causing the issue.

why would const have anything to do with sizes ?

Signature · 1 line
balbi
#8 lore raw
In reply to Peter Chen
Quoted 16 lines · Peter Chen
Quoted 15 lines

Greetings All,
I have been getting the below build warnings:
drivers/usb/renesas_usbhs/common.c: In function ‘usbhs_parse_dt’:
drivers/usb/renesas_usbhs/common.c:482:25: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
dparam->type = of_id ? (u32)of_id->data : 0;
After looking into the function I am curious if the hardware is only 32 bit as if the supported hardware for this driver is then this cast is no longer required and I can send in a patch removing it. Furthermore, sorry for the simple question but I don't have access to the device specs for supported hardware so I though it would be better to ask before I send in patch fixing this issue. Thanks,
Nick

Quoted 1 line

Patch is welcome, there will be comment if it is not suitable.

Sorry, but no, a patch is not welcome from Nick. You all will note that Nick is banned from vger.kernel.org and I would recommend that everyone else on the cc: here also add him to their kill-files. It will make your life much easier.

greg k-h