diff --git a/ChangeLog b/ChangeLog index 724b1c3ba..2427e107e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-05-08 Pavel Roskin + * disk/raid.c (grub_raid_block_xor): Make buf2 constant, it's + not modified. + * disk/raid6_recover.c (grub_raid6_recover): Fix warnings about uninitialized err[0] and err[1]. Rename them to bad1 and bad2. Initialize them with -1. Add sanity check for bad1. Eliminate diff --git a/disk/raid.c b/disk/raid.c index 5cb412bf9..aac0f331a 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -172,12 +172,13 @@ grub_raid_close (grub_disk_t disk __attribute ((unused))) } void -grub_raid_block_xor (char *buf1, char *buf2, int size) +grub_raid_block_xor (char *buf1, const char *buf2, int size) { - grub_size_t *p1, *p2; + grub_size_t *p1; + const grub_size_t *p2; p1 = (grub_size_t *) buf1; - p2 = (grub_size_t *) buf2; + p2 = (const grub_size_t *) buf2; size /= GRUB_CPU_SIZEOF_VOID_P; while (size) diff --git a/include/grub/raid.h b/include/grub/raid.h index a36be6d95..595ced1d6 100644 --- a/include/grub/raid.h +++ b/include/grub/raid.h @@ -68,7 +68,7 @@ void grub_raid_register (grub_raid_t raid); void grub_raid_unregister (grub_raid_t raid); void grub_raid_rescan (void); -void grub_raid_block_xor (char *buf1, char *buf2, int size); +void grub_raid_block_xor (char *buf1, const char *buf2, int size); typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_raid_array *array, int disknr, char *buf,