Re: [edk2] [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding standard

2018-01-03 Thread Evan Lloyd
Hi Ard

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: 02 January 2018 15:21
> To: Evan Lloyd 
> Cc: edk2-devel@lists.01.org; Matteo Carlini ;
> eif.lindh...@linaro.org; nd 
> Subject: Re: [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding
> standard
> 
> On 2 January 2018 at 15:11, Evan Lloyd  wrote:
> > Hi Ard.
> > One aim of these changes is to get those files we have to play with into a
> state where a beautifier like indent, astyle,  or clang-format can be used to
> help tidy our changes.  (NOTE, we do not have that fully working yet, but
> they do help.)  In a world where we have to play with several contradictory
> formatting standards (not just EDK2) then anything that can help is
> welcome.
> > Of the changes made:
> > Fixing the include guards: is a small improvement.  (Ideally
> patchcheck should reject these.)
> > Reducing lines to 80 columns: makes Leif (at least) happy, and 
> > aligns
> with formatter behaviour.
> > Correcting Doxygen format comments: prevents Doxygen generating
> gibberish.
> > Spaces before '(': Maintains consistency, and aligns with desired
> formatter behaviour.
> >
> 
> To be honest, this is an aspect I hadn't considered at all. It would be
> excellent if we could use tooling to fix our code wrt to coding style, and if
> changes such as these bring us closer to that goal, I am all for it.

 [[Evan Lloyd]] Excellent news - now you know why we were doing all those 
inexplicable things.  I really should have explained this more clearly before.

> 
> Would it be feasible to run that on entire packages, i.e., ArmPkg and
> ArmPlatformPkg?

 [[Evan Lloyd]]  As it stands, none of the tools is very happy with the EDK2 
style, and they tend to miss meeting it in different ways.
(As an aside - one common problem is that I have found no means of coercing 
them to force the ");" at the end of a function call onto its own line.  Your 
recent CCS change to make that optional helps a lot with that.)  However, I 
have so far failed to get any of the above tools to do exactly what we want.  
All that I can achieve is to generate a formatted view that can be compared 
against the original with a visual program like kdiff3 - highlighting some 
formatting improvements that can then be copied across, whilst the mismatches 
can be ignored.  This is not much, but it does help, especially with spacing 
and line length errors.

If you are interested, I am very happy to make those parameter files that I 
have available for consideration, as long as everyone understands how far from 
fully compliant they are, and that their limitations are manifold.  I suspect 
the path to a fully automated reformat will be a long and winding road.  The 
best bet might be to actually change one of the Open Source tools to suit us, 
but I certainly don't know of anyone with the leisure time available to take 
that on.

Regards,
Evan

> 
...
> >> > --
> >> > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
> >> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding standard

2018-01-02 Thread Ard Biesheuvel
On 2 January 2018 at 15:11, Evan Lloyd  wrote:
> Hi Ard.
> One aim of these changes is to get those files we have to play with into a 
> state where a beautifier like indent, astyle,  or clang-format can be used to 
> help tidy our changes.  (NOTE, we do not have that fully working yet, but 
> they do help.)  In a world where we have to play with several contradictory 
> formatting standards (not just EDK2) then anything that can help is welcome.
> Of the changes made:
> Fixing the include guards: is a small improvement.  (Ideally 
> patchcheck should reject these.)
> Reducing lines to 80 columns: makes Leif (at least) happy, and aligns 
> with formatter behaviour.
> Correcting Doxygen format comments: prevents Doxygen generating 
> gibberish.
> Spaces before '(': Maintains consistency, and aligns with desired 
> formatter behaviour.
>

To be honest, this is an aspect I hadn't considered at all. It would
be excellent if we could use tooling to fix our code wrt to coding
style, and if changes such as these bring us closer to that goal, I am
all for it.

Would it be feasible to run that on entire packages, i.e., ArmPkg and
ArmPlatformPkg?

> More below:
>
>> -Original Message-
>> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>> Sent: 23 December 2017 13:19
>> To: Evan Lloyd 
>> Cc: edk2-devel@lists.01.org; "ard.biesheu...@linaro.org"@arm.com;
>> "leif.lindh...@linaro.org"@arm.com;
>> "matteo.carl...@arm.com"@arm.com; "n...@arm.com"@arm.com
>> Subject: Re: [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding
>> standard
>>
>> On 22 December 2017 at 18:34,   wrote:
>> > From: Girish Pathak 
>> >
>> > There is no functional modification in this change As preparation for
>> > further work, the formatting is corrected to meet the EDKII coding
>> > standard.
>> > Of specific note, some invalid include guards were fixed.
>> >
>> > Contributed-under: TianoCore Contribution Agreement 1.1
>> > Signed-off-by: Girish Pathak 
>> > Signed-off-by: Evan Lloyd 
>>
>> Hi Girish, Evan,
>>
>> I am sorry, but I really don't see the point of this patch. Given that the
>> coding standard is not in line with common practice in Tianocore, changing
>> comments to remove empty lines after // or changing one style to the
>> other is just pointless churn. Also, changes like
>>
>> >  VOID
>> > -LcdShutdown (
>> > -  VOID
>> > -  )
>> > +LcdShutdown (VOID)
>> >  {
>>
>> look backward to me, and so if the coding standard mandates that, we
>> should changes the coding standard, not the code.
>>
>> --
>> Ard.
>>
> [[Evan Lloyd]] Hi Ard.
> The coding standard doesn't mandate this format, but permits it (5.7.1.5).
> Our case is that whilst either format is acceptable, consistency is 
> desirable, so we aimed (however imperfectly) to use a consistent style.
> In this instance, though, this  would be reverted by the formatting tools, so 
> I agree that it is pointless.
>
>>
>>
>> > ---
>> >
>> ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h |
>> 10 +-
>> >  ArmPlatformPkg/Include/Library/LcdPlatformLib.h|  14 
>> > +-
>> >  ArmPlatformPkg/Library/HdLcd/HdLcd.h   |  21 
>> > ++-
>> >
>> ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c |
>> 187 +++-
>> >  ArmPlatformPkg/Library/HdLcd/HdLcd.c   |  96 
>> > +
>> -
>> >  ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c |  72 
>> > --
>> --
>> >  6 files changed, 212 insertions(+), 188 deletions(-)
>> >
>> > diff --git
>> a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>> h
>> b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>> h
>> > index
>> b66efd34561f655b74a5ecfad8a97281cdd5929d..2b001b107927fc75317ce
>> 39d370049d7740953a8 100644
>> > ---
>> a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>> h
>> > +++
>> b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>> h
>> > @@ -1,6 +1,6 @@
>> >  /** @file
>> >
>> > -  Copyright (c) 2011, ARM Ltd. All rights reserved.
>> > +  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
>> >This program and the accompanying materials
>> >are licensed and made available under the terms and conditions of the
>> BSD License
>> >which accompanies this distribution.  The full text of the license may 
>> > be
>> found at
>> > @@ -11,9 +11,8 @@
>> >
>> >  **/
>> >
>> > -#ifndef __ARM_VE_GRAPHICS_DXE_H__
>> > -#define __ARM_VE_GRAPHICS_DXE_H__
>> > -
>> > +#ifndef LCD_GRAPHICS_OUTPUT_DXE_H_
>> > +#define LCD_GRAPHICS_OUTPUT_DXE_H_
>> >
>> >  #include 
>> >
>> > @@ -25,7 +24,6 @@
>> >
>> >  #include 
>> >
>> > -
>> >  //
>> >  // Device structures
>> >  //
>> > @@ -106,4 +104,4 @@ InitializeDisplay (
>> >IN LCD_INSTANCE* Instance
>> >  );
>> >
>> > -#endif /* 

Re: [edk2] [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding standard

2018-01-02 Thread Ard Biesheuvel
(fix Leif's email address)

On 2 January 2018 at 15:21, Ard Biesheuvel  wrote:
> On 2 January 2018 at 15:11, Evan Lloyd  wrote:
>> Hi Ard.
>> One aim of these changes is to get those files we have to play with into a 
>> state where a beautifier like indent, astyle,  or clang-format can be used 
>> to help tidy our changes.  (NOTE, we do not have that fully working yet, but 
>> they do help.)  In a world where we have to play with several contradictory 
>> formatting standards (not just EDK2) then anything that can help is welcome.
>> Of the changes made:
>> Fixing the include guards: is a small improvement.  (Ideally 
>> patchcheck should reject these.)
>> Reducing lines to 80 columns: makes Leif (at least) happy, and 
>> aligns with formatter behaviour.
>> Correcting Doxygen format comments: prevents Doxygen generating 
>> gibberish.
>> Spaces before '(': Maintains consistency, and aligns with desired 
>> formatter behaviour.
>>
>
> To be honest, this is an aspect I hadn't considered at all. It would
> be excellent if we could use tooling to fix our code wrt to coding
> style, and if changes such as these bring us closer to that goal, I am
> all for it.
>
> Would it be feasible to run that on entire packages, i.e., ArmPkg and
> ArmPlatformPkg?
>
>> More below:
>>
>>> -Original Message-
>>> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
>>> Sent: 23 December 2017 13:19
>>> To: Evan Lloyd 
>>> Cc: edk2-devel@lists.01.org; "ard.biesheu...@linaro.org"@arm.com;
>>> "leif.lindh...@linaro.org"@arm.com;
>>> "matteo.carl...@arm.com"@arm.com; "n...@arm.com"@arm.com
>>> Subject: Re: [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding
>>> standard
>>>
>>> On 22 December 2017 at 18:34,   wrote:
>>> > From: Girish Pathak 
>>> >
>>> > There is no functional modification in this change As preparation for
>>> > further work, the formatting is corrected to meet the EDKII coding
>>> > standard.
>>> > Of specific note, some invalid include guards were fixed.
>>> >
>>> > Contributed-under: TianoCore Contribution Agreement 1.1
>>> > Signed-off-by: Girish Pathak 
>>> > Signed-off-by: Evan Lloyd 
>>>
>>> Hi Girish, Evan,
>>>
>>> I am sorry, but I really don't see the point of this patch. Given that the
>>> coding standard is not in line with common practice in Tianocore, changing
>>> comments to remove empty lines after // or changing one style to the
>>> other is just pointless churn. Also, changes like
>>>
>>> >  VOID
>>> > -LcdShutdown (
>>> > -  VOID
>>> > -  )
>>> > +LcdShutdown (VOID)
>>> >  {
>>>
>>> look backward to me, and so if the coding standard mandates that, we
>>> should changes the coding standard, not the code.
>>>
>>> --
>>> Ard.
>>>
>> [[Evan Lloyd]] Hi Ard.
>> The coding standard doesn't mandate this format, but permits it (5.7.1.5).
>> Our case is that whilst either format is acceptable, consistency is 
>> desirable, so we aimed (however imperfectly) to use a consistent style.
>> In this instance, though, this  would be reverted by the formatting tools, 
>> so I agree that it is pointless.
>>
>>>
>>>
>>> > ---
>>> >
>>> ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h |
>>> 10 +-
>>> >  ArmPlatformPkg/Include/Library/LcdPlatformLib.h|  14 
>>> > +-
>>> >  ArmPlatformPkg/Library/HdLcd/HdLcd.h   |  21 
>>> > ++-
>>> >
>>> ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c |
>>> 187 +++-
>>> >  ArmPlatformPkg/Library/HdLcd/HdLcd.c   |  96 
>>> > +
>>> -
>>> >  ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c |  72 
>>> > --
>>> --
>>> >  6 files changed, 212 insertions(+), 188 deletions(-)
>>> >
>>> > diff --git
>>> a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>>> h
>>> b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>>> h
>>> > index
>>> b66efd34561f655b74a5ecfad8a97281cdd5929d..2b001b107927fc75317ce
>>> 39d370049d7740953a8 100644
>>> > ---
>>> a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>>> h
>>> > +++
>>> b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
>>> h
>>> > @@ -1,6 +1,6 @@
>>> >  /** @file
>>> >
>>> > -  Copyright (c) 2011, ARM Ltd. All rights reserved.
>>> > +  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
>>> >This program and the accompanying materials
>>> >are licensed and made available under the terms and conditions of the
>>> BSD License
>>> >which accompanies this distribution.  The full text of the license may 
>>> > be
>>> found at
>>> > @@ -11,9 +11,8 @@
>>> >
>>> >  **/
>>> >
>>> > -#ifndef __ARM_VE_GRAPHICS_DXE_H__
>>> > -#define __ARM_VE_GRAPHICS_DXE_H__
>>> > -
>>> > +#ifndef LCD_GRAPHICS_OUTPUT_DXE_H_
>>> > +#define LCD_GRAPHICS_OUTPUT_DXE_H_
>>> 

Re: [edk2] [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding standard

2018-01-02 Thread Evan Lloyd
Hi Ard.
One aim of these changes is to get those files we have to play with into a 
state where a beautifier like indent, astyle,  or clang-format can be used to 
help tidy our changes.  (NOTE, we do not have that fully working yet, but they 
do help.)  In a world where we have to play with several contradictory 
formatting standards (not just EDK2) then anything that can help is welcome.
Of the changes made:
Fixing the include guards: is a small improvement.  (Ideally patchcheck 
should reject these.)
Reducing lines to 80 columns: makes Leif (at least) happy, and aligns 
with formatter behaviour.
Correcting Doxygen format comments: prevents Doxygen generating 
gibberish.
Spaces before '(': Maintains consistency, and aligns with desired 
formatter behaviour.

More below:

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: 23 December 2017 13:19
> To: Evan Lloyd 
> Cc: edk2-devel@lists.01.org; "ard.biesheu...@linaro.org"@arm.com;
> "leif.lindh...@linaro.org"@arm.com;
> "matteo.carl...@arm.com"@arm.com; "n...@arm.com"@arm.com
> Subject: Re: [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding
> standard
> 
> On 22 December 2017 at 18:34,   wrote:
> > From: Girish Pathak 
> >
> > There is no functional modification in this change As preparation for
> > further work, the formatting is corrected to meet the EDKII coding
> > standard.
> > Of specific note, some invalid include guards were fixed.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Girish Pathak 
> > Signed-off-by: Evan Lloyd 
> 
> Hi Girish, Evan,
> 
> I am sorry, but I really don't see the point of this patch. Given that the
> coding standard is not in line with common practice in Tianocore, changing
> comments to remove empty lines after // or changing one style to the
> other is just pointless churn. Also, changes like
> 
> >  VOID
> > -LcdShutdown (
> > -  VOID
> > -  )
> > +LcdShutdown (VOID)
> >  {
> 
> look backward to me, and so if the coding standard mandates that, we
> should changes the coding standard, not the code.
> 
> --
> Ard.
> 
[[Evan Lloyd]] Hi Ard.
The coding standard doesn't mandate this format, but permits it (5.7.1.5).
Our case is that whilst either format is acceptable, consistency is desirable, 
so we aimed (however imperfectly) to use a consistent style.
In this instance, though, this  would be reverted by the formatting tools, so I 
agree that it is pointless.

> 
> 
> > ---
> >
> ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h |
> 10 +-
> >  ArmPlatformPkg/Include/Library/LcdPlatformLib.h|  14 +-
> >  ArmPlatformPkg/Library/HdLcd/HdLcd.h   |  21 
> > ++-
> >
> ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c |
> 187 +++-
> >  ArmPlatformPkg/Library/HdLcd/HdLcd.c   |  96 
> > +
> -
> >  ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c |  72 
> > --
> --
> >  6 files changed, 212 insertions(+), 188 deletions(-)
> >
> > diff --git
> a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
> h
> b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
> h
> > index
> b66efd34561f655b74a5ecfad8a97281cdd5929d..2b001b107927fc75317ce
> 39d370049d7740953a8 100644
> > ---
> a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
> h
> > +++
> b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.
> h
> > @@ -1,6 +1,6 @@
> >  /** @file
> >
> > -  Copyright (c) 2011, ARM Ltd. All rights reserved.
> > +  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
> >This program and the accompanying materials
> >are licensed and made available under the terms and conditions of the
> BSD License
> >which accompanies this distribution.  The full text of the license may be
> found at
> > @@ -11,9 +11,8 @@
> >
> >  **/
> >
> > -#ifndef __ARM_VE_GRAPHICS_DXE_H__
> > -#define __ARM_VE_GRAPHICS_DXE_H__
> > -
> > +#ifndef LCD_GRAPHICS_OUTPUT_DXE_H_
> > +#define LCD_GRAPHICS_OUTPUT_DXE_H_
> >
> >  #include 
> >
> > @@ -25,7 +24,6 @@
> >
> >  #include 
> >
> > -
> >  //
> >  // Device structures
> >  //
> > @@ -106,4 +104,4 @@ InitializeDisplay (
> >IN LCD_INSTANCE* Instance
> >  );
> >
> > -#endif /* __ARM_VE_GRAPHICS_DXE_H__ */
> > +#endif /* LCD_GRAPHICS_OUTPUT_DXE_H_ */
> > diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> > index
> b9bdf471e2d65dba7a0fcb0f7ecc352bd576b46b..b9316ec8de8425a83e2f6
> 27f5c24821ff9a2f750 100644
> > --- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> > +++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> > @@ -1,6 +1,6 @@
> >  /** @file
> >
> > - Copyright (c) 2011, ARM Ltd. All rights reserved.
> > + Copyright (c) 2011-2017, ARM Ltd. 

Re: [edk2] [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding standard

2017-12-23 Thread Ard Biesheuvel
On 22 December 2017 at 18:34,   wrote:
> From: Girish Pathak 
>
> There is no functional modification in this change
> As preparation for further work, the formatting is corrected to meet
> the EDKII coding standard.
> Of specific note, some invalid include guards were fixed.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Girish Pathak 
> Signed-off-by: Evan Lloyd 

Hi Girish, Evan,

I am sorry, but I really don't see the point of this patch. Given that
the coding standard is not in line with common practice in Tianocore,
changing comments to remove empty lines after // or changing one style
to the other is just pointless churn. Also, changes like

>  VOID
> -LcdShutdown (
> -  VOID
> -  )
> +LcdShutdown (VOID)
>  {

look backward to me, and so if the coding standard mandates that, we
should changes the coding standard, not the code.

-- 
Ard.



> ---
>  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h |  10 +-
>  ArmPlatformPkg/Include/Library/LcdPlatformLib.h|  14 +-
>  ArmPlatformPkg/Library/HdLcd/HdLcd.h   |  21 ++-
>  ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c | 187 
> +++-
>  ArmPlatformPkg/Library/HdLcd/HdLcd.c   |  96 
> +-
>  ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c |  72 
> 
>  6 files changed, 212 insertions(+), 188 deletions(-)
>
> diff --git 
> a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h 
> b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
> index 
> b66efd34561f655b74a5ecfad8a97281cdd5929d..2b001b107927fc75317ce39d370049d7740953a8
>  100644
> --- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
> +++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
> @@ -1,6 +1,6 @@
>  /** @file
>
> -  Copyright (c) 2011, ARM Ltd. All rights reserved.
> +  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD 
> License
>which accompanies this distribution.  The full text of the license may be 
> found at
> @@ -11,9 +11,8 @@
>
>  **/
>
> -#ifndef __ARM_VE_GRAPHICS_DXE_H__
> -#define __ARM_VE_GRAPHICS_DXE_H__
> -
> +#ifndef LCD_GRAPHICS_OUTPUT_DXE_H_
> +#define LCD_GRAPHICS_OUTPUT_DXE_H_
>
>  #include 
>
> @@ -25,7 +24,6 @@
>
>  #include 
>
> -
>  //
>  // Device structures
>  //
> @@ -106,4 +104,4 @@ InitializeDisplay (
>IN LCD_INSTANCE* Instance
>  );
>
> -#endif /* __ARM_VE_GRAPHICS_DXE_H__ */
> +#endif /* LCD_GRAPHICS_OUTPUT_DXE_H_ */
> diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h 
> b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> index 
> b9bdf471e2d65dba7a0fcb0f7ecc352bd576b46b..b9316ec8de8425a83e2f627f5c24821ff9a2f750
>  100644
> --- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> +++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
> @@ -1,6 +1,6 @@
>  /** @file
>
> - Copyright (c) 2011, ARM Ltd. All rights reserved.
> + Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD 
> License
>   which accompanies this distribution.  The full text of the license may be 
> found at
> @@ -11,8 +11,8 @@
>
>   **/
>
> -#ifndef __LCDPLATFORMLIB_H
> -#define __LCDPLATFORMLIB_H
> +#ifndef LCD_PLATFORM_LIB_H_
> +#define LCD_PLATFORM_LIB_H_
>
>  #include 
>
> @@ -158,8 +158,9 @@
>  #define LCD_12BPP_444_BLUE_MASK 0x000F
>  #define LCD_12BPP_444_RESERVED_MASK 0xF000
>
> -
> -// The enumeration indexes maps the PL111 LcdBpp values used in the LCD 
> Control Register
> +/** The enumeration indexes maps the PL111 LcdBpp values used in the LCD 
> Control
> +  Register
> +**/
>  typedef enum {
>LCD_BITS_PER_PIXEL_1 = 0,
>LCD_BITS_PER_PIXEL_2,
> @@ -171,7 +172,6 @@ typedef enum {
>LCD_BITS_PER_PIXEL_12_444
>  } LCD_BPP;
>
> -
>  EFI_STATUS
>  LcdPlatformInitializeDisplay (
>IN EFI_HANDLE   Handle
> @@ -218,4 +218,4 @@ LcdPlatformGetBpp (
>OUT LCD_BPP*  Bpp
>);
>
> -#endif
> +#endif /* LCD_PLATFORM_LIB_H_ */
> diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.h 
> b/ArmPlatformPkg/Library/HdLcd/HdLcd.h
> index 
> 6df97a9dfee60e9fda615cf3bea1b6a164a42333..861d3c398f7d6b9a171b4d8718c2816419d8e20a
>  100644
> --- a/ArmPlatformPkg/Library/HdLcd/HdLcd.h
> +++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.h
> @@ -1,6 +1,6 @@
> -/** @file  HDLcd.h
> +/** @file
>
> - Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
> + Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
>
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -12,13 +12,10 @@
>
>   

[edk2] [PATCH v2 01/13] ArmPlatformPkg: Tidy Lcd code: Coding standard

2017-12-22 Thread evan . lloyd
From: Girish Pathak 

There is no functional modification in this change
As preparation for further work, the formatting is corrected to meet
the EDKII coding standard.
Of specific note, some invalid include guards were fixed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Girish Pathak 
Signed-off-by: Evan Lloyd 
---
 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h |  10 +-
 ArmPlatformPkg/Include/Library/LcdPlatformLib.h|  14 +-
 ArmPlatformPkg/Library/HdLcd/HdLcd.h   |  21 ++-
 ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c | 187 
+++-
 ArmPlatformPkg/Library/HdLcd/HdLcd.c   |  96 
+-
 ArmPlatformPkg/Library/PL111Lcd/PL111Lcd.c |  72 

 6 files changed, 212 insertions(+), 188 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h 
b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
index 
b66efd34561f655b74a5ecfad8a97281cdd5929d..2b001b107927fc75317ce39d370049d7740953a8
 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.h
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2011, ARM Ltd. All rights reserved.
+  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -11,9 +11,8 @@
 
 **/
 
-#ifndef __ARM_VE_GRAPHICS_DXE_H__
-#define __ARM_VE_GRAPHICS_DXE_H__
-
+#ifndef LCD_GRAPHICS_OUTPUT_DXE_H_
+#define LCD_GRAPHICS_OUTPUT_DXE_H_
 
 #include 
 
@@ -25,7 +24,6 @@
 
 #include 
 
-
 //
 // Device structures
 //
@@ -106,4 +104,4 @@ InitializeDisplay (
   IN LCD_INSTANCE* Instance
 );
 
-#endif /* __ARM_VE_GRAPHICS_DXE_H__ */
+#endif /* LCD_GRAPHICS_OUTPUT_DXE_H_ */
diff --git a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h 
b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
index 
b9bdf471e2d65dba7a0fcb0f7ecc352bd576b46b..b9316ec8de8425a83e2f627f5c24821ff9a2f750
 100644
--- a/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
+++ b/ArmPlatformPkg/Include/Library/LcdPlatformLib.h
@@ -1,6 +1,6 @@
 /** @file
 
- Copyright (c) 2011, ARM Ltd. All rights reserved.
+ Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD 
License
  which accompanies this distribution.  The full text of the license may be 
found at
@@ -11,8 +11,8 @@
 
  **/
 
-#ifndef __LCDPLATFORMLIB_H
-#define __LCDPLATFORMLIB_H
+#ifndef LCD_PLATFORM_LIB_H_
+#define LCD_PLATFORM_LIB_H_
 
 #include 
 
@@ -158,8 +158,9 @@
 #define LCD_12BPP_444_BLUE_MASK 0x000F
 #define LCD_12BPP_444_RESERVED_MASK 0xF000
 
-
-// The enumeration indexes maps the PL111 LcdBpp values used in the LCD 
Control Register
+/** The enumeration indexes maps the PL111 LcdBpp values used in the LCD 
Control
+  Register
+**/
 typedef enum {
   LCD_BITS_PER_PIXEL_1 = 0,
   LCD_BITS_PER_PIXEL_2,
@@ -171,7 +172,6 @@ typedef enum {
   LCD_BITS_PER_PIXEL_12_444
 } LCD_BPP;
 
-
 EFI_STATUS
 LcdPlatformInitializeDisplay (
   IN EFI_HANDLE   Handle
@@ -218,4 +218,4 @@ LcdPlatformGetBpp (
   OUT LCD_BPP*  Bpp
   );
 
-#endif
+#endif /* LCD_PLATFORM_LIB_H_ */
diff --git a/ArmPlatformPkg/Library/HdLcd/HdLcd.h 
b/ArmPlatformPkg/Library/HdLcd/HdLcd.h
index 
6df97a9dfee60e9fda615cf3bea1b6a164a42333..861d3c398f7d6b9a171b4d8718c2816419d8e20a
 100644
--- a/ArmPlatformPkg/Library/HdLcd/HdLcd.h
+++ b/ArmPlatformPkg/Library/HdLcd/HdLcd.h
@@ -1,6 +1,6 @@
-/** @file  HDLcd.h
+/** @file
 
- Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
+ Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
 
  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD 
License
@@ -12,13 +12,10 @@
 
  **/
 
-#ifndef _HDLCD_H_
-#define _HDLCD_H_
+#ifndef HDLCD_H_
+#define HDLCD_H_
 
-//
 // HDLCD Controller Register Offsets
-//
-
 #define HDLCD_REG_VERSION ((UINTN)PcdGet32 (PcdArmHdLcdBase) + 
0x000)
 #define HDLCD_REG_INT_RAWSTAT ((UINTN)PcdGet32 (PcdArmHdLcdBase) + 
0x010)
 #define HDLCD_REG_INT_CLEAR   ((UINTN)PcdGet32 (PcdArmHdLcdBase) + 
0x014)
@@ -44,10 +41,7 @@
 #define HDLCD_REG_GREEN_SELECT((UINTN)PcdGet32 (PcdArmHdLcdBase) + 
0x248)
 #define HDLCD_REG_BLUE_SELECT ((UINTN)PcdGet32 (PcdArmHdLcdBase) + 
0x24C)
 
-
-//
 // HDLCD Values of registers
-//
 
 // HDLCD Interrupt mask, clear and status register
 #define HDLCD_DMA_END BIT0/* DMA has finished reading 
a frame */
@@ -79,6 +73,11 @@