public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [tip:x86/headers] x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined
       [not found] <tip-bf33a70a73876b163d62612e9567cbac6604ba7e@kernel.org>
@ 2009-02-13 20:14 ` H. Peter Anvin
  2009-02-13 21:36   ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2009-02-13 20:14 UTC (permalink / raw)
  To: hpa, mingo, James.Bottomley, tglx, mingo, linux-kernel; +Cc: linux-tip-commits

James Bottomley wrote:
>  arch/x86/include/asm/io.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index e5a2ab4..4f8e820 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -125,7 +125,7 @@ static inline void *phys_to_virt(phys_addr_t address)
>  /*
>   * ISA I/O bus memory addresses are 1:1 with the physical address.
>   */
> -#define isa_virt_to_bus virt_to_phys
> +#define isa_virt_to_bus (unsigned long)virt_to_phys
>  #define isa_page_to_bus page_to_phys
>  #define isa_bus_to_virt phys_to_virt
>  

This changes one token to multiple, and not even with the highest
precedence.

It needs to be something like:

#define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))

... if we're going to do that.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tip:x86/headers] x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined
  2009-02-13 20:14 ` [tip:x86/headers] x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined H. Peter Anvin
@ 2009-02-13 21:36   ` James Bottomley
  2009-02-13 22:51     ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2009-02-13 21:36 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: mingo, tglx, mingo, linux-kernel, linux-tip-commits

On Fri, 2009-02-13 at 12:14 -0800, H. Peter Anvin wrote:
> James Bottomley wrote:
> >  arch/x86/include/asm/io.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> > index e5a2ab4..4f8e820 100644
> > --- a/arch/x86/include/asm/io.h
> > +++ b/arch/x86/include/asm/io.h
> > @@ -125,7 +125,7 @@ static inline void *phys_to_virt(phys_addr_t address)
> >  /*
> >   * ISA I/O bus memory addresses are 1:1 with the physical address.
> >   */
> > -#define isa_virt_to_bus virt_to_phys
> > +#define isa_virt_to_bus (unsigned long)virt_to_phys
> >  #define isa_page_to_bus page_to_phys
> >  #define isa_bus_to_virt phys_to_virt
> >  
> 
> This changes one token to multiple, and not even with the highest
> precedence.

Yes, well, it was just a verifying patch, really.

> It needs to be something like:
> 
> #define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))
> 
> ... if we're going to do that.

Actually, it probably wants to become a static inline ... that way the
compiler can always verify the promotion and truncation is legal
regardless of whether an actual user is compiled or not.

James



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tip:x86/headers] x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined
  2009-02-13 21:36   ` James Bottomley
@ 2009-02-13 22:51     ` H. Peter Anvin
  2009-02-14  7:36       ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2009-02-13 22:51 UTC (permalink / raw)
  To: James Bottomley; +Cc: mingo, tglx, mingo, linux-kernel, linux-tip-commits

James Bottomley wrote:
> On Fri, 2009-02-13 at 12:14 -0800, H. Peter Anvin wrote:
>> James Bottomley wrote:
>>
>> #define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))
>>
>> ... if we're going to do that.
> 
> Actually, it probably wants to become a static inline ... that way the
> compiler can always verify the promotion and truncation is legal
> regardless of whether an actual user is compiled or not.
> 

Yes, that's the right thing to do.  I'll fix it up and commit a patch.

	-hpa


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tip:x86/headers] x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined
  2009-02-13 22:51     ` H. Peter Anvin
@ 2009-02-14  7:36       ` Ingo Molnar
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2009-02-14  7:36 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: James Bottomley, mingo, tglx, linux-kernel, linux-tip-commits


* H. Peter Anvin <hpa@zytor.com> wrote:

> James Bottomley wrote:
>> On Fri, 2009-02-13 at 12:14 -0800, H. Peter Anvin wrote:
>>> James Bottomley wrote:
>>>
>>> #define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))
>>>
>>> ... if we're going to do that.
>>
>> Actually, it probably wants to become a static inline ... that way the
>> compiler can always verify the promotion and truncation is legal
>> regardless of whether an actual user is compiled or not.
>>
>
> Yes, that's the right thing to do.  I'll fix it up and commit a patch.

Yeah, sure - nevertheless i committed the obvious build fix first.

And as i said, the whole pointer magic construct in aha1542 is a borderline
bug, and if anything like that pops up in non-utter-legacy code it should
be cleaned up anyway.

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-14  7:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <tip-bf33a70a73876b163d62612e9567cbac6604ba7e@kernel.org>
2009-02-13 20:14 ` [tip:x86/headers] x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined H. Peter Anvin
2009-02-13 21:36   ` James Bottomley
2009-02-13 22:51     ` H. Peter Anvin
2009-02-14  7:36       ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox