lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Mar 2010 20:59:18 +0100
From:	Kay Sievers <kay.sievers@...y.org>
To:	Paul Mundt <lethal@...ux-sh.org>
Cc:	Greg KH <greg@...ah.com>, Magnus Damm <damm@...nsource.se>,
	linux-kernel@...r.kernel.org, linux-sh@...r.kernel.org
Subject: Re: [PATCH] driver core: Early dev_name() support.

On Tue, Mar 9, 2010 at 07:57, Paul Mundt <lethal@...ux-sh.org> wrote:
> This implements early init_name construction from the matched name/id
> pair following the semantics of the late device/driver match. As a
> result, matched IDs (inclusive of requested ones) are preserved when the
> handoff from the early platform code happens at kobject initialization
> time.

> +                       if (!match->dev.init_name) {
> +                               char buf[32];
> +
> +                               if (match->id != -1)
> +                                       snprintf(buf, sizeof(buf), "%s.%d",
> +                                                match->name, match->id);
> +                               else
> +                                       snprintf(buf, sizeof(buf), "%s",
> +                                                match->name);
> +
> +                               match->dev.init_name = kstrdup(buf, GFP_KERNEL);
> +                               if (!match->dev.init_name)
> +                                       return -ENOMEM;
> +                       }

This can be kasprintf() I guess.

>  static inline const char *dev_name(const struct device *dev)
>  {
> +       /* Use the init name until the kobject becomes available */

This should probably state that it's used for getting names out of
unregistered devices. Otherwise it sounds confusing.

> +       if (dev->init_name)
> +               return dev->init_name;
> +
>        return kobject_name(&dev->kobj);
>  }

Thanks,
Kay

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ