From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K3A5Q-0004VJ-BO for mharc-grub-devel@gnu.org; Mon, 02 Jun 2008 09:28:32 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3A5O-0004UJ-8H for grub-devel@gnu.org; Mon, 02 Jun 2008 09:28:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3A5M-0004TL-MO for grub-devel@gnu.org; Mon, 02 Jun 2008 09:28:29 -0400 Received: from [199.232.76.173] (port=37130 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3A5M-0004TI-G8 for grub-devel@gnu.org; Mon, 02 Jun 2008 09:28:28 -0400 Received: from aybabtu.com ([69.60.117.155]:53159) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K3A5M-0005bx-Ag for grub-devel@gnu.org; Mon, 02 Jun 2008 09:28:28 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1K3A4Z-0004og-67 for grub-devel@gnu.org; Mon, 02 Jun 2008 15:27:39 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1K3A55-0008PT-Hr for grub-devel@gnu.org; Mon, 02 Jun 2008 15:28:11 +0200 Date: Mon, 2 Jun 2008 15:28:11 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080602132811.GA32258@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline Content-Transfer-Encoding: 8bit Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] rename a few functions in util/biosdisk.c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2008 13:28:30 -0000 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit This patch renames a few functions in util/biosdisk.c. Currently, by looking at get_drive(), find_drive(), get_os_disk() function names it is very difficult to figure out what's going on. They're even misleading in fact. I propose the more descriptive names find_grub_drive(), find_system_device() and convert_system_partition_to_system_disk(). -- Robert Millan I know my rights; I want my phone call! What good is a phone call… if you are unable to speak? (as seen on /.) --UlVJffcvxoiEqYs2 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="biosdisk_function_names.diff" diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/biosdisk.c ./util/biosdisk.c --- ../grub2/util/biosdisk.c 2008-05-31 11:42:33.000000000 +0200 +++ ./util/biosdisk.c 2008-06-02 15:13:09.000000000 +0200 @@ -110,7 +110,7 @@ have_devfs (void) #endif /* __linux__ */ static int -get_drive (const char *name) +find_grub_drive (const char *name) { unsigned int i; @@ -148,7 +148,7 @@ grub_util_biosdisk_open (const char *nam int drive; struct stat st; - drive = get_drive (name); + drive = find_grub_drive (name); if (drive < 0) return grub_error (GRUB_ERR_BAD_DEVICE, "no mapping exists for `%s'", name); @@ -503,7 +503,7 @@ read_device_map (const char *dev_map) p++; /* Find a free slot. */ - drive = get_drive (NULL); + drive = find_grub_drive (NULL); if (drive < 0) show_error ("Map table size exceeded"); @@ -593,7 +593,7 @@ make_device_name (int drive, int dos_par } static char * -get_os_disk (const char *os_dev) +convert_system_partition_to_system_disk (const char *os_dev) { #if defined(__linux__) char *path = xmalloc (PATH_MAX); @@ -696,18 +696,18 @@ get_os_disk (const char *os_dev) return path; #else -# warning "The function `get_os_disk' might not work on your OS correctly." +# warning "The function `convert_system_partition_to_system_disk' might not work on your OS correctly." return xstrdup (os_dev); #endif } static int -find_drive (const char *os_dev) +find_system_device (const char *os_dev) { int i; char *os_disk; - os_disk = get_os_disk (os_dev); + os_disk = convert_system_partition_to_system_disk (os_dev); if (! os_disk) return -1; @@ -734,7 +734,7 @@ grub_util_biosdisk_get_grub_dev (const c return 0; } - drive = find_drive (os_dev); + drive = find_system_device (os_dev); if (drive < 0) { grub_error (GRUB_ERR_BAD_DEVICE, --UlVJffcvxoiEqYs2--