On 13/12/2023 04:54, Alison Schofield wrote:
> On Tue, Dec 12, 2023 at 03:42:28PM +0800, Li Zhijian wrote:
>> A space is missing before ']'
> 
> What's happens when that space is missing?

It's a syntax error, so
'[ $ig -ne $r_ig]' is always false, it may hide the a real error.



> That's partly a request to add an impact statement, but also
> for my education as I'm just learning all this shellcheck
> stuff too.

shellcheck is able to inspect this error.

> 
> BTW - if any of this was found using a tool, rather than
> by inspection, please include a note of the tool used.

This time, they are all found by eyes :)
when i'm checking the full log when i met an error.


Thanks
Zhijian

> 
> Thanks,
> Alison
> 
>>
>> Acked-by: Dan Williams <[email protected]>
>> Signed-off-by: Li Zhijian <[email protected]>
>> ---
>>   test/cxl-region-sysfs.sh | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/test/cxl-region-sysfs.sh b/test/cxl-region-sysfs.sh
>> index 6a5da6d..db1a163 100644
>> --- a/test/cxl-region-sysfs.sh
>> +++ b/test/cxl-region-sysfs.sh
>> @@ -104,7 +104,7 @@ do
>>      iw=$(cat /sys/bus/cxl/devices/$i/interleave_ways)
>>      ig=$(cat /sys/bus/cxl/devices/$i/interleave_granularity)
>>      [ $iw -ne $nr_targets ] && err "$LINENO: decoder: $i iw: $iw targets: 
>> $nr_targets"
>> -    [ $ig -ne $r_ig] && err "$LINENO: decoder: $i ig: $ig root ig: $r_ig"
>> +    [ $ig -ne $r_ig ] && err "$LINENO: decoder: $i ig: $ig root ig: $r_ig"
>>   
>>      sz=$(cat /sys/bus/cxl/devices/$i/size)
>>      res=$(cat /sys/bus/cxl/devices/$i/start)
>> -- 
>> 2.41.0
>>
>>
> 

Reply via email to