Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267580
b: refs/heads/master
c: 43801f6
h: refs/heads/master
v: v3
  • Loading branch information
Noah Watkins authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent c6bdc5e commit 2aa1576
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 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: 9ac4025d8088675a325124b61b592922efa56d22
refs/heads/master: 43801f6e4ee269cd76f601c2b1d79897ea4a892f
16 changes: 8 additions & 8 deletions trunk/drivers/staging/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/* Globals */
static int zram_major;
struct zram *devices;
struct zram *zram_devices;

/* Module params (documentation at end) */
unsigned int num_devices;
Expand Down Expand Up @@ -801,14 +801,14 @@ static int __init zram_init(void)

/* Allocate the device array and initialize each one */
pr_info("Creating %u devices ...\n", num_devices);
devices = kzalloc(num_devices * sizeof(struct zram), GFP_KERNEL);
if (!devices) {
zram_devices = kzalloc(num_devices * sizeof(struct zram), GFP_KERNEL);
if (!zram_devices) {
ret = -ENOMEM;
goto unregister;
}

for (dev_id = 0; dev_id < num_devices; dev_id++) {
ret = create_device(&devices[dev_id], dev_id);
ret = create_device(&zram_devices[dev_id], dev_id);
if (ret)
goto free_devices;
}
Expand All @@ -817,8 +817,8 @@ static int __init zram_init(void)

free_devices:
while (dev_id)
destroy_device(&devices[--dev_id]);
kfree(devices);
destroy_device(&zram_devices[--dev_id]);
kfree(zram_devices);
unregister:
unregister_blkdev(zram_major, "zram");
out:
Expand All @@ -831,7 +831,7 @@ static void __exit zram_exit(void)
struct zram *zram;

for (i = 0; i < num_devices; i++) {
zram = &devices[i];
zram = &zram_devices[i];

destroy_device(zram);
if (zram->init_done)
Expand All @@ -840,7 +840,7 @@ static void __exit zram_exit(void)

unregister_blkdev(zram_major, "zram");

kfree(devices);
kfree(zram_devices);
pr_debug("Cleanup done!\n");
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/zram/zram_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct zram {
struct zram_stats stats;
};

extern struct zram *devices;
extern struct zram *zram_devices;
extern unsigned int num_devices;
#ifdef CONFIG_SYSFS
extern struct attribute_group zram_disk_attr_group;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/zram/zram_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static struct zram *dev_to_zram(struct device *dev)
struct zram *zram = NULL;

for (i = 0; i < num_devices; i++) {
zram = &devices[i];
zram = &zram_devices[i];
if (disk_to_dev(zram->disk) == dev)
break;
}
Expand Down

0 comments on commit 2aa1576

Please sign in to comment.