[PATCH] powerpc/boot: Fix dash warning

Madhavan Srinivasan maddy at linux.ibm.com
Tue Apr 22 23:47:22 AEST 2025



On 4/22/25 6:38 PM, Stephen Rothwell wrote:
> Hi Madhavan,
> 
> On Tue, 22 Apr 2025 17:00:23 +0530 Madhavan Srinivasan <maddy at linux.ibm.com> wrote:
>>
>>  # suppress some warnings in recent ld versions
>>  nowarn="-z noexecstack"
>> -if [ $(${CROSS}ld -v --no-warn-rwx-segments &>/dev/null; echo $?) -eq 0 ]; then
>> +if [ "$("${CROSS}"ld -v --no-warn-rwx-segments >/dev/null 2>&1; echo $?)" -eq 0 ]; then
>>  	nowarn="$nowarn --no-warn-rwx-segments"
>>  fi
> 
> On the way to bed, it occurred to me that the above "if" line can be
> written as:
> 
> if "${CROSS}ld" -v --no-warn-rwx-segments >/dev/null 2>&1; then

if command; then
  # Commands to execute if the command succeeds (exit status 0)
fi

Yeah nice, Will fix and send a v2

Maddy

> 



More information about the Linuxppc-dev mailing list