diff mbox series

drivers: Adjust scope for CONFIG_HAS_IOMEM before devm_platform_ioremap_resource()

Message ID 9efcbce2-4d49-7197-a3d8-0e83850892d5@web.de
State New
Headers show
Series drivers: Adjust scope for CONFIG_HAS_IOMEM before devm_platform_ioremap_resource() | expand

Commit Message

Markus Elfring June 14, 2019, 4:50 p.m. UTC
From: Markus Elfring <elfring@users.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@users.sourceforge.net>
---
 drivers/base/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.22.0

Comments

Bartosz Golaszewski June 24, 2019, 8:29 a.m. UTC | #1
pt., 14 cze 2019 o 18:50 Markus Elfring <Markus.Elfring@web.de> napisał(a):
>
> From: Markus Elfring <elfring@users.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@users.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?

Bart
Enrico Weigelt, metux IT consult June 24, 2019, 10:05 a.m. UTC | #2
On 24.06.19 10:29, Bartosz Golaszewski wrote:
> pt., 14 cze 2019 o 18:50 Markus Elfring <Markus.Elfring@web.de> napisał(a):
>>
>> From: Markus Elfring <elfring@users.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@users.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.


--mtx
Bartosz Golaszewski June 24, 2019, 10:46 a.m. UTC | #3
pon., 24 cze 2019 o 12:05 Enrico Weigelt, metux IT consult
<lkml@metux.net> napisał(a):
>
> On 24.06.19 10:29, Bartosz Golaszewski wrote:
> > pt., 14 cze 2019 o 18:50 Markus Elfring <Markus.Elfring@web.de> napisał(a):
> >>
> >> From: Markus Elfring <elfring@users.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@users.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
Markus Elfring June 24, 2019, 10:51 a.m. UTC | #4
>> +++ 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)
>>  {> And what is the purpose of that?

I recommend to let the availability of additional documentation for this function
depend also on the mentioned preprocessor symbol

Regards,
Markus
Markus Elfring June 24, 2019, 11 a.m. UTC | #5
> In its current form it makes the code even less readable.

This can be your development opinion.


> The #ifdef should actually be one line lower

I suggested that the conditional compilation can contain also a blank line
together with a comment block.


> and touch the comment instead of the EXPORT_SYMBOL() related to a different function.

I find that this macro call was kept unchanged.

Regards,
Markus
Enrico Weigelt, metux IT consult June 24, 2019, 6:22 p.m. UTC | #6
On 24.06.19 12:46, Bartosz Golaszewski wrote:

>> 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.

Okay, that missing newline should be fixed (as well as the extra one
after the #ifdef). Besides that, I don't see any further problems.

--mtx
Bartosz Golaszewski June 25, 2019, 7:10 a.m. UTC | #7
pon., 24 cze 2019 o 20:22 Enrico Weigelt, metux IT consult
<lkml@metux.net> napisał(a):
>
> On 24.06.19 12:46, Bartosz Golaszewski wrote:
>
> >> 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.
>
> Okay, that missing newline should be fixed (as well as the extra one
> after the #ifdef). Besides that, I don't see any further problems.
>

Are we sure this even changes something? Does kernel documentation get
generated according to current config options? I really think this
patch just pollutes the history for now apparent reason.

Greg, could you give your opinion on this?

Bart
Greg KH June 25, 2019, 7:30 a.m. UTC | #8
On Tue, Jun 25, 2019 at 09:10:25AM +0200, Bartosz Golaszewski wrote:
> pon., 24 cze 2019 o 20:22 Enrico Weigelt, metux IT consult
> <lkml@metux.net> napisał(a):
> >
> > On 24.06.19 12:46, Bartosz Golaszewski wrote:
> >
> > >> 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.
> >
> > Okay, that missing newline should be fixed (as well as the extra one
> > after the #ifdef). Besides that, I don't see any further problems.
> >
> 
> Are we sure this even changes something? Does kernel documentation get
> generated according to current config options? I really think this
> patch just pollutes the history for now apparent reason.
> 
> Greg, could you give your opinion on this?

Why are you all arguing with a all-but-instinguishable-from-a-bot
persona about a patch that I will never apply?

greg k-h
Bartosz Golaszewski June 25, 2019, 7:32 a.m. UTC | #9
wt., 25 cze 2019 o 09:30 Greg Kroah-Hartman
<gregkh@linuxfoundation.org> napisał(a):
>
> On Tue, Jun 25, 2019 at 09:10:25AM +0200, Bartosz Golaszewski wrote:
> > pon., 24 cze 2019 o 20:22 Enrico Weigelt, metux IT consult
> > <lkml@metux.net> napisał(a):
> > >
> > > On 24.06.19 12:46, Bartosz Golaszewski wrote:
> > >
> > > >> 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.
> > >
> > > Okay, that missing newline should be fixed (as well as the extra one
> > > after the #ifdef). Besides that, I don't see any further problems.
> > >
> >
> > Are we sure this even changes something? Does kernel documentation get
> > generated according to current config options? I really think this
> > patch just pollutes the history for now apparent reason.
> >
> > Greg, could you give your opinion on this?
>
> Why are you all arguing with a all-but-instinguishable-from-a-bot
> persona about a patch that I will never apply?
>
> greg k-h

Oh so it's another troll then? Good to know, ignoring from now on.

Thanks,
Bart
Markus Elfring June 25, 2019, 7:42 a.m. UTC | #10
> Why are you all arguing with a all-but-instinguishable-from-a-bot persona

I am curious if another meeting at a Linux conference
can adjust this view.


> about a patch that I will never apply?

I hope that you can get into a more constructive mood a bit later
for the reconsideration of the position for the preprocessor
statement “#ifdef CONFIG_HAS_IOMEM” before a function implementation.

Regards,
Markus
Markus Elfring June 25, 2019, 7:51 a.m. UTC | #11
> Oh so it's another troll then?

I am just a contributor.


> Good to know, ignoring from now on.

The opinions can vary for my contributions as usual.

I hope that the software development attention can evolve in more
positive ways again.

Regards,
Markus
diff mbox series

Patch

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)
 {