[uClinux-dev] uart issues on coldfire platform

2009-07-01 Thread Lanttor

 Hi,

 I find one issue of UART on my coldfire platforms (mcf54451evb board).
 I use the linux-2.6.29, and use drivers/serial/mcf.c and
 drivers/serial/serial_core.c as my uart driver source.

 Following is my test steps -- run command: cat /proc/interrupts two
 times contiguously.

 [r...@freescale /]# cat /proc/interrupts
 M5445X*90:   5099 UART*
 M5445X96:   3130 timer0
 M5445X99:  0 timer3
 M5445X   100:   1569 fec(TXF)
 M5445X   101:  0 fec(TXB)
 M5445X   102:  0 fec(TXFIFO)
 M5445X   103:  0 fec(TXCR)
 M5445X   104:   3098 fec(RXF)
 M5445X   105:  0 fec(RXB)
 M5445X   106: 41 fec(MII)
 M5445X   107:  0 fec(LC)
 M5445X   108:  0 fec(HBERR)
 M5445X   109:  0 fec(GRA)
 M5445X   110:  0 fec(EBERR)
 M5445X   111:  0 fec(BABT)
 M5445X   112:  0 fec(BABR)
 [r...@freescale /]# cat /proc/interrupts
 M5445X*90:   5714 UART*
 M5445X96:   3700 timer0
 M5445X99:  1 timer3
 M5445X   100:   1574 fec(TXF)
 M5445X   101:  0 fec(TXB)
 M5445X   102:  0 fec(TXFIFO)
 M5445X   103:  0 fec(TXCR)
 M5445X   104:   3108 fec(RXF)
 M5445X   105:  0 fec(RXB)
 M5445X   106: 47 fec(MII)
 M5445X   107:  0 fec(LC)
 M5445X   108:  0 fec(HBERR)
 M5445X   109:  0 fec(GRA)
 M5445X   110:  0 fec(EBERR)
 M5445X   111:  0 fec(BABT)
 M5445X   112:  0 fec(BABR)

 I find that the interrupts for above operation is 5714 - 5099 = 605
 Is it normal? (my opinion it's too much)

 I test it on the mcf5329 board, it has the same-like result (even more 605).
 Actually I don't modify any code of mcf.c and serial_core.c, but I don't
 know why so much interrupts are occurred through one operation?

 Regards,
 Lanttor



   
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] uart issues on coldfire platform

2009-07-01 Thread microbit
Hi,

Wouldn't the mere output on your console cause UART transmit interrupts for
each character anyway ?
(I can't imagine that the debug console is polled.. ? :-)
The amount of console data would equate to 500+ TX interrupts, so AFAIK
that would make sense.
Unless the UART has a FIFO and the code *explicitly* empties the FIFO from
within the serial ISR,
which could be -say - 16 times less interrupts.

Do I have this right ?

I wonder myself actually as I'm very new to uClinux, but I only work on
ARM9 target for the moment.
(which will be the subject of a question I would like to post, hence this
reply is also a test if I _can_
post here already :-)

Best Regards,
Kris

On Wed, 01 Jul 2009 14:30:54 +0800, Lanttor lanttor@freescale.com
wrote:
 Hi,

 I find one issue of UART on my coldfire platforms (mcf54451evb board).
 I use the linux-2.6.29, and use drivers/serial/mcf.c and
 drivers/serial/serial_core.c as my uart driver source.

 Following is my test steps -- run command: cat /proc/interrupts two
 times contiguously.

 [r...@freescale /]# cat /proc/interrupts
 M5445X*90:   5099 UART*
 M5445X96:   3130 timer0
 M5445X99:  0 timer3
 M5445X   100:   1569 fec(TXF)
 M5445X   101:  0 fec(TXB)
 M5445X   102:  0 fec(TXFIFO)
 M5445X   103:  0 fec(TXCR)
 M5445X   104:   3098 fec(RXF)
 M5445X   105:  0 fec(RXB)
 M5445X   106: 41 fec(MII)
 M5445X   107:  0 fec(LC)
 M5445X   108:  0 fec(HBERR)
 M5445X   109:  0 fec(GRA)
 M5445X   110:  0 fec(EBERR)
 M5445X   111:  0 fec(BABT)
 M5445X   112:  0 fec(BABR)
 [r...@freescale /]# cat /proc/interrupts
 M5445X*90:   5714 UART*
 M5445X96:   3700 timer0
 M5445X99:  1 timer3
 M5445X   100:   1574 fec(TXF)
 M5445X   101:  0 fec(TXB)
 M5445X   102:  0 fec(TXFIFO)
 M5445X   103:  0 fec(TXCR)
 M5445X   104:   3108 fec(RXF)
 M5445X   105:  0 fec(RXB)
 M5445X   106: 47 fec(MII)
 M5445X   107:  0 fec(LC)
 M5445X   108:  0 fec(HBERR)
 M5445X   109:  0 fec(GRA)
 M5445X   110:  0 fec(EBERR)
 M5445X   111:  0 fec(BABT)
 M5445X   112:  0 fec(BABR)

 I find that the interrupts for above operation is 5714 - 5099 = 605
 Is it normal? (my opinion it's too much)

 I test it on the mcf5329 board, it has the same-like result (even more
 605).
 Actually I don't modify any code of mcf.c and serial_core.c, but I don't
 know why so much interrupts are occurred through one operation?

 Regards,
 Lanttor



   
 ___
 uClinux-dev mailing list
 uClinux-dev@uclinux.org
 http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
 This message was resent by uclinux-dev@uclinux.org
 To unsubscribe see:
 http://mailman.uclinux.org/mailman/options/uclinux-dev
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] port to Olimex SAM9-L9260 ( boot fsck: fsck.jffs2: not found message)

2009-07-01 Thread Microbit_P43000
Hi all,

I'm new to this list and (uC)linux overall.

However, with some persistence (and great interest in uClinux :-) I got the 
uCLinux-dist
(20080808) ported and running smoothly on the Olimex SAM9-L9260 board
(similar to Atmel AT91SAM9260-EK).

I don't know yet how to go about patches or implementing something so my effort 
can be
incorporated into future versions. I expanded the Kernel config so you can 
select the
board there.

I should enunciate that I'm not posting to cop out on a problem, on the 
contrary, I want
to learn as much as possible about (uC)linux under the bonnet :-)

My actual question is about the start up and init :
The original included Linux has root file image that goes into the 512 MB Flash.
There are/were a few bizarre error messages on booting that I can't get rid 
of. Since I
now run a completely different kernel and these messages stay, they must result 
from some
file or script somewhere on the JFFS root image.

I have spent days on scouring through all the init.d scripts and what have you, 
and I
still can't find the source of these pests

Is there anyone here that could help me, or maybe even someone that uses 
AT91SAM9 ?

The most bizarre message on boot I get is :

Checking root file system...fsck 1.40-WIP (14-Nov-2006)
fsck: fsck.jffs2: not found
fsck: Error 2 while executing fsck.jffs2 for /dev/mtdblock1
done.

I can't find for the life of me where it is invoked.

I also can't figure out how to stop these occasional messages :
JFFS2 notice: (863) check_node_data: wrong data CRC in data node at 0x149fed7c: 
read.
{although I've set the noise level in the kernel config to 0 (debug) for 
JFFS2,
this starts after I have modified file/files on the JFFS2 image}.

Lastly, is there anyone that can give a push in the right direction how to turn 
off this
time consuming Flash check after init boot, resulting in the  Empty flash at 
0x0c89630c
ends at 0x0c896800and the likes. These are before the init freed log.




I include a recent boot log for reference if anyone can give a hint :


RomBOOT

AT91Bootstrap loading from 0x8400...
 
U-Boot 1.3.4-1-g8ed2f5f-dirty (Aug 20 2008 - 18:26:55)

DRAM:  64 MB
NAND:  512 MiB
DataFlash:AT45DB161
Nb pages:   4096
Page Size:528
Size= 2162688 bytes
Logical address: 0xD000
Area 0: D000 to D00041FF (RO) Bootstrap
Area 1: D0004200 to D00083FF  Environment
Area 2: D0008400 to D0041FFF (RO) U-Boot
Area 3: D0042000 to D0251FFF  Kernel
Area 4: D0252000 to D020  FS
In:serial
Out:   serial
Err:   serial
Net:   macb0
macb0: link up, 100Mbps full-duplex (lpa: 0x45e1)
Hit any key to stop autoboot:  3  2  1  0 
## Booting kernel from Legacy Image at 2220 ...
   Image Name:   Linux-2.6.25-uc0-my_uClinux
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:1486708 Bytes =  1.4 MB
   Load Address: 20008000
   Entry Point:  20008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing
Linux.
 done, booting the kernel.
Linux version 2.6.25-uc0-my_uClinux (k...@ubuntu) (gcc version 4.2.3 (Sourcery 
G++ Lite
2008q1-126)) #12 Tue Jun 30 04:14:19 BST 2009
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
Machine: Olimex SAM9-L9260
Memory policy: ECC disabled, Data cache writeback
Clocks: CPU 180 MHz, master 90 MHz, main 18.432 MHz
CPU0: D VIVT write-back cache
CPU0: I cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw 
rootfstype=jffs2
AT91: 96 gpio irqs in 3 banks
PID hash table entries: 256 (order: 8, 1024 bytes)
Console: colour dummy device 80x30
console [ttyS0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61824KB available (2760K code, 210K data, 104K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 152 bytes
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NetWinder Floating Point Emulator V0.97 (double precision)
audit: initializing netlink socket (disabled)
type=2000 audit(0.530:1): initialized
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered

Re: [uClinux-dev] new I2C driver model and fixed I2C bus number

2009-07-01 Thread Sujit Karataparambil
 I'm currently working on a driver for an I2C device (which is a bridge to SPI,
 just FYI) using the new driver model with probe/remove. My used uClinux
 version is 20080808. As this is done on a board (Coldfire 5208) with a fixed
 configuration I added a new I2C_BOARD_INFO to my i2c_board_info.
 But after loading the driver module for the new device, my probe function
 doesn't get called. After some investigations I found out that the I2C bus
 num doesn't match the preconfigured one during driver-device comparison, so
 my statically declared list of devices is useless.

using an default case might be usefull. use the device information for
the current
device to be the default. IF you want to find the actual device
configuration boot
the system with the following program.

/proc/spi/tx
/proc/spi/rx

__init module_i2c_boot(){
//use port information.
   }

__cleanup module_i2c_unplug(){
   //use port information.
   }

Try and compile the information.

 I check other I2C bus implementations and found that their bus numbers are
 configured in a platform device. But the I2C Bus driver for Coldfires doesn't
 support this. I work around my problem by setting the adapter number to 0 and
 call i2c_add_numbered_adapter instead.

Look at these only when the above situation is working.

 Now i figured other things:
 * I must not specify the pcf8563 rtc and tmp101 in the i2c_board_info.
 Otherweise they weren't detected. They seem to use the old driver model. Is
 this behavior as expected?
 * Other I2C bus drivers are using platform devices for specifying the bus
 number. But in the meanwhile compared to 20090520 e.g. i2c-mpc does not
 support the bus number any more. Is this intended? How can I declare a static
 list of I2C devices then?

No Idea? Could not understand what you said?



-- 
-- Sujit K M
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] howto build application with stack check use GCC?

2009-07-01 Thread Robin Getz
On Tue 30 Jun 2009 23:54, Haitao Zhang pondered:
 Hi,
 
 in mmu less system, stack overflow is extremely danger for userland 
application,
 so i just try to take advantage from using GCC stack check options,
 BTW: our system is running on a ARM7TDMI, mmuless platform,
 and we use GCC 4.3.3, also build userland to use ARM EABI,
 
 Here are my questions:
 1. in old GCC 3.x series, there is a -mapcs-stack-check,
 but once GCC and ARM ABI upgraded to use AAPCS,
 seems there is no such option like -maapcs-stack-check.
 
 2. tried explicit compile application with -fstack-limit-register=R10,
 but seems no binary change with or without this option.
 
 3. anybody tried -fstack-check option on ARM or other mmuless system?
 will this option help in runtime stack check?

We use stack checking all the time on blackfin (nommu).

fstack-limit-symbol=_stack_start

check the man page for gcc.

This has limited use (doesn't work) on multi-threaded applications, so we 
created a blackfin specific flag: -mstack-check-l1 , which needs a little 
kernel support.

-Robin

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


RE: [uClinux-dev] port to Olimex SAM9-L9260 ( boot fsck: fsck.jffs2:not found message)

2009-07-01 Thread Microbit_P43000
Oh, I should stipulate that I also went through the sources of U-boot etc.
Could it also be possible that the DataFlash environment section has 
something in it
that is read during start up ? 

Best Regards,
Kris 

 -Original Message-
 From: uclinux-dev-boun...@uclinux.org 
 [mailto:uclinux-dev-boun...@uclinux.org] On Behalf
Of
 Microbit_P43000
 Sent: Wednesday, 1 July 2009 9:13 PM
 To: 'uClinux development list'
 Subject: [uClinux-dev] port to Olimex SAM9-L9260 ( boot fsck: fsck.jffs2:not 
 found
message)
 
 Hi all,
 
 I'm new to this list and (uC)linux overall.
 
 However, with some persistence (and great interest in uClinux :-) I got the 
 uCLinux-dist
 (20080808) ported and running smoothly on the Olimex SAM9-L9260 board
 (similar to Atmel AT91SAM9260-EK).
 
 I don't know yet how to go about patches or implementing something so my 
 effort can be
 incorporated into future versions. I expanded the Kernel config so you can 
 select the
 board there.
 
 I should enunciate that I'm not posting to cop out on a problem, on the 
 contrary, I want
 to learn as much as possible about (uC)linux under the bonnet :-)
 
 My actual question is about the start up and init :
 The original included Linux has root file image that goes into the 512 MB 
 Flash.
 There are/were a few bizarre error messages on booting that I can't get rid 
 of. Since
I
 now run a completely different kernel and these messages stay, they must 
 result from
some
 file or script somewhere on the JFFS root image.
 
 I have spent days on scouring through all the init.d scripts and what have 
 you, and I
 still can't find the source of these pests
 
 Is there anyone here that could help me, or maybe even someone that uses 
 AT91SAM9 ?
 
 The most bizarre message on boot I get is :
 
 Checking root file system...fsck 1.40-WIP (14-Nov-2006)
 fsck: fsck.jffs2: not found
 fsck: Error 2 while executing fsck.jffs2 for /dev/mtdblock1
 done.
 
 I can't find for the life of me where it is invoked.
 
 I also can't figure out how to stop these occasional messages :
 JFFS2 notice: (863) check_node_data: wrong data CRC in data node at 
 0x149fed7c:
read.
 {although I've set the noise level in the kernel config to 0 (debug) for 
 JFFS2,
 this starts after I have modified file/files on the JFFS2 image}.
 
 Lastly, is there anyone that can give a push in the right direction how to 
 turn off this
 time consuming Flash check after init boot, resulting in the  Empty flash at 
 0x0c89630c
 ends at 0x0c896800and the likes. These are before the init freed log.
 
 
 
 
 I include a recent boot log for reference if anyone can give a hint :
 
 
 RomBOOT
 
 AT91Bootstrap loading from 0x8400...
 
 U-Boot 1.3.4-1-g8ed2f5f-dirty (Aug 20 2008 - 18:26:55)
 
 DRAM:  64 MB
 NAND:  512 MiB
 DataFlash:AT45DB161
 Nb pages:   4096
 Page Size:528
 Size= 2162688 bytes
 Logical address: 0xD000
 Area 0:   D000 to D00041FF (RO) Bootstrap
 Area 1:   D0004200 to D00083FF  Environment
 Area 2:   D0008400 to D0041FFF (RO) U-Boot
 Area 3:   D0042000 to D0251FFF  Kernel
 Area 4:   D0252000 to D020  FS
 In:serial
 Out:   serial
 Err:   serial
 Net:   macb0
 macb0: link up, 100Mbps full-duplex (lpa: 0x45e1)
 Hit any key to stop autoboot:  3  2  1  0
 ## Booting kernel from Legacy Image at 2220 ...
Image Name:   Linux-2.6.25-uc0-my_uClinux
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:1486708 Bytes =  1.4 MB
Load Address: 20008000
Entry Point:  20008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 Uncompressing

Linux.
  done, booting the kernel.
 Linux version 2.6.25-uc0-my_uClinux (k...@ubuntu) (gcc version 4.2.3 
 (Sourcery G++ Lite
 2008q1-126)) #12 Tue Jun 30 04:14:19 BST 2009
 CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
 Machine: Olimex SAM9-L9260
 Memory policy: ECC disabled, Data cache writeback
 Clocks: CPU 180 MHz, master 90 MHz, main 18.432 MHz
 CPU0: D VIVT write-back cache
 CPU0: I cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
 CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
 Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
 Kernel command line: mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw
rootfstype=jffs2
 AT91: 96 gpio irqs in 3 banks
 PID hash table entries: 256 (order: 8, 1024 bytes)
 Console: colour dummy device 80x30
 console [ttyS0] enabled
 Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
 Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
 Memory: 64MB = 64MB total
 Memory: 61824KB available (2760K code, 210K data, 104K init)
 Mount-cache hash table entries: 512
 CPU: Testing write buffer coherency: ok
 net_namespace: 152 bytes
 NET: Registered protocol family 16
 SCSI subsystem initialized
 usbcore: 

[uClinux-dev] Re: [PATCH] FLAT: use IS_ERR_VALUE() helper macro

2009-07-01 Thread David McCullough

Jivin Mike Frysinger lays it down ...
 There is a common macro now for testing mixed pointer/errno values, so use
 that rather than handling the casts ourself.
 
 Signed-off-by: Mike Frysinger vap...@gentoo.org

Acked-by: David McCullough david_mccullo...@securecomputing.com

Cheers,
Davidm

 ---
  fs/binfmt_flat.c |   22 ++
  1 files changed, 10 insertions(+), 12 deletions(-)
 
 diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
 index 697f6b5..f22b312 100644
 --- a/fs/binfmt_flat.c
 +++ b/fs/binfmt_flat.c
 @@ -278,8 +278,6 @@ static int decompress_exec(
   ret = bprm-file-f_op-read(bprm-file, buf, LBUFSIZE, fpos);
   if (ret = 0)
   break;
 - if (ret = (unsigned long) -4096)
 - break;
   len -= ret;
  
   strm.next_in = buf;
 @@ -335,7 +333,7 @@ calc_reloc(unsigned long r, struct lib_info *p, int 
 curid, int internalp)
   (%d != %d), (unsigned) r, curid, id);
   goto failed;
   } else if ( ! p-lib_list[id].loaded 
 - load_flat_shared_library(id, p)  (unsigned 
 long) -4096) {
 + IS_ERR_VALUE(load_flat_shared_library(id, p))) {
   printk(BINFMT_FLAT: failed to load library %d, id);
   goto failed;
   }
 @@ -545,7 +543,7 @@ static int load_flat_file(struct linux_binprm * bprm,
   textpos = do_mmap(bprm-file, 0, text_len, PROT_READ|PROT_EXEC,
 MAP_PRIVATE|MAP_EXECUTABLE, 0);
   up_write(current-mm-mmap_sem);
 - if (!textpos  || textpos = (unsigned long) -4096) {
 + if (!textpos || IS_ERR_VALUE(textpos)) {
   if (!textpos)
   textpos = (unsigned long) -ENOMEM;
   printk(Unable to mmap process text, errno %d\n, 
 (int)-textpos);
 @@ -560,7 +558,7 @@ static int load_flat_file(struct linux_binprm * bprm,
   PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
   up_write(current-mm-mmap_sem);
  
 - if (realdatastart == 0 || realdatastart = (unsigned 
 long)-4096) {
 + if (realdatastart == 0 || IS_ERR_VALUE(realdatastart)) {
   if (!realdatastart)
   realdatastart = (unsigned long) -ENOMEM;
   printk(Unable to allocate RAM for process data, errno 
 %d\n,
 @@ -587,7 +585,7 @@ static int load_flat_file(struct linux_binprm * bprm,
   result = bprm-file-f_op-read(bprm-file, (char *) 
 datapos,
   data_len + (relocs * sizeof(unsigned 
 long)), fpos);
   }
 - if (result = (unsigned long)-4096) {
 + if (IS_ERR_VALUE(result)) {
   printk(Unable to read data+bss, errno %d\n, 
 (int)-result);
   do_munmap(current-mm, textpos, text_len);
   do_munmap(current-mm, realdatastart, data_len + extra);
 @@ -607,7 +605,7 @@ static int load_flat_file(struct linux_binprm * bprm,
   PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
   up_write(current-mm-mmap_sem);
  
 - if (!textpos  || textpos = (unsigned long) -4096) {
 + if (!textpos || IS_ERR_VALUE(textpos)) {
   if (!textpos)
   textpos = (unsigned long) -ENOMEM;
   printk(Unable to allocate RAM for process text/data, 
 errno %d\n,
 @@ -641,7 +639,7 @@ static int load_flat_file(struct linux_binprm * bprm,
   fpos = 0;
   result = bprm-file-f_op-read(bprm-file,
   (char *) textpos, text_len, fpos);
 - if (result  (unsigned long) -4096)
 + if (!IS_ERR_VALUE(result))
   result = decompress_exec(bprm, text_len, (char 
 *) datapos,
data_len + (relocs * 
 sizeof(unsigned long)), 0);
   }
 @@ -651,13 +649,13 @@ static int load_flat_file(struct linux_binprm * bprm,
   fpos = 0;
   result = bprm-file-f_op-read(bprm-file,
   (char *) textpos, text_len, fpos);
 - if (result  (unsigned long) -4096) {
 + if (!IS_ERR_VALUE(result)) {
   fpos = ntohl(hdr-data_start);
   result = bprm-file-f_op-read(bprm-file, 
 (char *) datapos,
   data_len + (relocs * sizeof(unsigned 
 long)), fpos);
   }
   }
 - if (result = (unsigned long)-4096) {
 + if (IS_ERR_VALUE(result)) {
   printk(Unable to