Skip to content

Commit

Permalink
Cleanup: Replace deprecated egrep with grep -E
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolledg-amd committed Nov 5, 2024
1 parent 5a93914 commit b1ebfb9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions scripts/onload
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ sfc_preload_linux() {
preload=libonload.so
fi

# Enable the preload
# Enable the preload
rawecho "$LD_PRELOAD" | grep -q "$(basename "$preload")" || {
if [ -z "$LD_PRELOAD" ]; then
LD_PRELOAD="$preload"
Expand All @@ -100,7 +100,7 @@ sfc_preload_linux() {

if $verbose; then
# Dump interesting bits of the environment.
env | egrep "^EF_|^LD_PRELOAD=|^LD_LIBRARY_PATH=|^LD_PRELOAD_64=" | sed "s/^/$me: env: /"
env | grep -E "^EF_|^LD_PRELOAD=|^LD_LIBRARY_PATH=|^LD_PRELOAD_64=" | sed "s/^/$me: env: /"
fi
}

Expand Down
14 changes: 7 additions & 7 deletions src/driver/linux/load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ USER_NET="xilinx_efct"


usage () {
err
err
err "bad command line for linux/load.sh '$allargs'"
err
err "usage: $p [options] [targets]"
Expand Down Expand Up @@ -319,7 +319,7 @@ donet () {
# wait for any device nodes to be created
sleep 0.5
# udev may or may not create the device nodes for us
# so use /proc/mtd to check what nodes should be created
# so use /proc/mtd to check what nodes should be created
# and make sure they are created
i=0
for F in _ `cat /proc/mtd | awk -F : '/mtd/ {print $1}'`; do
Expand Down Expand Up @@ -352,7 +352,7 @@ donet () {
houseip=$(ifconfig $houseeth | grep -o "inet addr:[0-9.]\+")
houseip=${houseip##*:}
netpf=$(/sbin/ip address show dev "$houseeth" | grep inet | head -1)
netpf=$(echo "$netpf" | egrep -o "/[0-9]+ " | sed 's+[/ ]++g')
netpf=$(echo "$netpf" | grep -E -o "/[0-9]+ " | sed 's+[/ ]++g')
os=`uname -a`
os=${os// /%20}
for ethif in $(get_interfaces); do
Expand Down Expand Up @@ -451,7 +451,7 @@ donet () {
done

# Make sure alternate DBI is not set

# Add to database
[ "$SETUP_UL_APPLOG" = "yes" ] && dologsetup
}
Expand Down Expand Up @@ -642,14 +642,14 @@ while [ $# -gt 0 ]; do
-noonloadconfig)
LOAD_CONFIG=false;;
-onloadnoconfigspec)
LOAD_CONFIG=true; LOAD_NOCONFIG=true;;
LOAD_CONFIG=true; LOAD_NOCONFIG=true;;
-probecpserverpath)
PROBE_CP_SERVER_PATH=true;;
-noprobecpserverpath)
PROBE_CP_SERVER_PATH=false;;
-onloadsafeconfig)
CONFIG_OWNER="/dev/null"; CONFIG_DRIVER="$CONFIG_DISABLE";;
-myconfig) CONFIG_OWNER="$2"; shift;;
-myconfig) CONFIG_OWNER="$2"; shift;;
-onloadcfg) CMD_EFABCFG="$2"; shift;;
-oo_bits) ONLOAD_OPT="$ONLOAD_OPT oo_debug_bits=$2"; shift;;
-noct) ONLOAD_OPT="$ONLOAD_OPT no_ct=1";;
Expand Down Expand Up @@ -710,7 +710,7 @@ if [ $# = 0 ]; then
else
while [ $# -gt 0 ]; do
case "$1" in
net)
net)
donet
;;
char|netchar)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ EFX_HAVE_XARRAY symbol xa_limit include/linux/xarray.h
EFX_HAVE_AUXILIARY_BUS file include/linux/auxiliary_bus.h
EFX_HAVE_NET_RPS_H file include/net/rps.h
EFX_HAVE_IP_TUNNEL_FLAGS_TO_BE16 symbol ip_tunnel_flags_to_be16 include/net/ip_tunnels.h
" | egrep -v -e '^#' -e '^$' | sed 's/[ \t][ \t]*/:/g'
" | grep -E -v -e '^#' -e '^$' | sed 's/[ \t][ \t]*/:/g'
}

######################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function usage()
function generate_compat_symbols() {
echo "
EFX_NEED_STRUCT_ETHTOOL_DUMP nsymbol ethtool_dump include/linux/ethtool.h
" | egrep -v -e '^#' -e '^$' | sed 's/[ \t][ \t]*/:/g'
" | grep -E -v -e '^#' -e '^$' | sed 's/[ \t][ \t]*/:/g'
}

######################################################################
Expand Down Expand Up @@ -101,7 +101,7 @@ function test_symbol()
fi
[ -f "$base/$file" ] && \
strip_comments $base/$file | \
egrep -w "$symbol" >/dev/null && \
grep -E -w "$symbol" >/dev/null && \
return 0
done
done
Expand Down Expand Up @@ -132,7 +132,7 @@ fi

# filter the available symbols
if [ -n "$FILTER" ]; then
compat_symbols="$(echo "$compat_symbols" | egrep "^($FILTER):")"
compat_symbols="$(echo "$compat_symbols" | grep -E "^($FILTER):")"
fi

function do_one_symbol() {
Expand Down
14 changes: 7 additions & 7 deletions src/driver/linux_net/scripts/kernel_compat_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function test_symbol()
fi
[ -f "$KBUILD_SRC/$prefix$file" ] && \
strip_comments $KBUILD_SRC/$prefix$file | \
egrep -w "$symbol" >/dev/null && \
grep -E -w "$symbol" >/dev/null && \
return 0
done
done
Expand Down Expand Up @@ -299,13 +299,13 @@ function test_inline_symbol()
# look for the inline..symbol. This is complicated since the inline
# and the symbol may be on different lines.
strip_comments $KBUILD_SRC/$file | \
egrep -m 1 -B 1 '(^|[,\* \(])'"$symbol"'($|[,; \(\)])' > $t
grep -E -m 1 -B 1 '(^|[,\* \(])'"$symbol"'($|[,; \(\)])' > $t
[ $? = 0 ] || return $?

# there is either an inline on the final line, or an inline and
# no semicolon on the previous line
head -1 $t | egrep -q 'inline[^;]*$' && return
tail -1 $t | egrep -q 'inline' && return
head -1 $t | grep -E -q 'inline[^;]*$' && return
tail -1 $t | grep -E -q 'inline' && return

return 1
}
Expand Down Expand Up @@ -335,14 +335,14 @@ function test_export()
echo >&2 "Looking for export of $symbol in $KBUILD_SRC/$file"
fi
if [ -f $KBUILD_SRC/$file ]; then
egrep -q 'EXPORT_(PER_CPU)?SYMBOL(_GPL)?\('"$symbol"'\)' $KBUILD_SRC/$file && return
grep -E -q 'EXPORT_(PER_CPU)?SYMBOL(_GPL)?\('"$symbol"'\)' $KBUILD_SRC/$file && return
fi
done
if [ -n "$MAP" ]; then
if [ $efx_verbose = true ]; then
echo >&2 "Looking for export of $symbol in $MAP"
fi
egrep -q "[A-Z] $symbol\$" $MAP && return
grep -E -q "[A-Z] $symbol\$" $MAP && return
fi
return 1
fi
Expand Down Expand Up @@ -594,7 +594,7 @@ fi

# filter the available symbols
if [ -n "$FILTER" ]; then
kompat_symbols="$(echo "$kompat_symbols" | egrep "^($FILTER):")"
kompat_symbols="$(echo "$kompat_symbols" | grep -E "^($FILTER):")"
fi

compile_dir="$(mktemp -d)"
Expand Down

0 comments on commit b1ebfb9

Please sign in to comment.