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:   Mon, 24 Jun 2019 12:46:22 +0200
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     "Enrico Weigelt, metux IT consult" <lkml@...ux.net>
Cc:     Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Markus Elfring <Markus.Elfring@....de>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Keerthy <j-keerthy@...com>,
        Linus Walleij <linus.walleij@...aro.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        linux-gpio <linux-gpio@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers: Adjust scope for CONFIG_HAS_IOMEM before devm_platform_ioremap_resource()

pon., 24 cze 2019 o 12:05 Enrico Weigelt, metux IT consult
<lkml@...ux.net> napisał(a):
>
> On 24.06.19 10:29, Bartosz Golaszewski wrote:
> > pt., 14 cze 2019 o 18:50 Markus Elfring <Markus.Elfring@....de> napisał(a):
> >>
> >> From: Markus Elfring <elfring@...rs.sourceforge.net>
> >> Date: Fri, 14 Jun 2019 17:45:13 +0200
> >>
> >> Move the preprocessor statement “#ifdef CONFIG_HAS_IOMEM” so that
> >> the corresponding scope for conditional compilation includes also comments
> >> for this function implementation.
> >>
> >> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> >> ---
> >>  drivers/base/platform.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> >> index 4d1729853d1a..a5f40974a6ef 100644
> >> --- a/drivers/base/platform.c
> >> +++ b/drivers/base/platform.c
> >> @@ -78,6 +78,7 @@ struct resource *platform_get_resource(struct platform_device *dev,
> >>         return NULL;
> >>  }
> >>  EXPORT_SYMBOL_GPL(platform_get_resource);
> >> +#ifdef CONFIG_HAS_IOMEM
> >>
> >>  /**
> >>   * devm_platform_ioremap_resource - call devm_ioremap_resource() for a platform
> >> @@ -87,7 +88,6 @@ EXPORT_SYMBOL_GPL(platform_get_resource);
> >>   *        resource management
> >>   * @index: resource index
> >>   */
> >> -#ifdef CONFIG_HAS_IOMEM
> >>  void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev,
> >>                                              unsigned int index)
> >>  {
> >> --
> >> 2.22.0
> >>
> >
> > And what is the purpose of that?
>
> I can imagine that this could improve readability a little bit. Maybe if
> one uses same fancy ide/editor that can fold code blocks like functions
> and conditionals, this patch could make the code prettier.
>
> The patch seems pretty trivial and doesn't change any actual code, so
> I don't see hard resons for rejecting it.
>

In its current form it makes the code even less readable. The #ifdef
should actually be one line lower and touch the comment instead of the
EXPORT_SYMBOL() related to a different function.

Bart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ