[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] android_bootimg: style fixes
From: |
Shea Levy |
Subject: |
[PATCH 6/7] android_bootimg: style fixes |
Date: |
Tue, 26 Jan 2016 13:51:21 -0500 |
---
grub-core/fs/android_bootimg.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/grub-core/fs/android_bootimg.c b/grub-core/fs/android_bootimg.c
index 13d77fd..37d7ff7 100644
--- a/grub-core/fs/android_bootimg.c
+++ b/grub-core/fs/android_bootimg.c
@@ -64,13 +64,14 @@ typedef enum
NOT_FOUND,
BAD_NAME
}
-bootimg_file_t;
+grub_android_bootimg_filename_t;
-static bootimg_file_t
-grub_android_bootimg_handle_path (const char *path)
+static grub_android_bootimg_filename_t
+handle_path (const char *path)
{
if (!path || path[0] != '/')
return BAD_NAME;
+
const char *path_iter;
for (path_iter = path + 1; *path_iter; ++path_iter) {
if (*path_iter == '/')
@@ -97,7 +98,7 @@ grub_android_bootimg_handle_path (const char *path)
}
static grub_err_t
-grub_android_bootimg_hdr (grub_disk_t disk, struct boot_img_hdr *hd)
+read_hdr (grub_disk_t disk, struct boot_img_hdr *hd)
{
if (grub_disk_read (disk, 0, 0, sizeof *hd, hd))
goto fail;
@@ -121,10 +122,10 @@ grub_android_bootimg_dir (grub_device_t device, const
char *path,
{
struct boot_img_hdr hd;
- if (grub_android_bootimg_hdr (device->disk, &hd))
+ if (read_hdr (device->disk, &hd))
return grub_errno;
- bootimg_file_t file = grub_android_bootimg_handle_path (path);
+ grub_android_bootimg_filename_t file = handle_path (path);
if (file == NOT_FOUND)
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("directory `%s' not found"),
path);
@@ -172,12 +173,12 @@ grub_android_bootimg_open (grub_file_t file, const char
*name)
{
struct boot_img_hdr hd;
- if (grub_android_bootimg_hdr (file->device->disk, &hd))
+ if (read_hdr (file->device->disk, &hd))
return grub_errno;
grub_off_t *begin_offset;
- bootimg_file_t fn = grub_android_bootimg_handle_path (name);
+ grub_android_bootimg_filename_t fn = handle_path (name);
switch (fn)
{
case NOT_FOUND:
--
2.7.0
- [PATCH 0/7] Add driver for android bootimg filesystem, Shea Levy, 2016/01/26
- [PATCH 2/7] android_bootimg: Implement dir, Shea Levy, 2016/01/26
- [PATCH 4/7] android_bootimg: Implement close, Shea Levy, 2016/01/26
- [PATCH 1/7] Add stub module for android bootimgs, Shea Levy, 2016/01/26
- [PATCH 5/7] android_bootimg: Implement read, Shea Levy, 2016/01/26
- [PATCH 6/7] android_bootimg: style fixes,
Shea Levy <=
- [PATCH 3/7] android_bootimg: Implement open, Shea Levy, 2016/01/26
- [PATCH 7/7] Add android_bootimg to changelog, Shea Levy, 2016/01/26
- Re: [PATCH 0/7] Add driver for android bootimg filesystem, Vladimir 'phcoder' Serbinenko, 2016/01/26