diff mbox

[1/2] xfstests: fix a typo in _require_block_device()

Message ID 1424069440-14957-1-git-send-email-zhaolei@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhaolei Feb. 16, 2015, 6:50 a.m. UTC
From: Zhao Lei <zhaolei@cn.fujitsu.com>

We need to check "$1" instead "$SCRATCH_DEV" in this function.
And make tabs same with other code.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 common/rc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Dave Chinner Feb. 18, 2015, 1:21 a.m. UTC | #1
On Mon, Feb 16, 2015 at 02:50:39PM +0800, Zhaolei wrote:
> From: Zhao Lei <zhaolei@cn.fujitsu.com>
> 
> We need to check "$1" instead "$SCRATCH_DEV" in this function.
> And make tabs same with other code.
> 
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> ---
>  common/rc | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 7449a1d..76522d4 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1284,13 +1284,13 @@ _require_command()
>  # $1 - device
>  _require_block_device()
>  {
> -	if [ -z "$1" ]; then
> -		echo "Usage: _require_block_device <dev>" 1>&2
> -		exit 1
> -	fi
> -	if [ "`_is_block_dev $SCRATCH_DEV`" == "" ]; then
> -		_notrun "require $1 to be valid block disk"
> -	fi
> +    if [ -z "$1" ]; then
> +	echo "Usage: _require_block_device <dev>" 1>&2
> +	exit 1
> +    fi
> +    if [ "`_is_block_dev $1`" == "" ]; then
> +	_notrun "require $1 to be valid block disk"
> +    fi
>  }

The change is fine - the reformating of the code is not. 8 space
tabs for all new code and all new modifications, please.

Cheers,

Dave.
Andrew Price Feb. 18, 2015, 10:21 a.m. UTC | #2
On 18/02/15 01:21, Dave Chinner wrote:
> On Mon, Feb 16, 2015 at 02:50:39PM +0800, Zhaolei wrote:
>> From: Zhao Lei <zhaolei@cn.fujitsu.com>
>>
>> We need to check "$1" instead "$SCRATCH_DEV" in this function.
>> And make tabs same with other code.
>>
>> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
>> ---
>>   common/rc | 14 +++++++-------
>>   1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/common/rc b/common/rc
>> index 7449a1d..76522d4 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -1284,13 +1284,13 @@ _require_command()
>>   # $1 - device
>>   _require_block_device()
>>   {
>> -	if [ -z "$1" ]; then
>> -		echo "Usage: _require_block_device <dev>" 1>&2
>> -		exit 1
>> -	fi
>> -	if [ "`_is_block_dev $SCRATCH_DEV`" == "" ]; then
>> -		_notrun "require $1 to be valid block disk"
>> -	fi
>> +    if [ -z "$1" ]; then
>> +	echo "Usage: _require_block_device <dev>" 1>&2
>> +	exit 1
>> +    fi
>> +    if [ "`_is_block_dev $1`" == "" ]; then
>> +	_notrun "require $1 to be valid block disk"
>> +    fi
>>   }
>
> The change is fine - the reformating of the code is not. 8 space
> tabs

To be clear, do you mean 8 spaces or single tabs?

Andy

> for all new code and all new modifications, please.
>
> Cheers,
>
> Dave.
>

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dave Chinner Feb. 18, 2015, 10:02 p.m. UTC | #3
On Wed, Feb 18, 2015 at 10:21:16AM +0000, Andrew Price wrote:
> On 18/02/15 01:21, Dave Chinner wrote:
> >On Mon, Feb 16, 2015 at 02:50:39PM +0800, Zhaolei wrote:
> >>From: Zhao Lei <zhaolei@cn.fujitsu.com>
> >>
> >>We need to check "$1" instead "$SCRATCH_DEV" in this function.
> >>And make tabs same with other code.
> >>
> >>Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> >>---
> >>  common/rc | 14 +++++++-------
> >>  1 file changed, 7 insertions(+), 7 deletions(-)
> >>
> >>diff --git a/common/rc b/common/rc
> >>index 7449a1d..76522d4 100644
> >>--- a/common/rc
> >>+++ b/common/rc
> >>@@ -1284,13 +1284,13 @@ _require_command()
> >>  # $1 - device
> >>  _require_block_device()
> >>  {
> >>-	if [ -z "$1" ]; then
> >>-		echo "Usage: _require_block_device <dev>" 1>&2
> >>-		exit 1
> >>-	fi
> >>-	if [ "`_is_block_dev $SCRATCH_DEV`" == "" ]; then
> >>-		_notrun "require $1 to be valid block disk"
> >>-	fi
> >>+    if [ -z "$1" ]; then
> >>+	echo "Usage: _require_block_device <dev>" 1>&2
> >>+	exit 1
> >>+    fi
> >>+    if [ "`_is_block_dev $1`" == "" ]; then
> >>+	_notrun "require $1 to be valid block disk"
> >>+    fi
> >>  }
> >
> >The change is fine - the reformating of the code is not. 8 space
> >tabs
> 
> To be clear, do you mean 8 spaces or single tabs?

Single tab, but tabs are the width of 8 spaces. Same as you'd use
for writing new kernel code.

Cheers,

Dave.
Lukas Czerner Feb. 26, 2015, 9:52 a.m. UTC | #4
On Thu, 19 Feb 2015, Dave Chinner wrote:

> Date: Thu, 19 Feb 2015 09:02:04 +1100
> From: Dave Chinner <david@fromorbit.com>
> To: Andrew Price <andyp@fedoraproject.org>
> Cc: fstests@vger.kernel.org
> Subject: Re: [PATCH 1/2] xfstests: fix a typo in _require_block_device()
> 
> On Wed, Feb 18, 2015 at 10:21:16AM +0000, Andrew Price wrote:
> > On 18/02/15 01:21, Dave Chinner wrote:
> > >On Mon, Feb 16, 2015 at 02:50:39PM +0800, Zhaolei wrote:
> > >>From: Zhao Lei <zhaolei@cn.fujitsu.com>
> > >>
> > >>We need to check "$1" instead "$SCRATCH_DEV" in this function.
> > >>And make tabs same with other code.
> > >>
> > >>Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> > >>---
> > >>  common/rc | 14 +++++++-------
> > >>  1 file changed, 7 insertions(+), 7 deletions(-)
> > >>
> > >>diff --git a/common/rc b/common/rc
> > >>index 7449a1d..76522d4 100644
> > >>--- a/common/rc
> > >>+++ b/common/rc
> > >>@@ -1284,13 +1284,13 @@ _require_command()
> > >>  # $1 - device
> > >>  _require_block_device()
> > >>  {
> > >>-	if [ -z "$1" ]; then
> > >>-		echo "Usage: _require_block_device <dev>" 1>&2
> > >>-		exit 1
> > >>-	fi
> > >>-	if [ "`_is_block_dev $SCRATCH_DEV`" == "" ]; then
> > >>-		_notrun "require $1 to be valid block disk"
> > >>-	fi
> > >>+    if [ -z "$1" ]; then
> > >>+	echo "Usage: _require_block_device <dev>" 1>&2
> > >>+	exit 1
> > >>+    fi
> > >>+    if [ "`_is_block_dev $1`" == "" ]; then
> > >>+	_notrun "require $1 to be valid block disk"
> > >>+    fi
> > >>  }
> > >
> > >The change is fine - the reformating of the code is not. 8 space
> > >tabs
> > 
> > To be clear, do you mean 8 spaces or single tabs?
> 
> Single tab, but tabs are the width of 8 spaces. Same as you'd use
> for writing new kernel code.

Even I was confused by that :) Just use tabs not spaces. Width of the
tab is whatever your editor decides it is so it's irrelevant :)

-Lukas

> 
> Cheers,
> 
> Dave.
> 
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrew Price Feb. 26, 2015, 11:41 a.m. UTC | #5
>>>> The change is fine - the reformating of the code is not. 8 space
>>>> tabs
>>>
>>> To be clear, do you mean 8 spaces or single tabs?
>>
>> Single tab, but tabs are the width of 8 spaces. Same as you'd use
>> for writing new kernel code.
>
> Even I was confused by that :) Just use tabs not spaces. Width of the
> tab is whatever your editor decides it is

Exactly :)

> so it's irrelevant :)

Well, unfortunately many use tabs for alignment as well as indentation 
so changing the width of a tab can make code look ugly where there are 
line continuations, aligned comments, etc. Using tabs for indentation 
and spaces for alignment is ideal, but tabs-for-alignment is so common 
that assuming tabs are always displayed 8 characters wide is often the 
pragmatic option.

Andy
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/rc b/common/rc
index 7449a1d..76522d4 100644
--- a/common/rc
+++ b/common/rc
@@ -1284,13 +1284,13 @@  _require_command()
 # $1 - device
 _require_block_device()
 {
-	if [ -z "$1" ]; then
-		echo "Usage: _require_block_device <dev>" 1>&2
-		exit 1
-	fi
-	if [ "`_is_block_dev $SCRATCH_DEV`" == "" ]; then
-		_notrun "require $1 to be valid block disk"
-	fi
+    if [ -z "$1" ]; then
+	echo "Usage: _require_block_device <dev>" 1>&2
+	exit 1
+    fi
+    if [ "`_is_block_dev $1`" == "" ]; then
+	_notrun "require $1 to be valid block disk"
+    fi
 }
 
 # this test requires the device mapper flakey target