grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ieee1275: add nvme support within ofpath


From: Daniel Kiper
Subject: Re: [PATCH] ieee1275: add nvme support within ofpath
Date: Tue, 20 Feb 2018 21:01:05 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Feb 20, 2018 at 09:57:14AM -0800, Eric Snowberg wrote:
> Add NVMe support within ofpath.
>
> The Open Firmware text representation for a NVMe device contains the
> Namespace ID. An invalid namespace ID is one whose value is zero or whose
> value is greater than the value reported by the Number of Namespaces (NN)
> field in the Identify Controller data structure.  At the moment  only a
> single Namespace is supported, therefore the value is currently hard coded
> to one.
>
> Signed-off-by: Eric Snowberg <address@hidden>

Just one nit pick... I will change this during commit.

Otherwise Reviewed-by: Daniel Kiper <address@hidden>

> ---
>  grub-core/osdep/linux/ofpath.c |   47 
> ++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 47 insertions(+), 0 deletions(-)
>
> diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c
> index 8d7d683..af068f9 100644
> --- a/grub-core/osdep/linux/ofpath.c
> +++ b/grub-core/osdep/linux/ofpath.c
> @@ -350,6 +350,50 @@ of_path_of_ide(const char *sys_devname 
> __attribute__((unused)), const char *devi
>    return ret;
>  }
>
> +static char *
> +of_path_of_nvme(const char *sys_devname __attribute__((unused)),
> +             const char *device,
> +             const char *devnode __attribute__((unused)),
> +             const char *devicenode)
> +{
> +  char *sysfs_path, *of_path, disk[MAX_DISK_CAT];
> +  const char *digit_string, *part_end;
> +
> +  digit_string = trailing_digits (device);
> +  part_end = devicenode + strlen (devicenode) - 1;
> +
> +  if ((digit_string != '\0') && (*part_end == 'p'))
> +    {
> +      /* We have a partition number, strip it off. */
> +      int part;
> +      char *nvmedev, *end;
> +
> +      nvmedev = strdup (devicenode);
> +
> +      if (nvmedev == NULL)

"if (!nvmedev)" is the convention in this file.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]