You want to add

From: Konrad Schwarz <[email protected]>

to the top of the commit message when submitting via a different account
so that author and signer are aligned. Or use git sendemail which will
do that when author and submitter address differ.

On 19.11.25 18:28, [email protected] wrote:
> The mkemmc.sh script calculates file sizes via `wc -c'.  `wc'
> normally works by reading the entire file, resulting in O(n) performance.
> 
> Unix file systems obviously know a file's size and POSIX `ls' reports this
> information unambiguously, so replacing `wc' with `ls' ensures O(1)
> performance.  The files in question tend to be large making this change
> worthwhile.

Valid point.

> 
> Signed-off-by: Konrad Schwarz <[email protected]>
> ---
>  scripts/mkemmc.sh | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/mkemmc.sh b/scripts/mkemmc.sh
> index 45dc3f08fa..d2c4e84b16 100755
> --- a/scripts/mkemmc.sh
> +++ b/scripts/mkemmc.sh
> @@ -37,13 +37,19 @@ usage() {
>      exit "$1"
>  }
> 
> +file_size() {
> +     ls_line=$(ls -Hdog "$1") || return

This will not suppress the error message when a file does not exist or
is not accessible, so:

ls_line=$(ls -Hdog "$1" 2>/dev/null) || return

> +     printf %s\\n "$ls_line" | cut -d\  -f3
> +     unset ls_line
> +}
> +
>  process_size() {
>      name=$1
>      image_file=$2
>      alignment=$3
>      image_arg=$4
>      if [ "${image_arg#*:}" = "$image_arg"  ]; then
> -        if ! size=$(wc -c < "$image_file" 2>/dev/null); then
> +        if ! size=$(file_size "$image_file"); then
>              echo "Missing $name image '$image_file'." >&2
>              exit 1
>          fi
> @@ -105,7 +111,7 @@ check_truncation() {
>      if [ "$image_file" = "/dev/zero" ]; then
>          return
>      fi
> -    if ! actual_size=$(wc -c < "$image_file" 2>/dev/null); then
> +    if ! actual_size=$(file_size "$image_file"); then
>          echo "Missing image '$image_file'." >&2
>          exit 1
>      fi

Thanks,
Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center

Reply via email to