From: Robert Millan <rmh@aybabtu.com>
To: grub-devel@gnu.org
Subject: [PATCH] missleading function name
Date: Thu, 5 Jun 2008 01:30:19 +0200 [thread overview]
Message-ID: <20080604233019.GA21645@thorin> (raw)
[-- 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, §or, &offset, size) != GRUB_ERR_NONE)
+ if (grub_disk_adjust_range (disk, §or, &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, §or, &offset, size) != GRUB_ERR_NONE)
+ if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
return -1;
real_offset = offset;
next reply other threads:[~2008-06-04 23:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 23:30 Robert Millan [this message]
2008-06-05 2:08 ` [PATCH] missleading function name Pavel Roskin
2008-06-05 21:11 ` Robert Millan
2008-06-05 21:14 ` Pavel Roskin
2008-06-08 19:47 ` Robert Millan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080604233019.GA21645@thorin \
--to=rmh@aybabtu.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.