public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/4] Normalize line endings to CRLF in ARM packages
@ 2019-04-03 22:00 Michael D Kinney
  2019-04-03 22:00 ` [Patch 1/4] ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment Michael D Kinney
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Michael D Kinney @ 2019-04-03 22:00 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Laszlo Ersek, Michael D Kinney

https://bugzilla.tianocore.org/show_bug.cgi?id=1659

Normalize line endings to use CRLF to pass PatchCheck.py

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Kinney, Michael D (4):
  ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment
  ArmPkg: Normalize line endings to CRLF
  ArmVirtPkg: Normalize line endings to CRLF
  ArmPlatformPkg: Normalize line endings to CRLF

 .../ArmScmiPerformanceProtocolPrivate.h       |   2 +-
 ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |  44 +-
 .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |  60 +-
 .../AArch64/Reset.asm                         |  70 +-
 .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |  58 +-
 .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |  68 +-
 ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 124 ++--
 ArmPkg/Library/GccLto/liblto-aarch64.s        |  54 +-
 ArmPkg/Library/GccLto/liblto-arm.s            | 122 ++--
 ArmPlatformPkg/Scripts/Ds5/profile.py         | 668 +++++++++---------
 ArmVirtPkg/Include/Platform/Hidden.h          |  56 +-
 11 files changed, 663 insertions(+), 663 deletions(-)

-- 
2.21.0.windows.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Patch 1/4] ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment
  2019-04-03 22:00 [Patch 0/4] Normalize line endings to CRLF in ARM packages Michael D Kinney
@ 2019-04-03 22:00 ` Michael D Kinney
  2019-04-03 22:00 ` [Patch 2/4] ArmPkg: Normalize line endings to CRLF Michael D Kinney
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Michael D Kinney @ 2019-04-03 22:00 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Michael D Kinney

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1093 bytes --]

https://bugzilla.tianocore.org/show_bug.cgi?id=1659

Remove non-ASCII character in comment that makes it
more challenging to process with python-based
scanning tools.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h b/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h
index 4514f45a9f..da0cd2b34b 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h
+++ b/ArmPkg/Drivers/ArmScmiDxe/ArmScmiPerformanceProtocolPrivate.h
@@ -29,7 +29,7 @@
 #define NUM_REMAIN_PERF_LEVELS(Lvls) (Lvls >> NUM_REMAIN_PERF_LEVELS_SHIFT)
 
 /** Return values for SCMI_MESSAGE_ID_PERFORMANCE_DESCRIBE_LEVELS command.
-  SCMI Spec § 4.5.2.5
+  SCMI Spec 4.5.2.5
 **/
 typedef struct {
   UINT32 NumLevels;
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Patch 2/4] ArmPkg: Normalize line endings to CRLF
  2019-04-03 22:00 [Patch 0/4] Normalize line endings to CRLF in ARM packages Michael D Kinney
  2019-04-03 22:00 ` [Patch 1/4] ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment Michael D Kinney
@ 2019-04-03 22:00 ` Michael D Kinney
  2019-04-03 22:00 ` [Patch 3/4] ArmVirtPkg: " Michael D Kinney
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Michael D Kinney @ 2019-04-03 22:00 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Michael D Kinney

https://bugzilla.tianocore.org/show_bug.cgi?id=1659

Normalize line endings to use CRLF to pass PatchCheck.py

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |  44 +++----
 .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |  60 ++++-----
 .../AArch64/Reset.asm                         |  70 +++++-----
 .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |  58 ++++----
 .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |  68 +++++-----
 ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 124 +++++++++---------
 ArmPkg/Library/GccLto/liblto-aarch64.s        |  54 ++++----
 ArmPkg/Library/GccLto/liblto-arm.s            | 122 ++++++++---------
 8 files changed, 300 insertions(+), 300 deletions(-)

diff --git a/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c b/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c
index e5d4e51133..393fc1a922 100644
--- a/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c
+++ b/ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c
@@ -1,22 +1,22 @@
-//
-//  Copyright (c) 2016, Linaro Limited. 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
-//  http://opensource.org/licenses/bsd-license.php
-//
-//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-//
-
-#include <Base.h>
-#include <Library/ArmSmcLib.h>
-
-VOID
-ArmCallSmc (
-  IN OUT ARM_SMC_ARGS *Args
-  )
-{
-}
+//
+//  Copyright (c) 2016, Linaro Limited. 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
+//  http://opensource.org/licenses/bsd-license.php
+//
+//  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+//
+//
+
+#include <Base.h>
+#include <Library/ArmSmcLib.h>
+
+VOID
+ArmCallSmc (
+  IN OUT ARM_SMC_ARGS *Args
+  )
+{
+}
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
index 1edca941cb..208422b8a6 100644
--- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
@@ -1,30 +1,30 @@
-/** @file
-  ResetSystemLib implementation using PSCI calls
-
-  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-
-  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
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <AsmMacroIoLibV8.h>
-
-ASM_FUNC(DisableMmuAndReenterPei)
-  stp   x29, x30, [sp, #-16]!
-  mov   x29, sp
-
-  bl    ArmDisableMmu
-
-  // no memory accesses after MMU and caches have been disabled
-
-  MOV64 (x0, FixedPcdGet64 (PcdFvBaseAddress))
-  blr   x0
-
-  // never returns
-  nop
+/** @file
+  ResetSystemLib implementation using PSCI calls
+
+  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
+
+  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
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <AsmMacroIoLibV8.h>
+
+ASM_FUNC(DisableMmuAndReenterPei)
+  stp   x29, x30, [sp, #-16]!
+  mov   x29, sp
+
+  bl    ArmDisableMmu
+
+  // no memory accesses after MMU and caches have been disabled
+
+  MOV64 (x0, FixedPcdGet64 (PcdFvBaseAddress))
+  blr   x0
+
+  // never returns
+  nop
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
index 9e30c13329..090035178f 100644
--- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
@@ -1,35 +1,35 @@
-;/** @file
-;  ResetSystemLib implementation using PSCI calls
-;
-;  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-;
-;  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
-;  http://opensource.org/licenses/bsd-license.php
-;
-;  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-;  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;**/
-
-  AREA Reset, CODE, READONLY
-
-  EXPORT DisableMmuAndReenterPei
-  IMPORT ArmDisableMmu
-
-DisableMmuAndReenterPei
-  stp   x29, x30, [sp, #-16]!
-  mov   x29, sp
-
-  bl    ArmDisableMmu
-
-  ; no memory accesses after MMU and caches have been disabled
-
-  movl  x0, FixedPcdGet64 (PcdFvBaseAddress)
-  blr   x0
-
-  ; never returns
-  nop
-
-  END
+;/** @file
+;  ResetSystemLib implementation using PSCI calls
+;
+;  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
+;
+;  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
+;  http://opensource.org/licenses/bsd-license.php
+;
+;  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+;  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+;
+;**/
+
+  AREA Reset, CODE, READONLY
+
+  EXPORT DisableMmuAndReenterPei
+  IMPORT ArmDisableMmu
+
+DisableMmuAndReenterPei
+  stp   x29, x30, [sp, #-16]!
+  mov   x29, sp
+
+  bl    ArmDisableMmu
+
+  ; no memory accesses after MMU and caches have been disabled
+
+  movl  x0, FixedPcdGet64 (PcdFvBaseAddress)
+  blr   x0
+
+  ; never returns
+  nop
+
+  END
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
index b6fe2bd82b..7fef8bf301 100644
--- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
@@ -1,29 +1,29 @@
-/** @file
-  ResetSystemLib implementation using PSCI calls
-
-  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-
-  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
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(DisableMmuAndReenterPei)
-  push  {lr}
-
-  bl    ArmDisableMmu
-
-  // no memory accesses after MMU and caches have been disabled
-
-  MOV32 (r0, FixedPcdGet64 (PcdFvBaseAddress))
-  blx   r0
-
-  // never returns
-  nop
+/** @file
+  ResetSystemLib implementation using PSCI calls
+
+  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
+
+  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
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <AsmMacroIoLib.h>
+
+ASM_FUNC(DisableMmuAndReenterPei)
+  push  {lr}
+
+  bl    ArmDisableMmu
+
+  // no memory accesses after MMU and caches have been disabled
+
+  MOV32 (r0, FixedPcdGet64 (PcdFvBaseAddress))
+  blx   r0
+
+  // never returns
+  nop
diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm
index fa4fbd0e07..98b4d2020d 100644
--- a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm
+++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm
@@ -1,34 +1,34 @@
-;/** @file
-;  ResetSystemLib implementation using PSCI calls
-;
-;  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
-;
-;  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
-;  http://opensource.org/licenses/bsd-license.php
-;
-;  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-;  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-;
-;**/
-
-  INCLUDE AsmMacroExport.inc
-  PRESERVE8
-
-  IMPORT ArmDisableMmu
-
-RVCT_ASM_EXPORT DisableMmuAndReenterPei
-  push  {lr}
-
-  bl    ArmDisableMmu
-
-  ; no memory accesses after MMU and caches have been disabled
-
-  mov32 r0, FixedPcdGet64 (PcdFvBaseAddress)
-  blx   r0
-
-  ; never returns
-  nop
-
-  END
+;/** @file
+;  ResetSystemLib implementation using PSCI calls
+;
+;  Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
+;
+;  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
+;  http://opensource.org/licenses/bsd-license.php
+;
+;  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+;  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+;
+;**/
+
+  INCLUDE AsmMacroExport.inc
+  PRESERVE8
+
+  IMPORT ArmDisableMmu
+
+RVCT_ASM_EXPORT DisableMmuAndReenterPei
+  push  {lr}
+
+  bl    ArmDisableMmu
+
+  ; no memory accesses after MMU and caches have been disabled
+
+  mov32 r0, FixedPcdGet64 (PcdFvBaseAddress)
+  blx   r0
+
+  ; never returns
+  nop
+
+  END
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
index 7271b4be6f..30a0a1ba03 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
+++ b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
@@ -1,62 +1,62 @@
-//------------------------------------------------------------------------------
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-//
-// 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 http://opensource.org/licenses/bsd-license.php
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
-// IMPLIED.
-//
-//------------------------------------------------------------------------------
-
-typedef __SIZE_TYPE__ size_t;
-
-static __attribute__((__used__))
-void *__memset(void *s, int c, size_t n)
-{
-  unsigned char *d = s;
-
-  while (n--)
-    *d++ = c;
-
-  return s;
-}
-
-//
-// Other modules (such as CryptoPkg/IntrinsicLib) may provide another
-// implementation of memset(), which may conflict with this one if this
-// object was pulled into the link due to the definitions below. So make
-// our memset() 'weak' to let the other implementation take precedence.
-//
-__attribute__((__weak__, __alias__("__memset")))
-void *memset(void *dest, int c, size_t n);
-
-#ifdef __arm__
-
-void __aeabi_memset(void *dest, size_t n, int c)
-{
-  __memset(dest, c, n);
-}
-
-__attribute__((__alias__("__aeabi_memset")))
-void __aeabi_memset4(void *dest, size_t n, int c);
-
-__attribute__((__alias__("__aeabi_memset")))
-void __aeabi_memset8(void *dest, size_t n, int c);
-
-void __aeabi_memclr(void *dest, size_t n)
-{
-  __memset(dest, 0, n);
-}
-
-__attribute__((__alias__("__aeabi_memclr")))
-void __aeabi_memclr4(void *dest, size_t n);
-
-__attribute__((__alias__("__aeabi_memclr")))
-void __aeabi_memclr8(void *dest, size_t n);
-
-#endif
+//------------------------------------------------------------------------------
+//
+// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
+//
+// 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 http://opensource.org/licenses/bsd-license.php
+//
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
+// IMPLIED.
+//
+//------------------------------------------------------------------------------
+
+typedef __SIZE_TYPE__ size_t;
+
+static __attribute__((__used__))
+void *__memset(void *s, int c, size_t n)
+{
+  unsigned char *d = s;
+
+  while (n--)
+    *d++ = c;
+
+  return s;
+}
+
+//
+// Other modules (such as CryptoPkg/IntrinsicLib) may provide another
+// implementation of memset(), which may conflict with this one if this
+// object was pulled into the link due to the definitions below. So make
+// our memset() 'weak' to let the other implementation take precedence.
+//
+__attribute__((__weak__, __alias__("__memset")))
+void *memset(void *dest, int c, size_t n);
+
+#ifdef __arm__
+
+void __aeabi_memset(void *dest, size_t n, int c)
+{
+  __memset(dest, c, n);
+}
+
+__attribute__((__alias__("__aeabi_memset")))
+void __aeabi_memset4(void *dest, size_t n, int c);
+
+__attribute__((__alias__("__aeabi_memset")))
+void __aeabi_memset8(void *dest, size_t n, int c);
+
+void __aeabi_memclr(void *dest, size_t n)
+{
+  __memset(dest, 0, n);
+}
+
+__attribute__((__alias__("__aeabi_memclr")))
+void __aeabi_memclr4(void *dest, size_t n);
+
+__attribute__((__alias__("__aeabi_memclr")))
+void __aeabi_memclr8(void *dest, size_t n);
+
+#endif
diff --git a/ArmPkg/Library/GccLto/liblto-aarch64.s b/ArmPkg/Library/GccLto/liblto-aarch64.s
index 45000d3277..28ef4031fd 100644
--- a/ArmPkg/Library/GccLto/liblto-aarch64.s
+++ b/ArmPkg/Library/GccLto/liblto-aarch64.s
@@ -1,27 +1,27 @@
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-//
-// This program and the accompanying materials are licensed and made available under
-// the terms and conditions of the BSD License that accompanies this distribution.
-// The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-
-//
-// GCC in LTO mode interoperates poorly with non-standard libraries that
-// provide implementations of compiler intrinsics such as memcpy/memset
-// or the stack protector entry points.
-//
-// By referencing these functions from a non-LTO object that can be passed
-// to the linker via the -plugin-opt=-pass-through=-lxxx options, the
-// intrinsics are included in the link in a way that allows them to be
-// pruned again if no other references to them exist.
-//
-
-	.long	memcpy - .
-	.long	memset - .
-	.long	__stack_chk_fail - .
-	.long	__stack_chk_guard - .
+//
+// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
+//
+// This program and the accompanying materials are licensed and made available under
+// the terms and conditions of the BSD License that accompanies this distribution.
+// The full text of the license may be found at
+// http://opensource.org/licenses/bsd-license.php.
+//
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+//
+
+//
+// GCC in LTO mode interoperates poorly with non-standard libraries that
+// provide implementations of compiler intrinsics such as memcpy/memset
+// or the stack protector entry points.
+//
+// By referencing these functions from a non-LTO object that can be passed
+// to the linker via the -plugin-opt=-pass-through=-lxxx options, the
+// intrinsics are included in the link in a way that allows them to be
+// pruned again if no other references to them exist.
+//
+
+	.long	memcpy - .
+	.long	memset - .
+	.long	__stack_chk_fail - .
+	.long	__stack_chk_guard - .
diff --git a/ArmPkg/Library/GccLto/liblto-arm.s b/ArmPkg/Library/GccLto/liblto-arm.s
index bc16320a46..75abf6c52e 100644
--- a/ArmPkg/Library/GccLto/liblto-arm.s
+++ b/ArmPkg/Library/GccLto/liblto-arm.s
@@ -1,61 +1,61 @@
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-//
-// This program and the accompanying materials are licensed and made available under
-// the terms and conditions of the BSD License that accompanies this distribution.
-// The full text of the license may be found at
-// http://opensource.org/licenses/bsd-license.php.
-//
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-//
-
-//
-// GCC in LTO mode interoperates poorly with non-standard libraries that
-// provide implementations of compiler intrinsics such as memcpy/memset
-// or the stack protector entry points.
-//
-// By referencing these functions from a non-LTO object that can be passed
-// to the linker via the -plugin-opt=-pass-through=-lxxx options, the
-// intrinsics are included in the link in a way that allows them to be
-// pruned again if no other references to them exist.
-//
-
-	.long	memcpy - .
-	.long	memset - .
-	.long	__stack_chk_fail - .
-	.long	__stack_chk_guard - .
-	.long __ashrdi3 - .
-	.long __ashldi3 - .
-	.long __aeabi_idiv - .
-	.long __aeabi_idivmod - .
-	.long __aeabi_uidiv - .
-	.long __aeabi_uidivmod - .
-	.long __divdi3 - .
-	.long __divsi3 - .
-	.long __lshrdi3 - .
-	.long __aeabi_memcpy - .
-	.long __aeabi_memset - .
-	.long memmove - .
-	.long __modsi3 - .
-	.long __moddi3 - .
-	.long __muldi3 - .
-	.long __aeabi_lmul - .
-	.long __ARM_ll_mullu - .
-	.long __udivsi3 - .
-	.long __umodsi3 - .
-	.long __udivdi3 - .
-	.long __umoddi3 - .
-	.long __udivmoddi4 - .
-	.long __clzsi2 - .
-	.long __ctzsi2 - .
-	.long __ucmpdi2 - .
-	.long __switch8 - .
-	.long __switchu8 - .
-	.long __switch16 - .
-	.long __switch32 - .
-	.long __aeabi_ulcmp - .
-	.long __aeabi_uldivmod - .
-	.long __aeabi_ldivmod - .
-	.long __aeabi_llsr - .
-	.long __aeabi_llsl - .
+//
+// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
+//
+// This program and the accompanying materials are licensed and made available under
+// the terms and conditions of the BSD License that accompanies this distribution.
+// The full text of the license may be found at
+// http://opensource.org/licenses/bsd-license.php.
+//
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+//
+
+//
+// GCC in LTO mode interoperates poorly with non-standard libraries that
+// provide implementations of compiler intrinsics such as memcpy/memset
+// or the stack protector entry points.
+//
+// By referencing these functions from a non-LTO object that can be passed
+// to the linker via the -plugin-opt=-pass-through=-lxxx options, the
+// intrinsics are included in the link in a way that allows them to be
+// pruned again if no other references to them exist.
+//
+
+	.long	memcpy - .
+	.long	memset - .
+	.long	__stack_chk_fail - .
+	.long	__stack_chk_guard - .
+	.long __ashrdi3 - .
+	.long __ashldi3 - .
+	.long __aeabi_idiv - .
+	.long __aeabi_idivmod - .
+	.long __aeabi_uidiv - .
+	.long __aeabi_uidivmod - .
+	.long __divdi3 - .
+	.long __divsi3 - .
+	.long __lshrdi3 - .
+	.long __aeabi_memcpy - .
+	.long __aeabi_memset - .
+	.long memmove - .
+	.long __modsi3 - .
+	.long __moddi3 - .
+	.long __muldi3 - .
+	.long __aeabi_lmul - .
+	.long __ARM_ll_mullu - .
+	.long __udivsi3 - .
+	.long __umodsi3 - .
+	.long __udivdi3 - .
+	.long __umoddi3 - .
+	.long __udivmoddi4 - .
+	.long __clzsi2 - .
+	.long __ctzsi2 - .
+	.long __ucmpdi2 - .
+	.long __switch8 - .
+	.long __switchu8 - .
+	.long __switch16 - .
+	.long __switch32 - .
+	.long __aeabi_ulcmp - .
+	.long __aeabi_uldivmod - .
+	.long __aeabi_ldivmod - .
+	.long __aeabi_llsr - .
+	.long __aeabi_llsl - .
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Patch 3/4] ArmVirtPkg: Normalize line endings to CRLF
  2019-04-03 22:00 [Patch 0/4] Normalize line endings to CRLF in ARM packages Michael D Kinney
  2019-04-03 22:00 ` [Patch 1/4] ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment Michael D Kinney
  2019-04-03 22:00 ` [Patch 2/4] ArmPkg: Normalize line endings to CRLF Michael D Kinney
@ 2019-04-03 22:00 ` Michael D Kinney
  2019-04-04 12:52   ` [edk2-devel] " Laszlo Ersek
  2019-04-03 22:00 ` [Patch 4/4] ArmPlatformPkg: " Michael D Kinney
  2019-04-04  3:54 ` [Patch 0/4] Normalize line endings to CRLF in ARM packages Leif Lindholm
  4 siblings, 1 reply; 13+ messages in thread
From: Michael D Kinney @ 2019-04-03 22:00 UTC (permalink / raw)
  To: devel; +Cc: Laszlo Ersek, Ard Biesheuvel, Michael D Kinney

https://bugzilla.tianocore.org/show_bug.cgi?id=1659

Normalize line endings to use CRLF to pass PatchCheck.py

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 ArmVirtPkg/Include/Platform/Hidden.h | 56 ++++++++++++++--------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/ArmVirtPkg/Include/Platform/Hidden.h b/ArmVirtPkg/Include/Platform/Hidden.h
index fbd3467471..997866ff50 100644
--- a/ArmVirtPkg/Include/Platform/Hidden.h
+++ b/ArmVirtPkg/Include/Platform/Hidden.h
@@ -1,28 +1,28 @@
-/** @file
-
-  Copyright (c) 2018, Linaro Limited. 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
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __PLATFORM_HIDDEN_H
-#define __PLATFORM_HIDDEN_H
-
-//
-// Setting the GCC -fvisibility=hidden command line option is not quite the same
-// as setting the pragma below: the former only affects definitions, whereas the
-// pragma affects extern declarations as well. So if we want to ensure that no
-// GOT indirected symbol references are emitted, we need to use the pragma, or
-// GOT based cross object references could be emitted, e.g., in libraries, and
-// these cannot be relaxed to ordinary symbol references at link time.
-//
-#pragma GCC visibility push (hidden)
-
-#endif
+/** @file
+
+  Copyright (c) 2018, Linaro Limited. 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
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PLATFORM_HIDDEN_H
+#define __PLATFORM_HIDDEN_H
+
+//
+// Setting the GCC -fvisibility=hidden command line option is not quite the same
+// as setting the pragma below: the former only affects definitions, whereas the
+// pragma affects extern declarations as well. So if we want to ensure that no
+// GOT indirected symbol references are emitted, we need to use the pragma, or
+// GOT based cross object references could be emitted, e.g., in libraries, and
+// these cannot be relaxed to ordinary symbol references at link time.
+//
+#pragma GCC visibility push (hidden)
+
+#endif
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Patch 4/4] ArmPlatformPkg: Normalize line endings to CRLF
  2019-04-03 22:00 [Patch 0/4] Normalize line endings to CRLF in ARM packages Michael D Kinney
                   ` (2 preceding siblings ...)
  2019-04-03 22:00 ` [Patch 3/4] ArmVirtPkg: " Michael D Kinney
@ 2019-04-03 22:00 ` Michael D Kinney
  2019-04-04  3:54 ` [Patch 0/4] Normalize line endings to CRLF in ARM packages Leif Lindholm
  4 siblings, 0 replies; 13+ messages in thread
From: Michael D Kinney @ 2019-04-03 22:00 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Michael D Kinney

https://bugzilla.tianocore.org/show_bug.cgi?id=1659

Normalize line endings to use CRLF to pass PatchCheck.py

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 ArmPlatformPkg/Scripts/Ds5/profile.py | 668 +++++++++++++-------------
 1 file changed, 334 insertions(+), 334 deletions(-)

diff --git a/ArmPlatformPkg/Scripts/Ds5/profile.py b/ArmPlatformPkg/Scripts/Ds5/profile.py
index 2e55993c60..38342c62d5 100644
--- a/ArmPlatformPkg/Scripts/Ds5/profile.py
+++ b/ArmPlatformPkg/Scripts/Ds5/profile.py
@@ -1,334 +1,334 @@
-#!/usr/bin/python
-
-#
-#  Copyright (c) 2014, ARM Limited. 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
-#  http://opensource.org/licenses/bsd-license.php
-#
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-
-import getopt
-import operator
-import os
-import pickle
-import sys
-from sys import argv
-from cStringIO import StringIO
-
-modules = {}
-functions = {}
-functions_addr = {}
-
-def usage():
-	print "-t,--trace: Location of the Trace file"
-	print "-s,--symbols: Location of the symbols and modules"
-
-def get_address_from_string(address):
-	return int(address.strip("S:").strip("N:").strip("EL2:").strip("EL1:"), 16)
-
-def get_module_from_addr(modules, addr):
-	for key,value in modules.items():
-		if (value['start'] <= addr) and (addr <= value['end']):
-			return key
-	return None
-
-def add_cycles_to_function(functions, func_name, addr, cycles):
-	if func_name != "<Unknown>":
-		# Check if we are still in the previous function
-		if add_cycles_to_function.prev_func_name == func_name:
-			add_cycles_to_function.prev_entry['cycles'] += cycles
-			return (add_cycles_to_function.prev_func_name, add_cycles_to_function.prev_module_name)
-
-		if func_name in functions.keys():
-			for module_name, module_value in functions[func_name].iteritems():
-				if (module_value['start'] <= addr) and (addr < module_value['end']):
-					module_value['cycles'] += cycles
-
-					add_cycles_to_function.prev_func_name   = func_name
-					add_cycles_to_function.prev_module_name = module_name
-					add_cycles_to_function.prev_entry       = module_value
-					return (func_name, module_name)
-				elif (module_value['end'] == 0):
-					module_value['cycles'] += cycles
-
-					add_cycles_to_function.prev_func_name   = func_name
-					add_cycles_to_function.prev_module_name = module_name
-					add_cycles_to_function.prev_entry       = module_value
-					return (func_name, module_name)
-
-		# Workaround to fix the 'info func' limitation that does not expose the 'static' function
-		module_name = get_module_from_addr(modules, addr)
-		functions[func_name] = {}
-		functions[func_name][module_name] = {}
-		functions[func_name][module_name]['start']  = 0
-		functions[func_name][module_name]['end']    = 0
-		functions[func_name][module_name]['cycles'] = cycles
-		functions[func_name][module_name]['count']  = 0
-
-		add_cycles_to_function.prev_func_name   = func_name
-		add_cycles_to_function.prev_module_name = module_name
-		add_cycles_to_function.prev_entry       = functions[func_name][module_name]
-		return (func_name, module_name)
-	else:
-		# Check if we are still in the previous function
-		if (add_cycles_to_function.prev_entry is not None) and (add_cycles_to_function.prev_entry['start'] <= addr) and (addr < add_cycles_to_function.prev_entry['end']):
-			add_cycles_to_function.prev_entry['cycles'] += cycles
-			return (add_cycles_to_function.prev_func_name, add_cycles_to_function.prev_module_name)
-
-		# Generate the key for the given address
-		key = addr & ~0x0FFF
-
-		if key not in functions_addr.keys():
-			if 'Unknown' not in functions.keys():
-				functions['Unknown'] = {}
-			if 'Unknown' not in functions['Unknown'].keys():
-				functions['Unknown']['Unknown'] = {}
-				functions['Unknown']['Unknown']['cycles'] = 0
-				functions['Unknown']['Unknown']['count'] = 0
-			functions['Unknown']['Unknown']['cycles'] += cycles
-
-			add_cycles_to_function.prev_func_name = None
-			return None
-
-		for func_key, module in functions_addr[key].iteritems():
-			for module_key, module_value in module.iteritems():
-				if (module_value['start'] <= addr) and (addr < module_value['end']):
-					module_value['cycles'] += cycles
-
-					# In case o <Unknown> we prefer to fallback on the direct search
-					add_cycles_to_function.prev_func_name   = func_key
-					add_cycles_to_function.prev_module_name = module_key
-					add_cycles_to_function.prev_entry       = module_value
-					return (func_key, module_key)
-
-	print "Warning: Function %s @ 0x%x not found" % (func_name, addr)
-
-	add_cycles_to_function.prev_func_name = None
-	return None
-
-# Static variables for the previous function
-add_cycles_to_function.prev_func_name = None
-add_cycles_to_function.prev_entry     = None
-
-def trace_read():
-	global trace_process
-	line = trace.readline()
-	trace_process += len(line)
-	return line
-
-#
-# Parse arguments
-#
-trace_name = None
-symbols_file = None
-
-opts,args = getopt.getopt(sys.argv[1:], "ht:vs:v", ["help","trace=","symbols="])
-if (opts is None) or (not opts):
-	usage()
-	sys.exit()
-
-for o,a in opts:
-    if o in ("-h","--help"):
-        usage()
-        sys.exit()
-    elif o in ("-t","--trace"):
-        trace_name = a
-    elif o in ("-s","--symbols"):
-        symbols_file = a
-    else:
-        assert False, "Unhandled option (%s)" % o
-
-#
-# We try first to see if we run the script from DS-5
-#
-try:
-	from arm_ds.debugger_v1 import Debugger
-	from arm_ds.debugger_v1 import DebugException
-
-	# Debugger object for accessing the debugger
-	debugger = Debugger()
-
-	# Initialisation commands
-	ec = debugger.getExecutionContext(0)
-	ec.getExecutionService().stop()
-	ec.getExecutionService().waitForStop()
-	# in case the execution context reference is out of date
-	ec = debugger.getExecutionContext(0)
-
-	#
-	# Get the module name and their memory range
-	#
-	info_file = ec.executeDSCommand("info file")
-	info_file_str = StringIO(info_file)
-
-	line = info_file_str.readline().strip('\n')
-	while line != '':
-		if ("Symbols from" in line):
-			# Get the module name from the line 'Symbols from "/home/...."'
-			module_name = line.split("\"")[1].split("/")[-1]
-			modules[module_name] = {}
-
-			# Look for the text section
-			line = info_file_str.readline().strip('\n')
-			while (line != '') and ("Symbols from" not in line):
-				if ("ER_RO" in line):
-					modules[module_name]['start'] = get_address_from_string(line.split()[0])
-					modules[module_name]['end']   = get_address_from_string(line.split()[2])
-					line = info_file_str.readline().strip('\n')
-					break;
-				if (".text" in line):
-					modules[module_name]['start'] = get_address_from_string(line.split()[0])
-					modules[module_name]['end']   = get_address_from_string(line.split()[2])
-					line = info_file_str.readline().strip('\n')
-					break;
-				line = info_file_str.readline().strip('\n')
-		line = info_file_str.readline().strip('\n')
-
-	#
-	# Get the function name and their memory range
-	#
-	info_func = ec.executeDSCommand("info func")
-	info_func_str = StringIO(info_func)
-
-	# Skip the first line 'Low-level symbols ...'
-	line = info_func_str.readline().strip('\n')
-	func_prev = None
-	while line != '':
-		# We ignore all the functions after 'Functions in'
-		if ("Functions in " in line):
-			line = info_func_str.readline().strip('\n')
-			while line != '':
-				line = info_func_str.readline().strip('\n')
-			line = info_func_str.readline().strip('\n')
-			continue
-
-		if ("Low-level symbols" in line):
-			# We need to fixup the last function of the module
-			if func_prev is not None:
-				func_prev['end'] = modules[module_name]['end']
-				func_prev = None
-
-			line = info_func_str.readline().strip('\n')
-			continue
-
-		func_name = line.split()[1]
-		func_start = get_address_from_string(line.split()[0])
-		module_name = get_module_from_addr(modules, func_start)
-
-		if func_name not in functions.keys():
-			functions[func_name] = {}
-		functions[func_name][module_name] = {}
-		functions[func_name][module_name]['start'] = func_start
-		functions[func_name][module_name]['cycles'] = 0
-		functions[func_name][module_name]['count'] = 0
-
-		# Set the end address of the previous function
-		if func_prev is not None:
-			func_prev['end'] = func_start
-		func_prev = functions[func_name][module_name]
-
-		line = info_func_str.readline().strip('\n')
-
-	# Fixup the last function
-	func_prev['end'] = modules[module_name]['end']
-
-	if symbols_file is not None:
-		pickle.dump((modules, functions), open(symbols_file, "w"))
-except:
-	if symbols_file is None:
-		print "Error: Symbols file is required when run out of ARM DS-5"
-		sys.exit()
-
-	(modules, functions) = pickle.load(open(symbols_file, "r"))
-
-#
-# Build optimized table for the <Unknown> functions
-#
-functions_addr = {}
-for func_key, module in functions.iteritems():
-	for module_key, module_value in module.iteritems():
-		key = module_value['start'] & ~0x0FFF
-		if key not in functions_addr.keys():
-			functions_addr[key] = {}
-		if func_key not in functions_addr[key].keys():
-			functions_addr[key][func_key] = {}
-		functions_addr[key][func_key][module_key] = module_value
-
-#
-# Process the trace file
-#
-if trace_name is None:
-	sys.exit()
-
-trace = open(trace_name, "r")
-trace_size = os.path.getsize(trace_name)
-trace_process = 0
-
-# Get the column names from the first line
-columns = trace_read().split()
-column_addr     = columns.index('Address')
-column_cycles   = columns.index('Cycles')
-column_function = columns.index('Function')
-
-line = trace_read()
-i = 0
-prev_callee = None
-while line:
-	try:
-		func_name = line.split('\t')[column_function].strip()
-		address   = get_address_from_string(line.split('\t')[column_addr])
-		cycles    = int(line.split('\t')[column_cycles])
-		callee = add_cycles_to_function(functions, func_name, address, cycles)
-		if (prev_callee != None) and (prev_callee != callee):
-			functions[prev_callee[0]][prev_callee[1]]['count'] += 1
-		prev_callee = callee
-	except ValueError:
-		pass
-	line = trace_read()
-	if ((i % 1000000) == 0) and (i != 0):
-		percent = (trace_process * 100.00) / trace_size
-		print "Processing file ... (%.2f %%)" % (percent)
-	i = i + 1
-
-# Fixup the last callee
-functions[prev_callee[0]][prev_callee[1]]['count'] += 1
-
-#
-# Process results
-#
-functions_cycles     = {}
-all_functions_cycles = {}
-total_cycles         = 0
-
-for func_key, module in functions.iteritems():
-	for module_key, module_value in module.iteritems():
-		key = "%s/%s" % (module_key, func_key)
-		functions_cycles[key] = (module_value['cycles'], module_value['count'])
-		total_cycles += module_value['cycles']
-
-		if func_key not in all_functions_cycles.keys():
-			all_functions_cycles[func_key] = (module_value['cycles'], module_value['count'])
-		else:
-			all_functions_cycles[func_key] = tuple(map(sum, zip(all_functions_cycles[func_key], (module_value['cycles'], module_value['count']))))
-
-sorted_functions_cycles     = sorted(functions_cycles.iteritems(), key=operator.itemgetter(1), reverse = True)
-sorted_all_functions_cycles = sorted(all_functions_cycles.items(), key=operator.itemgetter(1), reverse = True)
-
-print
-print "----"
-for (key,value) in sorted_functions_cycles[:20]:
-	if value[0] != 0:
-		print "%s (cycles: %d - %d%%, count: %d)" % (key, value[0], (value[0] * 100) / total_cycles, value[1])
-	else:
-		break;
-print "----"
-for (key,value) in sorted_all_functions_cycles[:20]: 
-	if value[0] != 0:
-		print "%s (cycles: %d - %d%%, count: %d)" % (key, value[0], (value[0] * 100) / total_cycles, value[1])
-	else:
-		break;
+#!/usr/bin/python
+
+#
+#  Copyright (c) 2014, ARM Limited. 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
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+
+import getopt
+import operator
+import os
+import pickle
+import sys
+from sys import argv
+from cStringIO import StringIO
+
+modules = {}
+functions = {}
+functions_addr = {}
+
+def usage():
+	print "-t,--trace: Location of the Trace file"
+	print "-s,--symbols: Location of the symbols and modules"
+
+def get_address_from_string(address):
+	return int(address.strip("S:").strip("N:").strip("EL2:").strip("EL1:"), 16)
+
+def get_module_from_addr(modules, addr):
+	for key,value in modules.items():
+		if (value['start'] <= addr) and (addr <= value['end']):
+			return key
+	return None
+
+def add_cycles_to_function(functions, func_name, addr, cycles):
+	if func_name != "<Unknown>":
+		# Check if we are still in the previous function
+		if add_cycles_to_function.prev_func_name == func_name:
+			add_cycles_to_function.prev_entry['cycles'] += cycles
+			return (add_cycles_to_function.prev_func_name, add_cycles_to_function.prev_module_name)
+
+		if func_name in functions.keys():
+			for module_name, module_value in functions[func_name].iteritems():
+				if (module_value['start'] <= addr) and (addr < module_value['end']):
+					module_value['cycles'] += cycles
+
+					add_cycles_to_function.prev_func_name   = func_name
+					add_cycles_to_function.prev_module_name = module_name
+					add_cycles_to_function.prev_entry       = module_value
+					return (func_name, module_name)
+				elif (module_value['end'] == 0):
+					module_value['cycles'] += cycles
+
+					add_cycles_to_function.prev_func_name   = func_name
+					add_cycles_to_function.prev_module_name = module_name
+					add_cycles_to_function.prev_entry       = module_value
+					return (func_name, module_name)
+
+		# Workaround to fix the 'info func' limitation that does not expose the 'static' function
+		module_name = get_module_from_addr(modules, addr)
+		functions[func_name] = {}
+		functions[func_name][module_name] = {}
+		functions[func_name][module_name]['start']  = 0
+		functions[func_name][module_name]['end']    = 0
+		functions[func_name][module_name]['cycles'] = cycles
+		functions[func_name][module_name]['count']  = 0
+
+		add_cycles_to_function.prev_func_name   = func_name
+		add_cycles_to_function.prev_module_name = module_name
+		add_cycles_to_function.prev_entry       = functions[func_name][module_name]
+		return (func_name, module_name)
+	else:
+		# Check if we are still in the previous function
+		if (add_cycles_to_function.prev_entry is not None) and (add_cycles_to_function.prev_entry['start'] <= addr) and (addr < add_cycles_to_function.prev_entry['end']):
+			add_cycles_to_function.prev_entry['cycles'] += cycles
+			return (add_cycles_to_function.prev_func_name, add_cycles_to_function.prev_module_name)
+
+		# Generate the key for the given address
+		key = addr & ~0x0FFF
+
+		if key not in functions_addr.keys():
+			if 'Unknown' not in functions.keys():
+				functions['Unknown'] = {}
+			if 'Unknown' not in functions['Unknown'].keys():
+				functions['Unknown']['Unknown'] = {}
+				functions['Unknown']['Unknown']['cycles'] = 0
+				functions['Unknown']['Unknown']['count'] = 0
+			functions['Unknown']['Unknown']['cycles'] += cycles
+
+			add_cycles_to_function.prev_func_name = None
+			return None
+
+		for func_key, module in functions_addr[key].iteritems():
+			for module_key, module_value in module.iteritems():
+				if (module_value['start'] <= addr) and (addr < module_value['end']):
+					module_value['cycles'] += cycles
+
+					# In case o <Unknown> we prefer to fallback on the direct search
+					add_cycles_to_function.prev_func_name   = func_key
+					add_cycles_to_function.prev_module_name = module_key
+					add_cycles_to_function.prev_entry       = module_value
+					return (func_key, module_key)
+
+	print "Warning: Function %s @ 0x%x not found" % (func_name, addr)
+
+	add_cycles_to_function.prev_func_name = None
+	return None
+
+# Static variables for the previous function
+add_cycles_to_function.prev_func_name = None
+add_cycles_to_function.prev_entry     = None
+
+def trace_read():
+	global trace_process
+	line = trace.readline()
+	trace_process += len(line)
+	return line
+
+#
+# Parse arguments
+#
+trace_name = None
+symbols_file = None
+
+opts,args = getopt.getopt(sys.argv[1:], "ht:vs:v", ["help","trace=","symbols="])
+if (opts is None) or (not opts):
+	usage()
+	sys.exit()
+
+for o,a in opts:
+    if o in ("-h","--help"):
+        usage()
+        sys.exit()
+    elif o in ("-t","--trace"):
+        trace_name = a
+    elif o in ("-s","--symbols"):
+        symbols_file = a
+    else:
+        assert False, "Unhandled option (%s)" % o
+
+#
+# We try first to see if we run the script from DS-5
+#
+try:
+	from arm_ds.debugger_v1 import Debugger
+	from arm_ds.debugger_v1 import DebugException
+
+	# Debugger object for accessing the debugger
+	debugger = Debugger()
+
+	# Initialisation commands
+	ec = debugger.getExecutionContext(0)
+	ec.getExecutionService().stop()
+	ec.getExecutionService().waitForStop()
+	# in case the execution context reference is out of date
+	ec = debugger.getExecutionContext(0)
+
+	#
+	# Get the module name and their memory range
+	#
+	info_file = ec.executeDSCommand("info file")
+	info_file_str = StringIO(info_file)
+
+	line = info_file_str.readline().strip('\n')
+	while line != '':
+		if ("Symbols from" in line):
+			# Get the module name from the line 'Symbols from "/home/...."'
+			module_name = line.split("\"")[1].split("/")[-1]
+			modules[module_name] = {}
+
+			# Look for the text section
+			line = info_file_str.readline().strip('\n')
+			while (line != '') and ("Symbols from" not in line):
+				if ("ER_RO" in line):
+					modules[module_name]['start'] = get_address_from_string(line.split()[0])
+					modules[module_name]['end']   = get_address_from_string(line.split()[2])
+					line = info_file_str.readline().strip('\n')
+					break;
+				if (".text" in line):
+					modules[module_name]['start'] = get_address_from_string(line.split()[0])
+					modules[module_name]['end']   = get_address_from_string(line.split()[2])
+					line = info_file_str.readline().strip('\n')
+					break;
+				line = info_file_str.readline().strip('\n')
+		line = info_file_str.readline().strip('\n')
+
+	#
+	# Get the function name and their memory range
+	#
+	info_func = ec.executeDSCommand("info func")
+	info_func_str = StringIO(info_func)
+
+	# Skip the first line 'Low-level symbols ...'
+	line = info_func_str.readline().strip('\n')
+	func_prev = None
+	while line != '':
+		# We ignore all the functions after 'Functions in'
+		if ("Functions in " in line):
+			line = info_func_str.readline().strip('\n')
+			while line != '':
+				line = info_func_str.readline().strip('\n')
+			line = info_func_str.readline().strip('\n')
+			continue
+
+		if ("Low-level symbols" in line):
+			# We need to fixup the last function of the module
+			if func_prev is not None:
+				func_prev['end'] = modules[module_name]['end']
+				func_prev = None
+
+			line = info_func_str.readline().strip('\n')
+			continue
+
+		func_name = line.split()[1]
+		func_start = get_address_from_string(line.split()[0])
+		module_name = get_module_from_addr(modules, func_start)
+
+		if func_name not in functions.keys():
+			functions[func_name] = {}
+		functions[func_name][module_name] = {}
+		functions[func_name][module_name]['start'] = func_start
+		functions[func_name][module_name]['cycles'] = 0
+		functions[func_name][module_name]['count'] = 0
+
+		# Set the end address of the previous function
+		if func_prev is not None:
+			func_prev['end'] = func_start
+		func_prev = functions[func_name][module_name]
+
+		line = info_func_str.readline().strip('\n')
+
+	# Fixup the last function
+	func_prev['end'] = modules[module_name]['end']
+
+	if symbols_file is not None:
+		pickle.dump((modules, functions), open(symbols_file, "w"))
+except:
+	if symbols_file is None:
+		print "Error: Symbols file is required when run out of ARM DS-5"
+		sys.exit()
+
+	(modules, functions) = pickle.load(open(symbols_file, "r"))
+
+#
+# Build optimized table for the <Unknown> functions
+#
+functions_addr = {}
+for func_key, module in functions.iteritems():
+	for module_key, module_value in module.iteritems():
+		key = module_value['start'] & ~0x0FFF
+		if key not in functions_addr.keys():
+			functions_addr[key] = {}
+		if func_key not in functions_addr[key].keys():
+			functions_addr[key][func_key] = {}
+		functions_addr[key][func_key][module_key] = module_value
+
+#
+# Process the trace file
+#
+if trace_name is None:
+	sys.exit()
+
+trace = open(trace_name, "r")
+trace_size = os.path.getsize(trace_name)
+trace_process = 0
+
+# Get the column names from the first line
+columns = trace_read().split()
+column_addr     = columns.index('Address')
+column_cycles   = columns.index('Cycles')
+column_function = columns.index('Function')
+
+line = trace_read()
+i = 0
+prev_callee = None
+while line:
+	try:
+		func_name = line.split('\t')[column_function].strip()
+		address   = get_address_from_string(line.split('\t')[column_addr])
+		cycles    = int(line.split('\t')[column_cycles])
+		callee = add_cycles_to_function(functions, func_name, address, cycles)
+		if (prev_callee != None) and (prev_callee != callee):
+			functions[prev_callee[0]][prev_callee[1]]['count'] += 1
+		prev_callee = callee
+	except ValueError:
+		pass
+	line = trace_read()
+	if ((i % 1000000) == 0) and (i != 0):
+		percent = (trace_process * 100.00) / trace_size
+		print "Processing file ... (%.2f %%)" % (percent)
+	i = i + 1
+
+# Fixup the last callee
+functions[prev_callee[0]][prev_callee[1]]['count'] += 1
+
+#
+# Process results
+#
+functions_cycles     = {}
+all_functions_cycles = {}
+total_cycles         = 0
+
+for func_key, module in functions.iteritems():
+	for module_key, module_value in module.iteritems():
+		key = "%s/%s" % (module_key, func_key)
+		functions_cycles[key] = (module_value['cycles'], module_value['count'])
+		total_cycles += module_value['cycles']
+
+		if func_key not in all_functions_cycles.keys():
+			all_functions_cycles[func_key] = (module_value['cycles'], module_value['count'])
+		else:
+			all_functions_cycles[func_key] = tuple(map(sum, zip(all_functions_cycles[func_key], (module_value['cycles'], module_value['count']))))
+
+sorted_functions_cycles     = sorted(functions_cycles.iteritems(), key=operator.itemgetter(1), reverse = True)
+sorted_all_functions_cycles = sorted(all_functions_cycles.items(), key=operator.itemgetter(1), reverse = True)
+
+print
+print "----"
+for (key,value) in sorted_functions_cycles[:20]:
+	if value[0] != 0:
+		print "%s (cycles: %d - %d%%, count: %d)" % (key, value[0], (value[0] * 100) / total_cycles, value[1])
+	else:
+		break;
+print "----"
+for (key,value) in sorted_all_functions_cycles[:20]: 
+	if value[0] != 0:
+		print "%s (cycles: %d - %d%%, count: %d)" % (key, value[0], (value[0] * 100) / total_cycles, value[1])
+	else:
+		break;
-- 
2.21.0.windows.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Patch 0/4] Normalize line endings to CRLF in ARM packages
  2019-04-03 22:00 [Patch 0/4] Normalize line endings to CRLF in ARM packages Michael D Kinney
                   ` (3 preceding siblings ...)
  2019-04-03 22:00 ` [Patch 4/4] ArmPlatformPkg: " Michael D Kinney
@ 2019-04-04  3:54 ` Leif Lindholm
  2019-04-04 10:39   ` Laszlo Ersek
  4 siblings, 1 reply; 13+ messages in thread
From: Leif Lindholm @ 2019-04-04  3:54 UTC (permalink / raw)
  To: Kinney, Michael D; +Cc: devel, Ard Biesheuvel, Laszlo Ersek, Andrew Fish

Hi Mike,

This looks fine. But I did have one thought:
If we're just about to touch pretty much every file in the tree anyway
- can we consider doing the full conversion to native line endings at
the same time?

(This doesn't help the 'git blame' problem, it just reminded me.)

/
    Leif

On Wed, Apr 03, 2019 at 03:00:10PM -0700, Kinney, Michael D wrote:
> https://bugzilla.tianocore.org/show_bug.cgi?id=1659
> 
> Normalize line endings to use CRLF to pass PatchCheck.py
> 
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Kinney, Michael D (4):
>   ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment
>   ArmPkg: Normalize line endings to CRLF
>   ArmVirtPkg: Normalize line endings to CRLF
>   ArmPlatformPkg: Normalize line endings to CRLF
> 
>  .../ArmScmiPerformanceProtocolPrivate.h       |   2 +-
>  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |  44 +-
>  .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |  60 +-
>  .../AArch64/Reset.asm                         |  70 +-
>  .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |  58 +-
>  .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |  68 +-
>  ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 124 ++--
>  ArmPkg/Library/GccLto/liblto-aarch64.s        |  54 +-
>  ArmPkg/Library/GccLto/liblto-arm.s            | 122 ++--
>  ArmPlatformPkg/Scripts/Ds5/profile.py         | 668 +++++++++---------
>  ArmVirtPkg/Include/Platform/Hidden.h          |  56 +-
>  11 files changed, 663 insertions(+), 663 deletions(-)
> 
> -- 
> 2.21.0.windows.1
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Patch 0/4] Normalize line endings to CRLF in ARM packages
  2019-04-04  3:54 ` [Patch 0/4] Normalize line endings to CRLF in ARM packages Leif Lindholm
@ 2019-04-04 10:39   ` Laszlo Ersek
  2019-04-04 17:00     ` Michael D Kinney
  0 siblings, 1 reply; 13+ messages in thread
From: Laszlo Ersek @ 2019-04-04 10:39 UTC (permalink / raw)
  To: Leif Lindholm, Kinney, Michael D; +Cc: devel, Ard Biesheuvel, Andrew Fish

On 04/04/19 05:54, Leif Lindholm wrote:
> Hi Mike,
> 
> This looks fine. But I did have one thought:
> If we're just about to touch pretty much every file in the tree anyway
> - can we consider doing the full conversion to native line endings at
> the same time?
> 
> (This doesn't help the 'git blame' problem, it just reminded me.)

The git-blame issue that such a conversion introduces is not terrible.
Let's say you run

  git blame -- ArmPkg/Library/GccLto/liblto-arm.s

and it gives you a commit for a specific line you care about. Let's call
that commit C1.

Then you do

  git show --color C1 | less

and expect to see the commit message & patch that introduced the *logic*
on that line. But, you only see a "useless" CRLF conversion, in that
commit. So what do you do? Simple, repeat the process as follows:

  git blame C1^ -- ArmPkg/Library/GccLto/liblto-arm.s

This will assign blame on the lines of the file as the file was right
before C1 changed the line terminators.


The problem that I think *is* worse is that, jumping about in the git
history (with git checkout / git bisect), around the large conversion
commit, will expose the user in a brief time to files that are both LF
and CRLF encoded, internally. Therefore, whatever their local
auto-conversion-on-checkout settings are, some commits in such a work
session will not match those settings.

For example, assuming you are on Windows, and set up
LF-to-CRLF-on-checkout (as you should), then git-checkout a commit from
before the "LF only" conversion commit, you might see double CRs. I
guess. I never tested it.

Thanks
Laszlo



> 
> /
>     Leif
> 
> On Wed, Apr 03, 2019 at 03:00:10PM -0700, Kinney, Michael D wrote:
>> https://bugzilla.tianocore.org/show_bug.cgi?id=1659
>>
>> Normalize line endings to use CRLF to pass PatchCheck.py
>>
>> Cc: Leif Lindholm <leif.lindholm@linaro.org>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Laszlo Ersek <lersek@redhat.com>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
>>
>> Kinney, Michael D (4):
>>   ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment
>>   ArmPkg: Normalize line endings to CRLF
>>   ArmVirtPkg: Normalize line endings to CRLF
>>   ArmPlatformPkg: Normalize line endings to CRLF
>>
>>  .../ArmScmiPerformanceProtocolPrivate.h       |   2 +-
>>  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |  44 +-
>>  .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |  60 +-
>>  .../AArch64/Reset.asm                         |  70 +-
>>  .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |  58 +-
>>  .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |  68 +-
>>  ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 124 ++--
>>  ArmPkg/Library/GccLto/liblto-aarch64.s        |  54 +-
>>  ArmPkg/Library/GccLto/liblto-arm.s            | 122 ++--
>>  ArmPlatformPkg/Scripts/Ds5/profile.py         | 668 +++++++++---------
>>  ArmVirtPkg/Include/Platform/Hidden.h          |  56 +-
>>  11 files changed, 663 insertions(+), 663 deletions(-)
>>
>> -- 
>> 2.21.0.windows.1
>>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [Patch 3/4] ArmVirtPkg: Normalize line endings to CRLF
  2019-04-03 22:00 ` [Patch 3/4] ArmVirtPkg: " Michael D Kinney
@ 2019-04-04 12:52   ` Laszlo Ersek
  2019-04-04 16:55     ` Michael D Kinney
  0 siblings, 1 reply; 13+ messages in thread
From: Laszlo Ersek @ 2019-04-04 12:52 UTC (permalink / raw)
  To: devel, michael.d.kinney; +Cc: Ard Biesheuvel

On 04/04/19 00:00, Michael D Kinney wrote:
> https://bugzilla.tianocore.org/show_bug.cgi?id=1659
> 
> Normalize line endings to use CRLF to pass PatchCheck.py
> 
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  ArmVirtPkg/Include/Platform/Hidden.h | 56 ++++++++++++++--------------
>  1 file changed, 28 insertions(+), 28 deletions(-)
> 
> diff --git a/ArmVirtPkg/Include/Platform/Hidden.h b/ArmVirtPkg/Include/Platform/Hidden.h
> index fbd3467471..997866ff50 100644
> --- a/ArmVirtPkg/Include/Platform/Hidden.h
> +++ b/ArmVirtPkg/Include/Platform/Hidden.h
> @@ -1,28 +1,28 @@
> -/** @file
> -
> -  Copyright (c) 2018, Linaro Limited. 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
> -  http://opensource.org/licenses/bsd-license.php
> -
> -  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> -  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> -
> -**/
> -
> -#ifndef __PLATFORM_HIDDEN_H
> -#define __PLATFORM_HIDDEN_H
> -
> -//
> -// Setting the GCC -fvisibility=hidden command line option is not quite the same
> -// as setting the pragma below: the former only affects definitions, whereas the
> -// pragma affects extern declarations as well. So if we want to ensure that no
> -// GOT indirected symbol references are emitted, we need to use the pragma, or
> -// GOT based cross object references could be emitted, e.g., in libraries, and
> -// these cannot be relaxed to ordinary symbol references at link time.
> -//
> -#pragma GCC visibility push (hidden)
> -
> -#endif
> +/** @file
> +
> +  Copyright (c) 2018, Linaro Limited. 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
> +  http://opensource.org/licenses/bsd-license.php
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#ifndef __PLATFORM_HIDDEN_H
> +#define __PLATFORM_HIDDEN_H
> +
> +//
> +// Setting the GCC -fvisibility=hidden command line option is not quite the same
> +// as setting the pragma below: the former only affects definitions, whereas the
> +// pragma affects extern declarations as well. So if we want to ensure that no
> +// GOT indirected symbol references are emitted, we need to use the pragma, or
> +// GOT based cross object references could be emitted, e.g., in libraries, and
> +// these cannot be relaxed to ordinary symbol references at link time.
> +//
> +#pragma GCC visibility push (hidden)
> +
> +#endif
> 

This will conflict with the license conversion, so I suggest redoing
this patch after the conversion is pushed.

Other than that,

Acked-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [Patch 3/4] ArmVirtPkg: Normalize line endings to CRLF
  2019-04-04 12:52   ` [edk2-devel] " Laszlo Ersek
@ 2019-04-04 16:55     ` Michael D Kinney
  0 siblings, 0 replies; 13+ messages in thread
From: Michael D Kinney @ 2019-04-04 16:55 UTC (permalink / raw)
  To: devel@edk2.groups.io, lersek@redhat.com, Kinney, Michael D; +Cc: Ard Biesheuvel

Laszlo,

I am doing these before the license change to resolve
PatchCheck.py issues in the license change patch series.

I will rebase before commit.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]
> On Behalf Of Laszlo Ersek
> Sent: Thursday, April 4, 2019 5:53 AM
> To: devel@edk2.groups.io; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Subject: Re: [edk2-devel] [Patch 3/4] ArmVirtPkg:
> Normalize line endings to CRLF
> 
> On 04/04/19 00:00, Michael D Kinney wrote:
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1659
> >
> > Normalize line endings to use CRLF to pass
> PatchCheck.py
> >
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Contributed-under: TianoCore Contribution Agreement
> 1.1
> > Signed-off-by: Michael D Kinney
> <michael.d.kinney@intel.com>
> > ---
> >  ArmVirtPkg/Include/Platform/Hidden.h | 56
> ++++++++++++++--------------
> >  1 file changed, 28 insertions(+), 28 deletions(-)
> >
> > diff --git a/ArmVirtPkg/Include/Platform/Hidden.h
> b/ArmVirtPkg/Include/Platform/Hidden.h
> > index fbd3467471..997866ff50 100644
> > --- a/ArmVirtPkg/Include/Platform/Hidden.h
> > +++ b/ArmVirtPkg/Include/Platform/Hidden.h
> > @@ -1,28 +1,28 @@
> > -/** @file
> > -
> > -  Copyright (c) 2018, Linaro Limited. 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
> > -  http://opensource.org/licenses/bsd-license.php
> > -
> > -  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON
> AN "AS IS" BASIS,
> > -  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> EITHER EXPRESS OR IMPLIED.
> > -
> > -**/
> > -
> > -#ifndef __PLATFORM_HIDDEN_H
> > -#define __PLATFORM_HIDDEN_H
> > -
> > -//
> > -// Setting the GCC -fvisibility=hidden command line
> option is not quite the same
> > -// as setting the pragma below: the former only
> affects definitions, whereas the
> > -// pragma affects extern declarations as well. So if
> we want to ensure that no
> > -// GOT indirected symbol references are emitted, we
> need to use the pragma, or
> > -// GOT based cross object references could be
> emitted, e.g., in libraries, and
> > -// these cannot be relaxed to ordinary symbol
> references at link time.
> > -//
> > -#pragma GCC visibility push (hidden)
> > -
> > -#endif
> > +/** @file
> > +
> > +  Copyright (c) 2018, Linaro Limited. 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
> > +  http://opensource.org/licenses/bsd-license.php
> > +
> > +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON
> AN "AS IS" BASIS,
> > +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> EITHER EXPRESS OR IMPLIED.
> > +
> > +**/
> > +
> > +#ifndef __PLATFORM_HIDDEN_H
> > +#define __PLATFORM_HIDDEN_H
> > +
> > +//
> > +// Setting the GCC -fvisibility=hidden command line
> option is not quite the same
> > +// as setting the pragma below: the former only
> affects definitions, whereas the
> > +// pragma affects extern declarations as well. So if
> we want to ensure that no
> > +// GOT indirected symbol references are emitted, we
> need to use the pragma, or
> > +// GOT based cross object references could be
> emitted, e.g., in libraries, and
> > +// these cannot be relaxed to ordinary symbol
> references at link time.
> > +//
> > +#pragma GCC visibility push (hidden)
> > +
> > +#endif
> >
> 
> This will conflict with the license conversion, so I
> suggest redoing
> this patch after the conversion is pushed.
> 
> Other than that,
> 
> Acked-by: Laszlo Ersek <lersek@redhat.com>
> 
> Thanks
> Laszlo
> 
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Patch 0/4] Normalize line endings to CRLF in ARM packages
  2019-04-04 10:39   ` Laszlo Ersek
@ 2019-04-04 17:00     ` Michael D Kinney
  2019-04-04 17:17       ` [edk2-devel] " Kevin@Insyde
  2019-04-05  3:24       ` Leif Lindholm
  0 siblings, 2 replies; 13+ messages in thread
From: Michael D Kinney @ 2019-04-04 17:00 UTC (permalink / raw)
  To: Laszlo Ersek, Leif Lindholm, Kinney, Michael D
  Cc: devel@edk2.groups.io, Ard Biesheuvel, Andrew Fish

Leif,

There were a few files when the license change patches
were created that failed PatchCheck.py.

I am trying to resolve those before the license change
so the license change patches do not have any PatchCheck.py
failures.

If I do these as part of the license change, then the
change will look larger than just the license change in
these files.

I prefer to have a separate patch to resolve the line 
endings.

There may be other files in edk2 repo that have mixed
line endings in lines not associated with the license
change itself.  We can consider cleaning those up in
a separate series.

The other option is to abandon these patches to normalize
line endings and allow the license change patches to not
pass PatchCheck.py.

Which do you prefer?

Thanks,

Mike



> -----Original Message-----
> From: Laszlo Ersek [mailto:lersek@redhat.com]
> Sent: Thursday, April 4, 2019 3:39 AM
> To: Leif Lindholm <leif.lindholm@linaro.org>; Kinney,
> Michael D <michael.d.kinney@intel.com>
> Cc: devel@edk2.groups.io; Ard Biesheuvel
> <ard.biesheuvel@linaro.org>; Andrew Fish
> <afish@apple.com>
> Subject: Re: [Patch 0/4] Normalize line endings to CRLF
> in ARM packages
> 
> On 04/04/19 05:54, Leif Lindholm wrote:
> > Hi Mike,
> >
> > This looks fine. But I did have one thought:
> > If we're just about to touch pretty much every file in
> the tree anyway
> > - can we consider doing the full conversion to native
> line endings at
> > the same time?
> >
> > (This doesn't help the 'git blame' problem, it just
> reminded me.)
> 
> The git-blame issue that such a conversion introduces is
> not terrible.
> Let's say you run
> 
>   git blame -- ArmPkg/Library/GccLto/liblto-arm.s
> 
> and it gives you a commit for a specific line you care
> about. Let's call
> that commit C1.
> 
> Then you do
> 
>   git show --color C1 | less
> 
> and expect to see the commit message & patch that
> introduced the *logic*
> on that line. But, you only see a "useless" CRLF
> conversion, in that
> commit. So what do you do? Simple, repeat the process as
> follows:
> 
>   git blame C1^ -- ArmPkg/Library/GccLto/liblto-arm.s
> 
> This will assign blame on the lines of the file as the
> file was right
> before C1 changed the line terminators.
> 
> 
> The problem that I think *is* worse is that, jumping
> about in the git
> history (with git checkout / git bisect), around the
> large conversion
> commit, will expose the user in a brief time to files
> that are both LF
> and CRLF encoded, internally. Therefore, whatever their
> local
> auto-conversion-on-checkout settings are, some commits
> in such a work
> session will not match those settings.
> 
> For example, assuming you are on Windows, and set up
> LF-to-CRLF-on-checkout (as you should), then git-
> checkout a commit from
> before the "LF only" conversion commit, you might see
> double CRs. I
> guess. I never tested it.
> 
> Thanks
> Laszlo
> 
> 
> 
> >
> > /
> >     Leif
> >
> > On Wed, Apr 03, 2019 at 03:00:10PM -0700, Kinney,
> Michael D wrote:
> >> https://bugzilla.tianocore.org/show_bug.cgi?id=1659
> >>
> >> Normalize line endings to use CRLF to pass
> PatchCheck.py
> >>
> >> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> >> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >> Cc: Laszlo Ersek <lersek@redhat.com>
> >> Contributed-under: TianoCore Contribution Agreement
> 1.1
> >> Signed-off-by: Michael D Kinney
> <michael.d.kinney@intel.com>
> >>
> >> Kinney, Michael D (4):
> >>   ArmPkg/ArmScmiDxe: Remove non-ASCII character in
> comment
> >>   ArmPkg: Normalize line endings to CRLF
> >>   ArmVirtPkg: Normalize line endings to CRLF
> >>   ArmPlatformPkg: Normalize line endings to CRLF
> >>
> >>  .../ArmScmiPerformanceProtocolPrivate.h       |   2
> +-
> >>  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |  44
> +-
> >>  .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |  60
> +-
> >>  .../AArch64/Reset.asm                         |  70
> +-
> >>  .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |  58
> +-
> >>  .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |  68
> +-
> >>  ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 124
> ++--
> >>  ArmPkg/Library/GccLto/liblto-aarch64.s        |  54
> +-
> >>  ArmPkg/Library/GccLto/liblto-arm.s            | 122
> ++--
> >>  ArmPlatformPkg/Scripts/Ds5/profile.py         | 668
> +++++++++---------
> >>  ArmVirtPkg/Include/Platform/Hidden.h          |  56
> +-
> >>  11 files changed, 663 insertions(+), 663 deletions(-
> )
> >>
> >> --
> >> 2.21.0.windows.1
> >>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [Patch 0/4] Normalize line endings to CRLF in ARM packages
  2019-04-04 17:00     ` Michael D Kinney
@ 2019-04-04 17:17       ` Kevin@Insyde
  2019-04-05  3:24       ` Leif Lindholm
  1 sibling, 0 replies; 13+ messages in thread
From: Kevin@Insyde @ 2019-04-04 17:17 UTC (permalink / raw)
  To: devel, michael.d.kinney
  Cc: Laszlo Ersek, Leif Lindholm, Ard Biesheuvel, Andrew Fish

[-- Attachment #1: Type: text/plain, Size: 4963 bytes --]

We would prefer separate patches.

Kevin D Davis
Insyde Software

> On Apr 4, 2019, at 1:00 PM, Michael D Kinney <michael.d.kinney@intel.com> wrote:
> 
> Leif,
> 
> There were a few files when the license change patches
> were created that failed PatchCheck.py.
> 
> I am trying to resolve those before the license change
> so the license change patches do not have any PatchCheck.py
> failures.
> 
> If I do these as part of the license change, then the
> change will look larger than just the license change in
> these files.
> 
> I prefer to have a separate patch to resolve the line 
> endings.
> 
> There may be other files in edk2 repo that have mixed
> line endings in lines not associated with the license
> change itself.  We can consider cleaning those up in
> a separate series.
> 
> The other option is to abandon these patches to normalize
> line endings and allow the license change patches to not
> pass PatchCheck.py.
> 
> Which do you prefer?
> 
> Thanks,
> 
> Mike
> 
> 
> 
>> -----Original Message-----
>> From: Laszlo Ersek [mailto:lersek@redhat.com]
>> Sent: Thursday, April 4, 2019 3:39 AM
>> To: Leif Lindholm <leif.lindholm@linaro.org>; Kinney,
>> Michael D <michael.d.kinney@intel.com>
>> Cc: devel@edk2.groups.io; Ard Biesheuvel
>> <ard.biesheuvel@linaro.org>; Andrew Fish
>> <afish@apple.com>
>> Subject: Re: [Patch 0/4] Normalize line endings to CRLF
>> in ARM packages
>> 
>>> On 04/04/19 05:54, Leif Lindholm wrote:
>>> Hi Mike,
>>> 
>>> This looks fine. But I did have one thought:
>>> If we're just about to touch pretty much every file in
>> the tree anyway
>>> - can we consider doing the full conversion to native
>> line endings at
>>> the same time?
>>> 
>>> (This doesn't help the 'git blame' problem, it just
>> reminded me.)
>> 
>> The git-blame issue that such a conversion introduces is
>> not terrible.
>> Let's say you run
>> 
>>  git blame -- ArmPkg/Library/GccLto/liblto-arm.s
>> 
>> and it gives you a commit for a specific line you care
>> about. Let's call
>> that commit C1.
>> 
>> Then you do
>> 
>>  git show --color C1 | less
>> 
>> and expect to see the commit message & patch that
>> introduced the *logic*
>> on that line. But, you only see a "useless" CRLF
>> conversion, in that
>> commit. So what do you do? Simple, repeat the process as
>> follows:
>> 
>>  git blame C1^ -- ArmPkg/Library/GccLto/liblto-arm.s
>> 
>> This will assign blame on the lines of the file as the
>> file was right
>> before C1 changed the line terminators.
>> 
>> 
>> The problem that I think *is* worse is that, jumping
>> about in the git
>> history (with git checkout / git bisect), around the
>> large conversion
>> commit, will expose the user in a brief time to files
>> that are both LF
>> and CRLF encoded, internally. Therefore, whatever their
>> local
>> auto-conversion-on-checkout settings are, some commits
>> in such a work
>> session will not match those settings.
>> 
>> For example, assuming you are on Windows, and set up
>> LF-to-CRLF-on-checkout (as you should), then git-
>> checkout a commit from
>> before the "LF only" conversion commit, you might see
>> double CRs. I
>> guess. I never tested it.
>> 
>> Thanks
>> Laszlo
>> 
>> 
>> 
>>> 
>>> /
>>>    Leif
>>> 
>>> On Wed, Apr 03, 2019 at 03:00:10PM -0700, Kinney,
>> Michael D wrote:
>>>> https://bugzilla.tianocore.org/show_bug.cgi?id=1659
>>>> 
>>>> Normalize line endings to use CRLF to pass
>> PatchCheck.py
>>>> 
>>>> Cc: Leif Lindholm <leif.lindholm@linaro.org>
>>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>> Cc: Laszlo Ersek <lersek@redhat.com>
>>>> Contributed-under: TianoCore Contribution Agreement
>> 1.1
>>>> Signed-off-by: Michael D Kinney
>> <michael.d.kinney@intel.com>
>>>> 
>>>> Kinney, Michael D (4):
>>>>  ArmPkg/ArmScmiDxe: Remove non-ASCII character in
>> comment
>>>>  ArmPkg: Normalize line endings to CRLF
>>>>  ArmVirtPkg: Normalize line endings to CRLF
>>>>  ArmPlatformPkg: Normalize line endings to CRLF
>>>> 
>>>> .../ArmScmiPerformanceProtocolPrivate.h       |   2
>> +-
>>>> ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |  44
>> +-
>>>> .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |  60
>> +-
>>>> .../AArch64/Reset.asm                         |  70
>> +-
>>>> .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |  58
>> +-
>>>> .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |  68
>> +-
>>>> ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 124
>> ++--
>>>> ArmPkg/Library/GccLto/liblto-aarch64.s        |  54
>> +-
>>>> ArmPkg/Library/GccLto/liblto-arm.s            | 122
>> ++--
>>>> ArmPlatformPkg/Scripts/Ds5/profile.py         | 668
>> +++++++++---------
>>>> ArmVirtPkg/Include/Platform/Hidden.h          |  56
>> +-
>>>> 11 files changed, 663 insertions(+), 663 deletions(-
>> )
>>>> 
>>>> --
>>>> 2.21.0.windows.1
>>>> 
> 
> 
> 
> 

[-- Attachment #2: Type: text/html, Size: 16591 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Patch 0/4] Normalize line endings to CRLF in ARM packages
  2019-04-04 17:00     ` Michael D Kinney
  2019-04-04 17:17       ` [edk2-devel] " Kevin@Insyde
@ 2019-04-05  3:24       ` Leif Lindholm
  2019-04-05 18:11         ` Michael D Kinney
  1 sibling, 1 reply; 13+ messages in thread
From: Leif Lindholm @ 2019-04-05  3:24 UTC (permalink / raw)
  To: Kinney, Michael D
  Cc: Laszlo Ersek, devel@edk2.groups.io, Ard Biesheuvel, Andrew Fish

On Thu, Apr 04, 2019 at 05:00:36PM +0000, Kinney, Michael D wrote:
> Leif,
> 
> There were a few files when the license change patches
> were created that failed PatchCheck.py.
> 
> I am trying to resolve those before the license change
> so the license change patches do not have any PatchCheck.py
> failures.
> 
> If I do these as part of the license change, then the
> change will look larger than just the license change in
> these files.
> 
> I prefer to have a separate patch to resolve the line 
> endings.

Oh, it needs to be separate patches. Apologies if I was unclear on
that. It should not even form part of the same set.

What I meant was that since a substantial bit of churn is about to hit
the repository, we might as well go about doing the line ending
conversion shortly before or shortly after the license change.

If we do it shortly before, we don't need *this* set. If we do it
shortly after, we do.

> There may be other files in edk2 repo that have mixed
> line endings in lines not associated with the license
> change itself.  We can consider cleaning those up in
> a separate series.
> 
> The other option is to abandon these patches to normalize
> line endings and allow the license change patches to not
> pass PatchCheck.py.
> 
> Which do you prefer?

I think it would be completely valid for the license change patches
to not pass PatchCheck.py.

But why are they not passing? Is it complaining about context lines?

Regards,

Leif

> Thanks,
> 
> Mike
> 
> 
> 
> > -----Original Message-----
> > From: Laszlo Ersek [mailto:lersek@redhat.com]
> > Sent: Thursday, April 4, 2019 3:39 AM
> > To: Leif Lindholm <leif.lindholm@linaro.org>; Kinney,
> > Michael D <michael.d.kinney@intel.com>
> > Cc: devel@edk2.groups.io; Ard Biesheuvel
> > <ard.biesheuvel@linaro.org>; Andrew Fish
> > <afish@apple.com>
> > Subject: Re: [Patch 0/4] Normalize line endings to CRLF
> > in ARM packages
> > 
> > On 04/04/19 05:54, Leif Lindholm wrote:
> > > Hi Mike,
> > >
> > > This looks fine. But I did have one thought:
> > > If we're just about to touch pretty much every file in
> > the tree anyway
> > > - can we consider doing the full conversion to native
> > line endings at
> > > the same time?
> > >
> > > (This doesn't help the 'git blame' problem, it just
> > reminded me.)
> > 
> > The git-blame issue that such a conversion introduces is
> > not terrible.
> > Let's say you run
> > 
> >   git blame -- ArmPkg/Library/GccLto/liblto-arm.s
> > 
> > and it gives you a commit for a specific line you care
> > about. Let's call
> > that commit C1.
> > 
> > Then you do
> > 
> >   git show --color C1 | less
> > 
> > and expect to see the commit message & patch that
> > introduced the *logic*
> > on that line. But, you only see a "useless" CRLF
> > conversion, in that
> > commit. So what do you do? Simple, repeat the process as
> > follows:
> > 
> >   git blame C1^ -- ArmPkg/Library/GccLto/liblto-arm.s
> > 
> > This will assign blame on the lines of the file as the
> > file was right
> > before C1 changed the line terminators.
> > 
> > 
> > The problem that I think *is* worse is that, jumping
> > about in the git
> > history (with git checkout / git bisect), around the
> > large conversion
> > commit, will expose the user in a brief time to files
> > that are both LF
> > and CRLF encoded, internally. Therefore, whatever their
> > local
> > auto-conversion-on-checkout settings are, some commits
> > in such a work
> > session will not match those settings.
> > 
> > For example, assuming you are on Windows, and set up
> > LF-to-CRLF-on-checkout (as you should), then git-
> > checkout a commit from
> > before the "LF only" conversion commit, you might see
> > double CRs. I
> > guess. I never tested it.
> > 
> > Thanks
> > Laszlo
> > 
> > 
> > 
> > >
> > > /
> > >     Leif
> > >
> > > On Wed, Apr 03, 2019 at 03:00:10PM -0700, Kinney,
> > Michael D wrote:
> > >> https://bugzilla.tianocore.org/show_bug.cgi?id=1659
> > >>
> > >> Normalize line endings to use CRLF to pass
> > PatchCheck.py
> > >>
> > >> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > >> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > >> Cc: Laszlo Ersek <lersek@redhat.com>
> > >> Contributed-under: TianoCore Contribution Agreement
> > 1.1
> > >> Signed-off-by: Michael D Kinney
> > <michael.d.kinney@intel.com>
> > >>
> > >> Kinney, Michael D (4):
> > >>   ArmPkg/ArmScmiDxe: Remove non-ASCII character in
> > comment
> > >>   ArmPkg: Normalize line endings to CRLF
> > >>   ArmVirtPkg: Normalize line endings to CRLF
> > >>   ArmPlatformPkg: Normalize line endings to CRLF
> > >>
> > >>  .../ArmScmiPerformanceProtocolPrivate.h       |   2
> > +-
> > >>  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |  44
> > +-
> > >>  .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |  60
> > +-
> > >>  .../AArch64/Reset.asm                         |  70
> > +-
> > >>  .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |  58
> > +-
> > >>  .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |  68
> > +-
> > >>  ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 124
> > ++--
> > >>  ArmPkg/Library/GccLto/liblto-aarch64.s        |  54
> > +-
> > >>  ArmPkg/Library/GccLto/liblto-arm.s            | 122
> > ++--
> > >>  ArmPlatformPkg/Scripts/Ds5/profile.py         | 668
> > +++++++++---------
> > >>  ArmVirtPkg/Include/Platform/Hidden.h          |  56
> > +-
> > >>  11 files changed, 663 insertions(+), 663 deletions(-
> > )
> > >>
> > >> --
> > >> 2.21.0.windows.1
> > >>
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Patch 0/4] Normalize line endings to CRLF in ARM packages
  2019-04-05  3:24       ` Leif Lindholm
@ 2019-04-05 18:11         ` Michael D Kinney
  0 siblings, 0 replies; 13+ messages in thread
From: Michael D Kinney @ 2019-04-05 18:11 UTC (permalink / raw)
  To: Leif Lindholm, Kinney, Michael D
  Cc: Laszlo Ersek, devel@edk2.groups.io, Ard Biesheuvel, Andrew Fish

Leif,

PatchCheck.py is complaining because lines in the file
header that contain the license text for some files are
using the wrong line endings.  The script I wrote preserves
the line ending style from the old license text when
adding the SPDX identifier so the script would not have
to figure out what line ending style is required.

Details are in the BZs I entered.

https://bugzilla.tianocore.org/show_bug.cgi?id=1659
https://bugzilla.tianocore.org/show_bug.cgi?id=1658
https://bugzilla.tianocore.org/show_bug.cgi?id=1657

Best regards,

Mike

> -----Original Message-----
> From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
> Sent: Thursday, April 4, 2019 8:25 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>;
> devel@edk2.groups.io; Ard Biesheuvel
> <ard.biesheuvel@linaro.org>; Andrew Fish
> <afish@apple.com>
> Subject: Re: [Patch 0/4] Normalize line endings to CRLF
> in ARM packages
> 
> On Thu, Apr 04, 2019 at 05:00:36PM +0000, Kinney,
> Michael D wrote:
> > Leif,
> >
> > There were a few files when the license change
> patches
> > were created that failed PatchCheck.py.
> >
> > I am trying to resolve those before the license
> change
> > so the license change patches do not have any
> PatchCheck.py
> > failures.
> >
> > If I do these as part of the license change, then the
> > change will look larger than just the license change
> in
> > these files.
> >
> > I prefer to have a separate patch to resolve the line
> > endings.
> 
> Oh, it needs to be separate patches. Apologies if I was
> unclear on
> that. It should not even form part of the same set.
> 
> What I meant was that since a substantial bit of churn
> is about to hit
> the repository, we might as well go about doing the
> line ending
> conversion shortly before or shortly after the license
> change.
> 
> If we do it shortly before, we don't need *this* set.
> If we do it
> shortly after, we do.
> 
> > There may be other files in edk2 repo that have mixed
> > line endings in lines not associated with the license
> > change itself.  We can consider cleaning those up in
> > a separate series.
> >
> > The other option is to abandon these patches to
> normalize
> > line endings and allow the license change patches to
> not
> > pass PatchCheck.py.
> >
> > Which do you prefer?
> 
> I think it would be completely valid for the license
> change patches
> to not pass PatchCheck.py.
> 
> But why are they not passing? Is it complaining about
> context lines?
> 
> Regards,
> 
> Leif
> 
> > Thanks,
> >
> > Mike
> >
> >
> >
> > > -----Original Message-----
> > > From: Laszlo Ersek [mailto:lersek@redhat.com]
> > > Sent: Thursday, April 4, 2019 3:39 AM
> > > To: Leif Lindholm <leif.lindholm@linaro.org>;
> Kinney,
> > > Michael D <michael.d.kinney@intel.com>
> > > Cc: devel@edk2.groups.io; Ard Biesheuvel
> > > <ard.biesheuvel@linaro.org>; Andrew Fish
> > > <afish@apple.com>
> > > Subject: Re: [Patch 0/4] Normalize line endings to
> CRLF
> > > in ARM packages
> > >
> > > On 04/04/19 05:54, Leif Lindholm wrote:
> > > > Hi Mike,
> > > >
> > > > This looks fine. But I did have one thought:
> > > > If we're just about to touch pretty much every
> file in
> > > the tree anyway
> > > > - can we consider doing the full conversion to
> native
> > > line endings at
> > > > the same time?
> > > >
> > > > (This doesn't help the 'git blame' problem, it
> just
> > > reminded me.)
> > >
> > > The git-blame issue that such a conversion
> introduces is
> > > not terrible.
> > > Let's say you run
> > >
> > >   git blame -- ArmPkg/Library/GccLto/liblto-arm.s
> > >
> > > and it gives you a commit for a specific line you
> care
> > > about. Let's call
> > > that commit C1.
> > >
> > > Then you do
> > >
> > >   git show --color C1 | less
> > >
> > > and expect to see the commit message & patch that
> > > introduced the *logic*
> > > on that line. But, you only see a "useless" CRLF
> > > conversion, in that
> > > commit. So what do you do? Simple, repeat the
> process as
> > > follows:
> > >
> > >   git blame C1^ -- ArmPkg/Library/GccLto/liblto-
> arm.s
> > >
> > > This will assign blame on the lines of the file as
> the
> > > file was right
> > > before C1 changed the line terminators.
> > >
> > >
> > > The problem that I think *is* worse is that,
> jumping
> > > about in the git
> > > history (with git checkout / git bisect), around
> the
> > > large conversion
> > > commit, will expose the user in a brief time to
> files
> > > that are both LF
> > > and CRLF encoded, internally. Therefore, whatever
> their
> > > local
> > > auto-conversion-on-checkout settings are, some
> commits
> > > in such a work
> > > session will not match those settings.
> > >
> > > For example, assuming you are on Windows, and set
> up
> > > LF-to-CRLF-on-checkout (as you should), then git-
> > > checkout a commit from
> > > before the "LF only" conversion commit, you might
> see
> > > double CRs. I
> > > guess. I never tested it.
> > >
> > > Thanks
> > > Laszlo
> > >
> > >
> > >
> > > >
> > > > /
> > > >     Leif
> > > >
> > > > On Wed, Apr 03, 2019 at 03:00:10PM -0700, Kinney,
> > > Michael D wrote:
> > > >>
> https://bugzilla.tianocore.org/show_bug.cgi?id=1659
> > > >>
> > > >> Normalize line endings to use CRLF to pass
> > > PatchCheck.py
> > > >>
> > > >> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> > > >> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > > >> Cc: Laszlo Ersek <lersek@redhat.com>
> > > >> Contributed-under: TianoCore Contribution
> Agreement
> > > 1.1
> > > >> Signed-off-by: Michael D Kinney
> > > <michael.d.kinney@intel.com>
> > > >>
> > > >> Kinney, Michael D (4):
> > > >>   ArmPkg/ArmScmiDxe: Remove non-ASCII character
> in
> > > comment
> > > >>   ArmPkg: Normalize line endings to CRLF
> > > >>   ArmVirtPkg: Normalize line endings to CRLF
> > > >>   ArmPlatformPkg: Normalize line endings to CRLF
> > > >>
> > > >>  .../ArmScmiPerformanceProtocolPrivate.h       |
> 2
> > > +-
> > > >>  ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.c  |
> 44
> > > +-
> > > >>  .../ArmSmcPsciResetSystemLib/AArch64/Reset.S  |
> 60
> > > +-
> > > >>  .../AArch64/Reset.asm                         |
> 70
> > > +-
> > > >>  .../ArmSmcPsciResetSystemLib/Arm/Reset.S      |
> 58
> > > +-
> > > >>  .../ArmSmcPsciResetSystemLib/Arm/Reset.asm    |
> 68
> > > +-
> > > >>  ArmPkg/Library/CompilerIntrinsicsLib/memset.c |
> 124
> > > ++--
> > > >>  ArmPkg/Library/GccLto/liblto-aarch64.s        |
> 54
> > > +-
> > > >>  ArmPkg/Library/GccLto/liblto-arm.s            |
> 122
> > > ++--
> > > >>  ArmPlatformPkg/Scripts/Ds5/profile.py         |
> 668
> > > +++++++++---------
> > > >>  ArmVirtPkg/Include/Platform/Hidden.h          |
> 56
> > > +-
> > > >>  11 files changed, 663 insertions(+), 663
> deletions(-
> > > )
> > > >>
> > > >> --
> > > >> 2.21.0.windows.1
> > > >>
> >

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-04-05 18:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-03 22:00 [Patch 0/4] Normalize line endings to CRLF in ARM packages Michael D Kinney
2019-04-03 22:00 ` [Patch 1/4] ArmPkg/ArmScmiDxe: Remove non-ASCII character in comment Michael D Kinney
2019-04-03 22:00 ` [Patch 2/4] ArmPkg: Normalize line endings to CRLF Michael D Kinney
2019-04-03 22:00 ` [Patch 3/4] ArmVirtPkg: " Michael D Kinney
2019-04-04 12:52   ` [edk2-devel] " Laszlo Ersek
2019-04-04 16:55     ` Michael D Kinney
2019-04-03 22:00 ` [Patch 4/4] ArmPlatformPkg: " Michael D Kinney
2019-04-04  3:54 ` [Patch 0/4] Normalize line endings to CRLF in ARM packages Leif Lindholm
2019-04-04 10:39   ` Laszlo Ersek
2019-04-04 17:00     ` Michael D Kinney
2019-04-04 17:17       ` [edk2-devel] " Kevin@Insyde
2019-04-05  3:24       ` Leif Lindholm
2019-04-05 18:11         ` Michael D Kinney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox