From: Larry F. <Lar...@lw...> - 2012-05-11 19:51:53
|
On 05/11/2012 02:40 PM, Stefan Weil wrote: > Am 11.05.2012 18:56, schrieb Larry Finger: >> The previous patch left some warnings on 64-bit systems that are now >> removed. >> >> Signed-off-by: Larry Finger <Lar...@lw...> >> --- >> common.c | 3 ++- >> merge.c | 22 +++++++++++----------- >> 2 files changed, 13 insertions(+), 12 deletions(-) >> >> diff --git a/common.c b/common.c >> index 2f1b338..25fbc27 100644 >> --- a/common.c >> +++ b/common.c >> @@ -1118,7 +1118,8 @@ static int acx100_create_dma_regions(acx_device_t * adev) >> #ifdef CONFIG_ACX_MAC80211_MEM >> else if (IS_MEM(adev)) { >> /* sets the beginning of the rx descriptor queue, after the tx descrs */ >> - adev->acx_queue_indicator = (queueindicator_t *) le32_to_cpu >> (queueconf.QueueEnd); >> + adev->acx_queue_indicator = (queueindicator_t *) >> + (ulong)le32_to_cpu(queueconf.QueueEnd); > > How can this and the other conversion (see rest of patch) of a 32 bit > numeric value to a 64 bit pointer work? > > Maybe it works on a 64 bit host which only uses memory addresses in the > first 4 GiB, but I don't expect that this is really safe for any host. > > For those cases where conversions from numeric values to pointers need > a type cast, (uintptr_t) or (intptr_t) would be better, because those > data types are specially designed to have the same size as a pointer. Thanks for the comment. I was not aware of those particular type casts. My test box has only 2 GB RAM, and I certainly cannot test for memory > 4 GB. I will respin the patch and the one that did not go to the list. It will have the same problems. Larry |