Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6645
b: refs/heads/master
c: 7115c13
h: refs/heads/master
i:
  6643: 90891f8
v: v3
  • Loading branch information
Tony Luck committed Aug 29, 2005
1 parent 9864ed3 commit d9a4a96
Show file tree
Hide file tree
Showing 52 changed files with 308 additions and 205 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4db8699bcfa8faddb5727b1cb010a4d9b8a42e8c
refs/heads/master: 7115c13bd6d166982212276610b27773b8c27aec
2 changes: 1 addition & 1 deletion trunk/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 13
EXTRAVERSION =-rc7
EXTRAVERSION =
NAME=Woozy Numbat

# *DOCUMENTATION*
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-ixp4xx/coyote-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static struct flash_platform_data coyote_flash_data = {

static struct resource coyote_flash_resource = {
.start = COYOTE_FLASH_BASE,
.end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE,
.end = COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-ixp4xx/gtwx5715-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static struct flash_platform_data gtwx5715_flash_data = {

static struct resource gtwx5715_flash_resource = {
.start = GTWX5715_FLASH_BASE,
.end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE,
.end = GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-ixp4xx/ixdp425-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static struct flash_platform_data ixdp425_flash_data = {

static struct resource ixdp425_flash_resource = {
.start = IXDP425_FLASH_BASE,
.end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE,
.end = IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
};

Expand Down
1 change: 0 additions & 1 deletion trunk/arch/ia64/ia32/ia32_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <asm/uaccess.h>
#include <asm/rse.h>
#include <asm/sigcontext.h>
#include <asm/segment.h>

#include "ia32priv.h"

Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/ia64/lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ static int __init
setup_io_tlb_npages(char *str)
{
if (isdigit(*str)) {
io_tlb_nslabs = simple_strtoul(str, &str, 0) <<
(PAGE_SHIFT - IO_TLB_SHIFT);
io_tlb_nslabs = simple_strtoul(str, &str, 0);
/* avoid tail segment of size < IO_TLB_SEGSIZE */
io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
}
Expand All @@ -117,7 +116,7 @@ swiotlb_init_with_default_size (size_t default_size)
unsigned long i;

if (!io_tlb_nslabs) {
io_tlb_nslabs = (default_size >> PAGE_SHIFT);
io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
}

Expand Down
1 change: 0 additions & 1 deletion trunk/arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include <asm/machvec.h>
#include <asm/page.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/sal.h>
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <asm/topology.h>
#include <asm/smp.h>
#include <asm/semaphore.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <asm/sal.h>
#include <asm/sn/io.h>
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ppc/syslib/m8xx_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.find_end_of_memory = m8xx_find_end_of_memory;
ppc_md.setup_io_mappings = m8xx_map_io;

#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
#if defined(CONFIG_BLK_DEV_MPC8xx_IDE)
m8xx_ide_init();
#endif
}
41 changes: 9 additions & 32 deletions trunk/arch/um/drivers/mmapper_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@
*
*/

#include <linux/types.h>
#include <linux/kdev_t.h>
#include <linux/time.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
#include <asm/pgtable.h>
#include "mem_user.h"
#include "user_util.h"

Expand All @@ -31,35 +23,22 @@ static unsigned long p_buf = 0;
static char *v_buf = NULL;

static ssize_t
mmapper_read(struct file *file, char *buf, size_t count, loff_t *ppos)
mmapper_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
if(*ppos > mmapper_size)
return -EINVAL;

if(count + *ppos > mmapper_size)
count = count + *ppos - mmapper_size;

if(count < 0)
return -EINVAL;

copy_to_user(buf,&v_buf[*ppos],count);

return count;
return simple_read_from_buffer(buf, count, ppos, v_buf, mmapper_size);
}

static ssize_t
mmapper_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
mmapper_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
if(*ppos > mmapper_size)
if (*ppos > mmapper_size)
return -EINVAL;

if(count + *ppos > mmapper_size)
count = count + *ppos - mmapper_size;

if(count < 0)
return -EINVAL;
if (count > mmapper_size - *ppos)
count = mmapper_size - *ppos;

copy_from_user(&v_buf[*ppos],buf,count);
if (copy_from_user(&v_buf[*ppos], buf, count))
return -EFAULT;

return count;
}
Expand All @@ -77,7 +56,6 @@ mmapper_mmap(struct file *file, struct vm_area_struct * vma)
int ret = -EINVAL;
int size;

lock_kernel();
if (vma->vm_pgoff != 0)
goto out;

Expand All @@ -92,7 +70,6 @@ mmapper_mmap(struct file *file, struct vm_area_struct * vma)
goto out;
ret = 0;
out:
unlock_kernel();
return ret;
}

Expand Down
34 changes: 34 additions & 0 deletions trunk/arch/x86_64/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,40 @@ unsigned long __init e820_end_of_ram(void)
}

/*
* Compute how much memory is missing in a range.
* Unlike the other functions in this file the arguments are in page numbers.
*/
unsigned long __init
e820_hole_size(unsigned long start_pfn, unsigned long end_pfn)
{
unsigned long ram = 0;
unsigned long start = start_pfn << PAGE_SHIFT;
unsigned long end = end_pfn << PAGE_SHIFT;
int i;
for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
unsigned long last, addr;

if (ei->type != E820_RAM ||
ei->addr+ei->size <= start ||
ei->addr >= end)
continue;

addr = round_up(ei->addr, PAGE_SIZE);
if (addr < start)
addr = start;

last = round_down(ei->addr + ei->size, PAGE_SIZE);
if (last >= end)
last = end;

if (last > addr)
ram += last - addr;
}
return ((end - start) - ram) >> PAGE_SHIFT;
}

/*
* Mark e820 reserved areas as busy for the resource manager.
*/
void __init e820_reserve_resources(void)
Expand Down
16 changes: 12 additions & 4 deletions trunk/arch/x86_64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,26 @@ void zap_low_mappings(void)
void __init paging_init(void)
{
{
unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
unsigned long zones_size[MAX_NR_ZONES];
unsigned long holes[MAX_NR_ZONES];
unsigned int max_dma;

memset(zones_size, 0, sizeof(zones_size));
memset(holes, 0, sizeof(holes));

max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;

if (end_pfn < max_dma)
if (end_pfn < max_dma) {
zones_size[ZONE_DMA] = end_pfn;
else {
holes[ZONE_DMA] = e820_hole_size(0, end_pfn);
} else {
zones_size[ZONE_DMA] = max_dma;
holes[ZONE_DMA] = e820_hole_size(0, max_dma);
zones_size[ZONE_NORMAL] = end_pfn - max_dma;
holes[ZONE_NORMAL] = e820_hole_size(max_dma, end_pfn);
}
free_area_init(zones_size);
free_area_init_node(0, NODE_DATA(0), zones_size,
__pa(PAGE_OFFSET) >> PAGE_SHIFT, holes);
}
return;
}
Expand Down
8 changes: 7 additions & 1 deletion trunk/arch/x86_64/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ void __init setup_node_zones(int nodeid)
{
unsigned long start_pfn, end_pfn;
unsigned long zones[MAX_NR_ZONES];
unsigned long holes[MAX_NR_ZONES];
unsigned long dma_end_pfn;

memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES);
memset(holes, 0, sizeof(unsigned long) * MAX_NR_ZONES);

start_pfn = node_start_pfn(nodeid);
end_pfn = node_end_pfn(nodeid);
Expand All @@ -139,13 +141,17 @@ void __init setup_node_zones(int nodeid)
dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT;
if (start_pfn < dma_end_pfn) {
zones[ZONE_DMA] = dma_end_pfn - start_pfn;
holes[ZONE_DMA] = e820_hole_size(start_pfn, dma_end_pfn);
zones[ZONE_NORMAL] = end_pfn - dma_end_pfn;
holes[ZONE_NORMAL] = e820_hole_size(dma_end_pfn, end_pfn);

} else {
zones[ZONE_NORMAL] = end_pfn - start_pfn;
holes[ZONE_NORMAL] = e820_hole_size(start_pfn, end_pfn);
}

free_area_init_node(nodeid, NODE_DATA(nodeid), zones,
start_pfn, NULL);
start_pfn, holes);
}

void __init numa_init_array(void)
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/acpi/sleep/poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ void acpi_power_off(void)

static int acpi_shutdown(struct sys_device *x)
{
return acpi_sleep_prepare(ACPI_STATE_S5);
if (system_state == SYSTEM_POWER_OFF) {
/* Prepare if we are going to power off the system */
return acpi_sleep_prepare(ACPI_STATE_S5);
}
return 0;
}

static struct sysdev_class acpi_sysclass = {
Expand Down
11 changes: 8 additions & 3 deletions trunk/drivers/char/snsc_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/sched.h>
#include <linux/byteorder/generic.h>
#include <asm/sn/sn_sal.h>
#include <asm/unaligned.h>
#include "snsc.h"

static struct subch_data_s *event_sd;
Expand Down Expand Up @@ -62,13 +63,16 @@ static int
scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc)
{
char *desc_end;
__be32 from_buf;

/* record event source address */
*src = be32_to_cpup((__be32 *)event);
from_buf = get_unaligned((__be32 *)event);
*src = be32_to_cpup(&from_buf);
event += 4; /* move on to event code */

/* record the system controller's event code */
*code = be32_to_cpup((__be32 *)event);
from_buf = get_unaligned((__be32 *)event);
*code = be32_to_cpup(&from_buf);
event += 4; /* move on to event arguments */

/* how many arguments are in the packet? */
Expand All @@ -82,7 +86,8 @@ scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc)
/* not an integer argument, so give up */
return -1;
}
*esp_code = be32_to_cpup((__be32 *)event);
from_buf = get_unaligned((__be32 *)event);
*esp_code = be32_to_cpup(&from_buf);
event += 4;

/* parse out the event description */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ static int con_open(struct tty_struct *tty, struct file *filp)
int ret = 0;

acquire_console_sem();
if (tty->count == 1) {
if (tty->driver_data == NULL) {
ret = vc_allocate(currcons);
if (ret == 0) {
struct vc_data *vc = vc_cons[currcons].d;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/hwmon/adm1026.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ int adm1026_attach_adapter(struct i2c_adapter *adapter)
int adm1026_detach_client(struct i2c_client *client)
{
i2c_detach_client(client);
kfree(client);
kfree(i2c_get_clientdata(client));
return 0;
}

Expand Down Expand Up @@ -1691,7 +1691,7 @@ int adm1026_detect(struct i2c_adapter *adapter, int address,

/* Error out and cleanup code */
exitfree:
kfree(new_client);
kfree(data);
exit:
return err;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/hwmon/adm1031.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ static int adm1031_detect(struct i2c_adapter *adapter, int address, int kind)
return 0;

exit_free:
kfree(new_client);
kfree(data);
exit:
return err;
}
Expand All @@ -845,7 +845,7 @@ static int adm1031_detach_client(struct i2c_client *client)
if ((ret = i2c_detach_client(client)) != 0) {
return ret;
}
kfree(client);
kfree(i2c_get_clientdata(client));
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/hwmon/adm9240.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ static int adm9240_detect(struct i2c_adapter *adapter, int address, int kind)

return 0;
exit_free:
kfree(new_client);
kfree(data);
exit:
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/hwmon/fscpos.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static ssize_t set_temp_reset(struct i2c_client *client, struct fscpos_data
"experience to the module author.\n");

/* Supported value: 2 (clears the status) */
fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr], 2);
fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr - 1], 2);
return count;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/hwmon/smsc47b397.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static int smsc47b397_detect(struct i2c_adapter *adapter, int addr, int kind)
return 0;

error_free:
kfree(new_client);
kfree(data);
error_release:
release_region(addr, SMSC_EXTENT);
return err;
Expand Down
Loading

0 comments on commit d9a4a96

Please sign in to comment.