aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorNoah Watkins <noahwatkins@gmail.com>2011-07-20 17:05:57 -0600
committerSimon Shields <keepcalm444@gmail.com>2016-06-12 21:19:27 +1000
commit16993cd17643490403e1800ab37f2d6a4acc62ae (patch)
tree84a13f7723838da5dc97d226644e99f3270d0cf7 /drivers/staging
parentbbf4585ce61d29d363b83efb76b4748c144ab12b (diff)
downloadkernel_samsung_smdk4412-16993cd17643490403e1800ab37f2d6a4acc62ae.tar.gz
kernel_samsung_smdk4412-16993cd17643490403e1800ab37f2d6a4acc62ae.tar.bz2
kernel_samsung_smdk4412-16993cd17643490403e1800ab37f2d6a4acc62ae.zip
staging: zram: make global var "devices" use unique name
The global variable "devices" is too general to be global. This patch switches the name to be "zram_devices". Signed-off-by: Noah Watkins <noahwatkins@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/zram/zram_drv.c16
-rw-r--r--drivers/staging/zram/zram_drv.h2
-rw-r--r--drivers/staging/zram/zram_sysfs.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 803a4ccb9a6..c3298150f5e 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -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;
@@ -688,14 +688,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;
}
@@ -704,8 +704,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:
@@ -718,7 +718,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)
@@ -727,7 +727,7 @@ static void __exit zram_exit(void)
unregister_blkdev(zram_major, "zram");
- kfree(devices);
+ kfree(zram_devices);
pr_debug("Cleanup done!\n");
}
diff --git a/drivers/staging/zram/zram_drv.h b/drivers/staging/zram/zram_drv.h
index 5b628c8b566..36fad9a6a92 100644
--- a/drivers/staging/zram/zram_drv.h
+++ b/drivers/staging/zram/zram_drv.h
@@ -120,7 +120,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;
diff --git a/drivers/staging/zram/zram_sysfs.c b/drivers/staging/zram/zram_sysfs.c
index c070ea980dd..a4a33f675c1 100644
--- a/drivers/staging/zram/zram_sysfs.c
+++ b/drivers/staging/zram/zram_sysfs.c
@@ -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;
}