Re: [PATCH blktests 1/2] common/rc: Check both max_active_zones and max_open_zones

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 03, 2020 / 09:50, Johannes Thumshirn wrote:
> On 03/12/2020 09:22, Shin'ichiro Kawasaki wrote:
> > -_test_dev_max_active_zones() {
> > +# Return max open zones or max active zones of the test target device.
> > +# If the device has both, return smaller value.
> > +_test_dev_max_open_active_zones() {
> > +	local -i ret=0
> > +	local -i maz=0
> > +
> > +	if [[ -r "${TEST_DEV_SYSFS}/queue/max_open_zones" ]]; then
> > +		ret=$(_test_dev_queue_get max_open_zones)
> > +	fi
> > +
> >  	if [[ -r "${TEST_DEV_SYSFS}/queue/max_active_zones" ]]; then
> > -		_test_dev_queue_get max_active_zones
> > -	else
> > -		echo 0
> > +		maz=$(_test_dev_queue_get max_active_zones)
> >  	fi
> > +
> > +	if ((!ret)) || ((maz && maz < ret)); then
> > +		ret="${maz}"
> > +	fi
> > +
> > +	echo "${ret}"
> >  }
> 
> Maybe change $ret to $moz and then
> 
> if ((!moz)) || ((maz && maz < moz)); then
> 	echo ${maz}
> else
> 	echo ${moz}
> fi

Thanks. I agree that your code is easier to understand.
Will reflect this comment and send out v2.

> 
> Otherwise looks good,
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
> 

-- 
Best Regards,
Shin'ichiro Kawasaki



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux