diff options
| author | Jeff Dike <jdike@addtoit.com> | 2007-05-06 17:51:22 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:13:02 -0400 |
| commit | 1ffb9164f51094b7105ce9f81600b222ddf5b82c (patch) | |
| tree | b2efe2af99a2827692a7541058eaef9e938f1da6 /arch/um/os-Linux/drivers | |
| parent | 6e21aec3fcf6c8862b755d45c0af45acdefff976 (diff) | |
uml: remove page_size()
userspace code used to have to call the kernelspace function page_size() in
order to determine the value of the kernel's PAGE_SIZE. Since this is now
available directly from kern_constants.h as UM_KERN_PAGE_SIZE, page_size() can
be deleted and calls changed to use the constant.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/drivers')
| -rw-r--r-- | arch/um/os-Linux/drivers/ethertap_user.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/um/os-Linux/drivers/ethertap_user.c b/arch/um/os-Linux/drivers/ethertap_user.c index 4e38ccf35129..96e12ea8172c 100644 --- a/arch/um/os-Linux/drivers/ethertap_user.c +++ b/arch/um/os-Linux/drivers/ethertap_user.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include "etap.h" | 20 | #include "etap.h" |
| 21 | #include "os.h" | 21 | #include "os.h" |
| 22 | #include "um_malloc.h" | 22 | #include "um_malloc.h" |
| 23 | #include "kern_constants.h" | ||
| 23 | 24 | ||
| 24 | #define MAX_PACKET ETH_MAX_PACKET | 25 | #define MAX_PACKET ETH_MAX_PACKET |
| 25 | 26 | ||
| @@ -50,10 +51,10 @@ static void etap_change(int op, unsigned char *addr, unsigned char *netmask, | |||
| 50 | n = os_write_file(fd, &change, sizeof(change)); | 51 | n = os_write_file(fd, &change, sizeof(change)); |
| 51 | if(n != sizeof(change)) | 52 | if(n != sizeof(change)) |
| 52 | printk("etap_change - request failed, err = %d\n", -n); | 53 | printk("etap_change - request failed, err = %d\n", -n); |
| 53 | output = um_kmalloc(page_size()); | 54 | output = um_kmalloc(UM_KERN_PAGE_SIZE); |
| 54 | if(output == NULL) | 55 | if(output == NULL) |
| 55 | printk("etap_change : Failed to allocate output buffer\n"); | 56 | printk("etap_change : Failed to allocate output buffer\n"); |
| 56 | read_output(fd, output, page_size()); | 57 | read_output(fd, output, UM_KERN_PAGE_SIZE); |
| 57 | if(output != NULL){ | 58 | if(output != NULL){ |
| 58 | printk("%s", output); | 59 | printk("%s", output); |
| 59 | kfree(output); | 60 | kfree(output); |
| @@ -159,7 +160,7 @@ static int etap_open(void *data) | |||
| 159 | 160 | ||
| 160 | err = etap_tramp(pri->dev_name, pri->gate_addr, control_fds[0], | 161 | err = etap_tramp(pri->dev_name, pri->gate_addr, control_fds[0], |
| 161 | control_fds[1], data_fds[0], data_fds[1]); | 162 | control_fds[1], data_fds[0], data_fds[1]); |
| 162 | output_len = page_size(); | 163 | output_len = UM_KERN_PAGE_SIZE; |
| 163 | output = um_kmalloc(output_len); | 164 | output = um_kmalloc(output_len); |
| 164 | read_output(control_fds[0], output, output_len); | 165 | read_output(control_fds[0], output, output_len); |
| 165 | 166 | ||
