2021-08-31 18:45:09

by Kari Argillander

[permalink] [raw]
Subject: [PATCH 2/5] fs/ntfs3: Use consistent spacing around '+'

Use consistent spacing around '+' for better code reading. Checkpatch
will also be happy.

Signed-off-by: Kari Argillander <[email protected]>
---
fs/ntfs3/frecord.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 938b12d56ca6..b207d260ac06 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -1451,7 +1451,7 @@ int ni_insert_resident(struct ntfs_inode *ni, u32 data_size,
attr->res.flags = RESIDENT_FLAG_INDEXED;

/* is_attr_indexed(attr)) == true */
- le16_add_cpu(&ni->mi.mrec->hard_links, +1);
+ le16_add_cpu(&ni->mi.mrec->hard_links, + 1);
ni->mi.dirty = true;
}
attr->res.res = 0;
--
2.25.1


2021-09-02 04:25:07

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 2/5] fs/ntfs3: Use consistent spacing around '+'

On Tue, 2021-08-31 at 21:15 +0300, Kari Argillander wrote:
> Use consistent spacing around '+' for better code reading. Checkpatch
> will also be happy.

I think you should remove the + instead

> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
[]
> @@ -1451,7 +1451,7 @@ int ni_insert_resident(struct ntfs_inode *ni, u32 data_size,
> ? attr->res.flags = RESIDENT_FLAG_INDEXED;
> ?
>
> ? /* is_attr_indexed(attr)) == true */
> - le16_add_cpu(&ni->mi.mrec->hard_links, +1);
> + le16_add_cpu(&ni->mi.mrec->hard_links, + 1);

le16_add_cpu(&ni->mi.mrec->hard_links, 1);


2021-09-02 08:14:05

by Kari Argillander

[permalink] [raw]
Subject: Re: [PATCH 2/5] fs/ntfs3: Use consistent spacing around '+'

On Wed, Sep 01, 2021 at 09:22:19PM -0700, Joe Perches wrote:
> On Tue, 2021-08-31 at 21:15 +0300, Kari Argillander wrote:
> > Use consistent spacing around '+' for better code reading. Checkpatch
> > will also be happy.
>
> I think you should remove the + instead

Konstantin can you look this as this was introduce by you just couple
days ago?

>
> > diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> []
> > @@ -1451,7 +1451,7 @@ int ni_insert_resident(struct ntfs_inode *ni, u32 data_size,
> > ? attr->res.flags = RESIDENT_FLAG_INDEXED;
> > ?
> >
> > ? /* is_attr_indexed(attr)) == true */
> > - le16_add_cpu(&ni->mi.mrec->hard_links, +1);
> > + le16_add_cpu(&ni->mi.mrec->hard_links, + 1);
>
> le16_add_cpu(&ni->mi.mrec->hard_links, 1);
>
>

2021-09-07 16:26:21

by Konstantin Komarov

[permalink] [raw]
Subject: Re: [PATCH 2/5] fs/ntfs3: Use consistent spacing around '+'



On 02.09.2021 11:10, Kari Argillander wrote:
> On Wed, Sep 01, 2021 at 09:22:19PM -0700, Joe Perches wrote:
>> On Tue, 2021-08-31 at 21:15 +0300, Kari Argillander wrote:
>>> Use consistent spacing around '+' for better code reading. Checkpatch
>>> will also be happy.
>>
>> I think you should remove the + instead
>
> Konstantin can you look this as this was introduce by you just couple
> days ago?
>
>>
>>> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
>> []
>>> @@ -1451,7 +1451,7 @@ int ni_insert_resident(struct ntfs_inode *ni, u32 data_size,
>>>   attr->res.flags = RESIDENT_FLAG_INDEXED;
>>>  
>>>
>>>   /* is_attr_indexed(attr)) == true */
>>> - le16_add_cpu(&ni->mi.mrec->hard_links, +1);
>>> + le16_add_cpu(&ni->mi.mrec->hard_links, + 1);
>>
>> le16_add_cpu(&ni->mi.mrec->hard_links, 1);
>>
>>

Hi, Kari, Joe!
Yes, '+' can be removed, it was added for better visibility,
but it's subjective.
After checking code - it's the only place with '+1', so let's remove it.

2021-09-07 17:36:26

by Kari Argillander

[permalink] [raw]
Subject: Re: [PATCH 2/5] fs/ntfs3: Use consistent spacing around '+'

On Tue, Sep 07, 2021 at 07:23:13PM +0300, Konstantin Komarov wrote:
>
>
> On 02.09.2021 11:10, Kari Argillander wrote:
> > On Wed, Sep 01, 2021 at 09:22:19PM -0700, Joe Perches wrote:
> >> On Tue, 2021-08-31 at 21:15 +0300, Kari Argillander wrote:
> >>> Use consistent spacing around '+' for better code reading. Checkpatch
> >>> will also be happy.
> >>
> >> I think you should remove the + instead
> >
> > Konstantin can you look this as this was introduce by you just couple
> > days ago?
> >
> >>
> >>> diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
> >> []
> >>> @@ -1451,7 +1451,7 @@ int ni_insert_resident(struct ntfs_inode *ni, u32 data_size,
> >>> ? attr->res.flags = RESIDENT_FLAG_INDEXED;
> >>> ?
> >>>
> >>> ? /* is_attr_indexed(attr)) == true */
> >>> - le16_add_cpu(&ni->mi.mrec->hard_links, +1);
> >>> + le16_add_cpu(&ni->mi.mrec->hard_links, + 1);
> >>
> >> le16_add_cpu(&ni->mi.mrec->hard_links, 1);
> >>
> >>
>
> Hi, Kari, Joe!
> Yes, '+' can be removed, it was added for better visibility,
> but it's subjective.
> After checking code - it's the only place with '+1', so let's remove it.

Already done in v2 [1].

[1]: lore.kernel.org/ntfs3/[email protected]