All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] missleading function name
@ 2008-06-04 23:30 Robert Millan
  2008-06-05  2:08 ` Pavel Roskin
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Millan @ 2008-06-04 23:30 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]


IMHO the name of this function is highly misleading.  It makes one think
it just checks something, but it actually modifies our variables.  I think
"adjust" would fit better than "check".

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)

[-- Attachment #2: check_range.diff --]
[-- Type: text/x-diff, Size: 1319 bytes --]

diff -x ChangeLog -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/disk.c ./kern/disk.c
--- ../grub2/kern/disk.c	2008-02-08 13:22:51.000000000 +0100
+++ ./kern/disk.c	2008-06-04 16:15:24.000000000 +0200
@@ -323,7 +323,7 @@ grub_disk_close (grub_disk_t disk)
 }
 
 static grub_err_t
-grub_disk_check_range (grub_disk_t disk, grub_disk_addr_t *sector,
+grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector,
 		       grub_off_t *offset, grub_size_t size)
 {
   *sector += *offset >> GRUB_DISK_SECTOR_BITS;
@@ -364,7 +364,7 @@ grub_disk_read (grub_disk_t disk, grub_d
   grub_dprintf ("disk", "Reading `%s'...\n", disk->name);
   
   /* First of all, check if the region is within the disk.  */
-  if (grub_disk_check_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
+  if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
     {
       grub_error_push ();
       grub_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n",
@@ -502,7 +502,7 @@ grub_disk_write (grub_disk_t disk, grub_
   
   grub_dprintf ("disk", "Writing `%s'...\n", disk->name);
 
-  if (grub_disk_check_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
+  if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
     return -1;
 
   real_offset = offset;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-06-08 19:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-04 23:30 [PATCH] missleading function name Robert Millan
2008-06-05  2:08 ` Pavel Roskin
2008-06-05 21:11   ` Robert Millan
2008-06-05 21:14     ` Pavel Roskin
2008-06-08 19:47   ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.