diff mbox series

[ndctl,3/3] test/cxl-region-sysfs.sh: Fix cxl-region-sysfs.sh: line 107: [: missing `]'

Message ID 20231123023058.2963551-3-lizhijian@fujitsu.com
State Accepted
Commit aec55008a572b9f5ea782764b7cde51da702fb62
Headers show
Series [ndctl,1/3] test/cxl-region-sysfs.sh: covert size and resource to hex before test | expand

Commit Message

Zhijian Li (Fujitsu) Nov. 23, 2023, 2:30 a.m. UTC
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 test/cxl-region-sysfs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Williams Dec. 6, 2023, 9:37 p.m. UTC | #1
Li Zhijian wrote:
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>

Please no patches with empty changelogs. Commentary on the impact of the
change is always welcome.

Otherwise change looks good to me, and I wonder why this error is only
triggering now?

Acked-by: Dan Williams <dan.j.williams@intel.com>

> ---
>  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 89f21a3..3878351 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
> 
>
Zhijian Li (Fujitsu) Dec. 7, 2023, 9:07 a.m. UTC | #2
On 07/12/2023 05:37, Dan Williams wrote:
> Li Zhijian wrote:
>> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> 
> Please no patches with empty changelogs. Commentary on the impact of the
> change is always welcome.
> 
> Otherwise change looks good to me, and I wonder why this error is only
> triggering now?


I have to say current condition checking 1) easily hides *BUG*
1) [ a -ne b ] && echo NG

Instead, 2) as below are more reliable.
2) [ a -eq b ] || echo NG



> 
> Acked-by: Dan Williams <dan.j.williams@intel.com>
> 
>> ---
>>   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 89f21a3..3878351 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
>>
>>
> 
>
diff mbox series

Patch

diff --git a/test/cxl-region-sysfs.sh b/test/cxl-region-sysfs.sh
index 89f21a3..3878351 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)