From cc6fb517de90c9a10de6655631be4ce5fb2b7ebe Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 16 Dec 2013 14:49:11 +0100 Subject: [PATCH] Remove practice of assigning random const pointers to device id. This is not required as cache code already checks driver id as well. --- ChangeLog | 6 ++++++ grub-core/disk/host.c | 2 +- grub-core/disk/memdisk.c | 2 +- grub-core/fs/cbfs.c | 2 +- grub-core/fs/proc.c | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a973b586e..fc976100f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-12-16 Vladimir Serbinenko + + Remove practice of assigning random const pointers to device id. + + This is not required as cache code already checks driver id as well. + 2013-12-16 Vladimir Serbinenko * include/grub/x86_64/types.h: Define sizeof (long) as 4 when compiling diff --git a/grub-core/disk/host.c b/grub-core/disk/host.c index 69b6f0ea1..76ef1afb8 100644 --- a/grub-core/disk/host.c +++ b/grub-core/disk/host.c @@ -49,7 +49,7 @@ grub_host_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk"); disk->total_sectors = 0; - disk->id = (unsigned long) "host"; + disk->id = 0; disk->data = 0; diff --git a/grub-core/disk/memdisk.c b/grub-core/disk/memdisk.c index 20c3f02ba..e5ffc01bf 100644 --- a/grub-core/disk/memdisk.c +++ b/grub-core/disk/memdisk.c @@ -47,7 +47,7 @@ grub_memdisk_open (const char *name, grub_disk_t disk) disk->total_sectors = memdisk_size / GRUB_DISK_SECTOR_SIZE; disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE; - disk->id = (unsigned long) "mdsk"; + disk->id = 0; return GRUB_ERR_NONE; } diff --git a/grub-core/fs/cbfs.c b/grub-core/fs/cbfs.c index 93a38003e..7ad148361 100644 --- a/grub-core/fs/cbfs.c +++ b/grub-core/fs/cbfs.c @@ -291,7 +291,7 @@ grub_cbfsdisk_open (const char *name, grub_disk_t disk) disk->total_sectors = cbfsdisk_size / GRUB_DISK_SECTOR_SIZE; disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE; - disk->id = (unsigned long) "cbfs"; + disk->id = 0; return GRUB_ERR_NONE; } diff --git a/grub-core/fs/proc.c b/grub-core/fs/proc.c index 770721ab9..a03469ec6 100644 --- a/grub-core/fs/proc.c +++ b/grub-core/fs/proc.c @@ -44,7 +44,7 @@ grub_procdev_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a procfs disk"); disk->total_sectors = 0; - disk->id = (unsigned long) "proc"; + disk->id = 0; disk->data = 0;