All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10
Date: Mon, 2 Jan 2023 10:37:08 +0100	[thread overview]
Message-ID: <Y7KlxBSIvN3q576G@pevik> (raw)
In-Reply-To: <1672132813-26636-1-git-send-email-xuyang2018.jy@fujitsu.com>

Hi Xu,

...
> +++ b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
> @@ -21,8 +21,7 @@ DEBUGFS_WAS_MOUNTED=0
>  DEBUGFS_PATH=""
>  DEBUGFS_CONTROL=""
>  DYNDEBUG_STATEMENTS="./debug_statements"
> -EMPTY_FLAG="-"
> -NEW_INTERFACE=0
> +EMPTY_FLAG="=_"

>  mount_debugfs()
>  {
> @@ -55,11 +54,6 @@ setup()
>  		tst_brk TBROK "Unable to find $DEBUGFS_CONTROL"
>  	fi

> -	if tst_kvcmp -ge 3.4 ; then
> -		NEW_INTERFACE=1
> -		EMPTY_FLAG="=_"
> -	fi
> -
>  	grep -v "^#" "$DEBUGFS_CONTROL" > "$DYNDEBUG_STATEMENTS"
>  }

> @@ -83,10 +77,8 @@ do_all_flags()

>  	for INPUT_LINE in $ALL_INPUTS; do
>  		do_flag "+p" "$OPTION" "$INPUT_LINE"
> -		if tst_kvcmp -ge 3.2 || [ $NEW_INTERFACE -eq 1 ] ; then
> -			do_flag "+flmt" "$OPTION" "$INPUT_LINE"
> -			do_flag "-flmt" "$OPTION" "$INPUT_LINE"
> -		fi
> +		do_flag "+flmt" "$OPTION" "$INPUT_LINE"
> +		do_flag "-flmt" "$OPTION" "$INPUT_LINE"
>  		do_flag "-p" "$OPTION" "$INPUT_LINE"
>  	done

> @@ -131,7 +123,7 @@ cleanup()
>  		FLAGS_SET=$(awk -v emp="$EMPTY_FLAG" '$3 != emp' $DYNDEBUG_STATEMENTS)
>  	fi
>  	if [ "$FLAGS_SET" ] ; then
> -		FLAG_PREFIX=$([ $NEW_INTERFACE -eq 1 ] && echo "" || echo "+")
FYI Original code was ugly, it should have been
[ $NEW_INTERFACE -eq 1 ] || NEW_INTERFACE="+"
(Now ignoring that local variables should use local keyword and be lowercase.)

> +		FLAG_PREFIX=$(echo "")
This evaluates to FLAG_PREFIX=
=> please remove the variable as it's always empty

>  		/bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
>  			/bin/echo -n "$FLAG_LINE" \
>  				| awk -v prf="$FLAG_PREFIX" -F " |:" \
change to:
  				| awk -v prf= -F " |:" \

NOTE: I'm going to cleanup the test after you merge (/bin/echo + variables).

With these changes:
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2023-01-02  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27  9:20 [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 Yang Xu
2022-12-27  9:20 ` [LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10 Yang Xu
2023-01-02 12:01   ` Petr Vorel
2022-12-27  9:20 ` [LTP] [PATCH 3/3] Remove old kernel version check when using min_kver " Yang Xu
2023-01-02 12:04   ` Petr Vorel
2023-01-02  9:37 ` Petr Vorel [this message]
2023-01-03  5:39   ` [LTP] [PATCH 1/3] shell: Remove old kernel version check below 3.10 xuyang2018.jy
2023-01-03 18:13   ` Petr Vorel
2023-01-04  4:59     ` xuyang2018.jy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7KlxBSIvN3q576G@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=xuyang2018.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.