Re: [PATCH v2 5/5] common: Convert *.c/h from UTF-8 to ASCII enconfing

2024-04-17 Thread Michal Simek




On 4/16/24 18:19, Heinrich Schuchardt wrote:

On 16.04.24 18:06, Tom Rini wrote:

On Tue, Apr 16, 2024 at 08:55:19AM +0200, Michal Simek wrote:


Convert UTF-8 chars to ASCII in cases where make sense. No Copyright or
names are converted.

Signed-off-by: Michal Simek 



Reviewed-by: Tom Rini 

Now, how did you test / find these? Given names a CI test is unlikely
to be doable but if it's otherwise scriptable I can put it in my loops
and just fixup as needed (like I do today for adding  for
example).



There seem no to be too many non-ASCI strings outside of comments.
Should we care about non-ASCII comments?

$ find . -name '*.h' -exec grep -P -Hn "[^\x00-\x7F]" {} \; | grep -v
':\s*[\/\*']
./include/configs/tec-ng.h:13:#define CFG_TEGRA_BOARD_STRING    "Avionic
Design Tamonten™ NG Evaluation Carrier"
./arch/mips/mach-octeon/include/mach/cvmx-pko3.h:369:   MEMALG_SUB = 9,
  /* mem = mem – PKO_SEND_MEM_S[OFFSET] */

$ find . -name '*.c' -exec grep -P -Hn "[^\x00-\x7F]" {} \; | grep -v
':\s*[\/\*']
./drivers/mtd/nand/raw/nand_ids.c:65:   {"H27QCG8T2E5R‐BCF 64G 3.3V 8-bit",
./drivers/video/dw_mipi_dsi.c:861:MODULE_AUTHOR("Yannick Fertré
");
./board/bosch/acc/acc.c:440:    .SRT = 0, // Set to 1 for temperatures
above 85°C
./cmd/2048.c:65:    printf("   ·   ");
./cmd/2048.c:79:    printf("    ←, ↑, →, ↓ or q    \n");


I actually use more force way and simply run uni2ascii -B < file to all files 
and then look at git diff and pick what it is valid.

Above find is not able to find all that strings.

For example this one could be also fixed which above filter it not able to find.

--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright © International Business Machines Corp., 2006
+ * Copyright (c) International Business Machines Corp., 2006

M



Re: [PATCH v2 5/5] common: Convert *.c/h from UTF-8 to ASCII enconfing

2024-04-16 Thread Tom Rini
On Tue, Apr 16, 2024 at 06:19:48PM +0200, Heinrich Schuchardt wrote:
> On 16.04.24 18:06, Tom Rini wrote:
> > On Tue, Apr 16, 2024 at 08:55:19AM +0200, Michal Simek wrote:
> > 
> > > Convert UTF-8 chars to ASCII in cases where make sense. No Copyright or
> > > names are converted.
> > > 
> > > Signed-off-by: Michal Simek 
> > > 
> > 
> > Reviewed-by: Tom Rini 
> > 
> > Now, how did you test / find these? Given names a CI test is unlikely
> > to be doable but if it's otherwise scriptable I can put it in my loops
> > and just fixup as needed (like I do today for adding  for
> > example).
> > 
> 
> There seem no to be too many non-ASCI strings outside of comments.
> Should we care about non-ASCII comments?
> 
> $ find . -name '*.h' -exec grep -P -Hn "[^\x00-\x7F]" {} \; | grep -v
> ':\s*[\/\*']
> ./include/configs/tec-ng.h:13:#define CFG_TEGRA_BOARD_STRING"Avionic
> Design Tamonten™ NG Evaluation Carrier"
> ./arch/mips/mach-octeon/include/mach/cvmx-pko3.h:369:   MEMALG_SUB = 9,
>  /* mem = mem – PKO_SEND_MEM_S[OFFSET] */
> 
> $ find . -name '*.c' -exec grep -P -Hn "[^\x00-\x7F]" {} \; | grep -v
> ':\s*[\/\*']
> ./drivers/mtd/nand/raw/nand_ids.c:65:   {"H27QCG8T2E5R‐BCF 64G 3.3V 8-bit",
> ./drivers/video/dw_mipi_dsi.c:861:MODULE_AUTHOR("Yannick Fertré
> ");
> ./board/bosch/acc/acc.c:440:.SRT = 0, // Set to 1 for temperatures
> above 85°C
> ./cmd/2048.c:65:printf("   ·   ");
> ./cmd/2048.c:79:printf("←, ↑, →, ↓ or q\n");

I think we need to keep the "2048" game ones as it's part of the reason
(can we display certain things properly) it exists but comments and
general strings should be fixed. And I think I can use the above
examples to put something in to my scripts to catch new additions.
Thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 5/5] common: Convert *.c/h from UTF-8 to ASCII enconfing

2024-04-16 Thread Heinrich Schuchardt

On 16.04.24 18:06, Tom Rini wrote:

On Tue, Apr 16, 2024 at 08:55:19AM +0200, Michal Simek wrote:


Convert UTF-8 chars to ASCII in cases where make sense. No Copyright or
names are converted.

Signed-off-by: Michal Simek 



Reviewed-by: Tom Rini 

Now, how did you test / find these? Given names a CI test is unlikely
to be doable but if it's otherwise scriptable I can put it in my loops
and just fixup as needed (like I do today for adding  for
example).



There seem no to be too many non-ASCI strings outside of comments.
Should we care about non-ASCII comments?

$ find . -name '*.h' -exec grep -P -Hn "[^\x00-\x7F]" {} \; | grep -v
':\s*[\/\*']
./include/configs/tec-ng.h:13:#define CFG_TEGRA_BOARD_STRING"Avionic
Design Tamonten™ NG Evaluation Carrier"
./arch/mips/mach-octeon/include/mach/cvmx-pko3.h:369:   MEMALG_SUB = 9,
 /* mem = mem – PKO_SEND_MEM_S[OFFSET] */

$ find . -name '*.c' -exec grep -P -Hn "[^\x00-\x7F]" {} \; | grep -v
':\s*[\/\*']
./drivers/mtd/nand/raw/nand_ids.c:65:   {"H27QCG8T2E5R‐BCF 64G 3.3V 8-bit",
./drivers/video/dw_mipi_dsi.c:861:MODULE_AUTHOR("Yannick Fertré
");
./board/bosch/acc/acc.c:440:.SRT = 0, // Set to 1 for temperatures
above 85°C
./cmd/2048.c:65:printf("   ·   ");
./cmd/2048.c:79:printf("←, ↑, →, ↓ or q\n");

Best regards

Heinrich


Re: [PATCH v2 5/5] common: Convert *.c/h from UTF-8 to ASCII enconfing

2024-04-16 Thread Tom Rini
On Tue, Apr 16, 2024 at 08:55:19AM +0200, Michal Simek wrote:

> Convert UTF-8 chars to ASCII in cases where make sense. No Copyright or
> names are converted.
> 
> Signed-off-by: Michal Simek 
> 

Reviewed-by: Tom Rini 

Now, how did you test / find these? Given names a CI test is unlikely
to be doable but if it's otherwise scriptable I can put it in my loops
and just fixup as needed (like I do today for adding  for
example).

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 5/5] common: Convert *.c/h from UTF-8 to ASCII enconfing

2024-04-16 Thread Marek Behún
Acked-by: Marek Behún 


[PATCH v2 5/5] common: Convert *.c/h from UTF-8 to ASCII enconfing

2024-04-16 Thread Michal Simek
Convert UTF-8 chars to ASCII in cases where make sense. No Copyright or
names are converted.

Signed-off-by: Michal Simek 

---

Changes in v2:
- New patch in series

 .../armv8/fsl-layerscape/fsl_lsch2_serdes.c   |  2 +-
 .../armv8/fsl-layerscape/fsl_lsch3_serdes.c   |  2 +-
 arch/arm/mach-imx/ddrmc-vf610-calibration.c   | 12 +-
 arch/arm/mach-imx/mx6/clock.c |  8 +++
 arch/arm/mach-imx/mx7/psci-mx7.c  |  4 ++--
 arch/mips/mach-mscc/include/mach/ddr.h|  2 +-
 .../include/mach/cvmx-helper-pki.h|  2 +-
 arch/mips/mach-octeon/include/mach/cvmx-pki.h |  6 ++---
 .../mips/mach-octeon/include/mach/cvmx-pko3.h |  2 +-
 board/CZ.NIC/turris_mox/turris_mox.c  |  2 +-
 board/amlogic/vim3/vim3.c |  2 +-
 board/bosch/acc/acc.c |  2 +-
 board/bosch/shc/board.c   |  2 +-
 board/bosch/shc/board.h   |  2 +-
 board/congatec/cgtqmx8/cgtqmx8.c  |  4 ++--
 board/freescale/common/i2c_mux.c  |  2 +-
 board/siemens/capricorn/board.c   |  8 +++
 board/st/common/cmd_stboard.c |  2 +-
 .../visionfive2/visionfive2-i2c-eeprom.c  |  4 ++--
 drivers/clk/renesas/rzg2l-cpg.c   |  6 ++---
 drivers/clk/stm32/clk-stm32-core.h| 22 +--
 drivers/led/led_lp5562.c  |  4 ++--
 drivers/mtd/nand/raw/nand_ids.c   |  2 +-
 drivers/rng/stm32_rng.c   |  6 ++---
 drivers/soc/ti/k3-navss-ringacc.c |  2 +-
 drivers/thermal/thermal_sandbox.c |  2 +-
 drivers/video/renesas-r61307.c|  2 +-
 drivers/video/renesas-r69328.c|  2 +-
 drivers/xen/pvblock.c |  2 +-
 include/acpi/acpigen.h|  6 ++---
 include/linux/mtd/mtd.h   |  2 +-
 lib/crypto/x509_cert_parser.c |  2 +-
 32 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c
index 1541dfb3ec47..b1bb29bcaf55 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c
@@ -258,7 +258,7 @@ int setup_serdes_volt(u32 svdd)
/* Wait for SVDD to stabilize */
udelay(100);
 
-   /* For each PLL that’s not disabled via RCW */
+   /* For each PLL that's not disabled via RCW */
 #ifdef CONFIG_SYS_FSL_SRDS_1
cfg_tmp = (cfg_rcw5 >> 22) & 0x3;
for (i = 0; i < 2 && !(cfg_tmp & (0x1 << (1 - i))); i++) {
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c
index c0efc341afc1..fbd5fd7d433b 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_serdes.c
@@ -483,7 +483,7 @@ int setup_serdes_volt(u32 svdd)
ret = -1;
}
 
-   /* For each PLL that’s not disabled via RCW enable the SERDES */
+   /* For each PLL that's not disabled via RCW enable the SERDES */
 #ifdef CONFIG_SYS_FSL_SRDS_1
cfg_tmp = cfg_rcwsrds1 & 0x3;
do_serdes_enable(cfg_tmp, serdes1_base);
diff --git a/arch/arm/mach-imx/ddrmc-vf610-calibration.c 
b/arch/arm/mach-imx/ddrmc-vf610-calibration.c
index cd7e95e61d00..7d787d045980 100644
--- a/arch/arm/mach-imx/ddrmc-vf610-calibration.c
+++ b/arch/arm/mach-imx/ddrmc-vf610-calibration.c
@@ -45,7 +45,7 @@
  * based on trace length differences from their
  * layout.
  * Mismatches up to 25% or tCK (clock period) are
- * allowed, so the value in the filed doesn’t have
+ * allowed, so the value in the filed doesn't have
  * to be very accurate.
  *
  * - 0x2 (b'10) - RDLVL_DL_0/1 - refers to adjusting the DQS strobe in relation
@@ -184,14 +184,14 @@ static int ddrmc_cal_dqs_to_dq(struct ddrmr_regs *ddrmr)
debug("RDLVL: PHY_RDLVL_EDGE:\t 0x%x\n",
  (tmp >> DDRMC_CR101_PHY_RDLVL_EDGE_OFF) & 0x1); //set 0
 
-   /* Program Leveling mode - CR93[SW_LVL_MODE] to ’b10 */
+   /* Program Leveling mode - CR93[SW_LVL_MODE] to 'b10 */
clrsetbits_le32(&ddrmr->cr[93], DDRMC_CR93_SW_LVL_MODE(0x3),
DDRMC_CR93_SW_LVL_MODE(0x2));
tmp = readl(&ddrmr->cr[93]);
debug("RDLVL: SW_LVL_MODE:\t 0x%x\n",
  (tmp >> DDRMC_CR93_SW_LVL_MODE_OFF) & 0x3);
 
-   /* Start procedure - CR93[SWLVL_START] to ’b1 */
+   /* Start procedure - CR93[SWLVL_START] to 'b1 */
sw_leveling_start;
 
/* Poll CR94[SWLVL_OP_DONE] */
@@ -211,7 +211,7 @@ static int ddrmc_cal_dqs_to_dq(struct ddrmr_regs *ddrmr)
0x << DDRMC_CR105_RDLVL_DL_0_OFF,