Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Cyrill Gorcunov
Date: Friday, April 10, 2009 - 11:14 am

[Jaswinder Singh Rajput - Fri, Apr 10, 2009 at 11:35:29PM +0530]
| On Fri, 2009-04-10 at 19:55 +0200, Pavel Machek wrote:
| > On Fri 2009-04-10 23:06:55, Jaswinder Singh Rajput wrote:
| > > Impact: fix overflow
| > 
| > > Constant 0x123456789abcdef0 is so big for a long.
| > > So using saved_magic 0x12345678 for both 32 and 64 bit.
| > 
| > Have you tested the patch? I have feeling that this is tested from
| > assembly... Plus it is only set to long constant on 64-bit, so I don't
| > think you are fixing anything. And if your code is correct the
| > variable is write only...
| > 
| 
| I have tested this:
| 1.  CHECK   arch/x86/kernel/acpi/sleep.c
| arch/x86/kernel/acpi/sleep.c:107:16: warning: constant 0x123456789abcdef0 is so big it is long
| 
| 2. On 64 bit machine box:
| 	long l1;
| 
| 	l1 = 0x123456789abcdef0;
| 	printf("0x%16x : ", l1);
| 
| Output: 0x        9abcdef0
| 
| --
| JSR
| 
| 

"0x%lx" will help

        Cyrill
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Jaswinder Singh Rajput, (Fri Apr 10, 10:36 am)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Cyrill Gorcunov, (Fri Apr 10, 10:50 am)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Jaswinder Singh Rajput, (Fri Apr 10, 11:05 am)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Thomas Gleixner, (Fri Apr 10, 11:13 am)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Cyrill Gorcunov, (Fri Apr 10, 11:14 am)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Jaswinder Singh Rajput, (Fri Apr 10, 11:15 am)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Jaswinder Singh Rajput, (Fri Apr 10, 12:16 pm)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Jaswinder Singh Rajput, (Fri Apr 10, 12:49 pm)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Thomas Gleixner, (Fri Apr 10, 12:51 pm)
Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow, Rafael J. Wysocki, (Sun Apr 12, 10:25 am)