Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267581
b: refs/heads/master
c: efd54f4
h: refs/heads/master
i:
  267579: c6bdc5e
v: v3
  • Loading branch information
Noah Watkins authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 2aa1576 commit ec2efee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 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: 43801f6e4ee269cd76f601c2b1d79897ea4a892f
refs/heads/master: efd54f4375982a3f8bef3cce610955f4cc37d5cb
22 changes: 11 additions & 11 deletions trunk/drivers/staging/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int zram_major;
struct zram *zram_devices;

/* Module params (documentation at end) */
unsigned int num_devices;
unsigned int zram_num_devices;

static void zram_stat_inc(u32 *v)
{
Expand Down Expand Up @@ -780,9 +780,9 @@ static int __init zram_init(void)
{
int ret, dev_id;

if (num_devices > max_num_devices) {
if (zram_num_devices > max_num_devices) {
pr_warning("Invalid value for num_devices: %u\n",
num_devices);
zram_num_devices);
ret = -EINVAL;
goto out;
}
Expand All @@ -794,20 +794,20 @@ static int __init zram_init(void)
goto out;
}

if (!num_devices) {
if (!zram_num_devices) {
pr_info("num_devices not specified. Using default: 1\n");
num_devices = 1;
zram_num_devices = 1;
}

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

for (dev_id = 0; dev_id < num_devices; dev_id++) {
for (dev_id = 0; dev_id < zram_num_devices; dev_id++) {
ret = create_device(&zram_devices[dev_id], dev_id);
if (ret)
goto free_devices;
Expand All @@ -830,7 +830,7 @@ static void __exit zram_exit(void)
int i;
struct zram *zram;

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

destroy_device(zram);
Expand All @@ -844,8 +844,8 @@ static void __exit zram_exit(void)
pr_debug("Cleanup done!\n");
}

module_param(num_devices, uint, 0);
MODULE_PARM_DESC(num_devices, "Number of zram devices");
module_param(zram_num_devices, uint, 0);
MODULE_PARM_DESC(zram_num_devices, "Number of zram devices");

module_init(zram_init);
module_exit(zram_exit);
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 @@ -124,7 +124,7 @@ struct zram {
};

extern struct zram *zram_devices;
extern unsigned int num_devices;
extern unsigned int zram_num_devices;
#ifdef CONFIG_SYSFS
extern struct attribute_group zram_disk_attr_group;
#endif
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 @@ -34,7 +34,7 @@ static struct zram *dev_to_zram(struct device *dev)
int i;
struct zram *zram = NULL;

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

0 comments on commit ec2efee

Please sign in to comment.