lkml.org 
[lkml]   [2010]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 15/20] ARM: LPAE: use phys_addr_t instead of unsigned long for physical addresses
From
On 16 November 2010 19:33, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Nov 16, 2010 at 11:14:25AM -0800, Stephen Boyd wrote:
>> On 11/15/2010 09:40 AM, Catalin Marinas wrote:
>> > @@ -188,21 +189,21 @@
>> >   * translation for translating DMA addresses.  Use the driver
>> >   * DMA support - see dma-mapping.h.
>> >   */
>> > -static inline unsigned long virt_to_phys(void *x)
>> > +static inline phys_addr_t virt_to_phys(void *x)
>> >  {
>> >     return __virt_to_phys((unsigned long)(x));
>> >  }
>>
>> As you're already in the area can you mark the argument to
>> virt_to_phys() as const? I ran into a compiler warning due to that the
>> other day.
>
> It may make sense to mark it const volatile, as that's the most
> permissive set of attributes possible (iow, it'll accept any pointer
> without warning.)  However, might be an idea to check what other
> arches do.

The majority of architectures use volatile and a few add both const
and volatile.

I usually use the generic headers as reference for function prototypes
and that's just using volatile without a const (cc'ing Arnd for any
view on this).

--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-11-17 11:51    [W:0.039 / U:0.072 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site