* [PATCH V2] fs/reiserfs/stree.c: remove obsolete __constant
@ 2014-05-03 20:33 Fabian Frederick
2014-05-14 22:01 ` Jan Kara
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Frederick @ 2014-05-03 20:33 UTC (permalink / raw)
To: linux-kernel; +Cc: reiserfs-devel, akpm
__constant_cpu_to_le32 converted to cpu_to_le32
Cc: reiserfs-devel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
V2: Cc email fixed
fs/reiserfs/stree.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index b14706a..615cd9a 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -228,10 +228,10 @@ const struct reiserfs_key MIN_KEY = { 0, 0, {{0, 0},} };
/* Maximal possible key. It is never in the tree. */
static const struct reiserfs_key MAX_KEY = {
- __constant_cpu_to_le32(0xffffffff),
- __constant_cpu_to_le32(0xffffffff),
- {{__constant_cpu_to_le32(0xffffffff),
- __constant_cpu_to_le32(0xffffffff)},}
+ cpu_to_le32(0xffffffff),
+ cpu_to_le32(0xffffffff),
+ {{cpu_to_le32(0xffffffff),
+ cpu_to_le32(0xffffffff)},}
};
/* Get delimiting key of the buffer by looking for it in the buffers in the path, starting from the bottom
--
1.8.4.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH V2] fs/reiserfs/stree.c: remove obsolete __constant
2014-05-03 20:33 [PATCH V2] fs/reiserfs/stree.c: remove obsolete __constant Fabian Frederick
@ 2014-05-14 22:01 ` Jan Kara
2014-05-14 22:08 ` Richard Weinberger
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2014-05-14 22:01 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, reiserfs-devel, akpm
On Sat 03-05-14 22:33:24, Fabian Frederick wrote:
> __constant_cpu_to_le32 converted to cpu_to_le32
>
> Cc: reiserfs-devel@vger.kernel.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Just for my education, where have you learned that __constant_...
functions are obsolete?
Honza
> ---
> V2: Cc email fixed
>
> fs/reiserfs/stree.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
> index b14706a..615cd9a 100644
> --- a/fs/reiserfs/stree.c
> +++ b/fs/reiserfs/stree.c
> @@ -228,10 +228,10 @@ const struct reiserfs_key MIN_KEY = { 0, 0, {{0, 0},} };
>
> /* Maximal possible key. It is never in the tree. */
> static const struct reiserfs_key MAX_KEY = {
> - __constant_cpu_to_le32(0xffffffff),
> - __constant_cpu_to_le32(0xffffffff),
> - {{__constant_cpu_to_le32(0xffffffff),
> - __constant_cpu_to_le32(0xffffffff)},}
> + cpu_to_le32(0xffffffff),
> + cpu_to_le32(0xffffffff),
> + {{cpu_to_le32(0xffffffff),
> + cpu_to_le32(0xffffffff)},}
> };
>
> /* Get delimiting key of the buffer by looking for it in the buffers in the path, starting from the bottom
> --
> 1.8.4.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] fs/reiserfs/stree.c: remove obsolete __constant
2014-05-14 22:01 ` Jan Kara
@ 2014-05-14 22:08 ` Richard Weinberger
2014-05-14 22:27 ` Joe Perches
2014-05-14 22:29 ` Jan Kara
0 siblings, 2 replies; 5+ messages in thread
From: Richard Weinberger @ 2014-05-14 22:08 UTC (permalink / raw)
To: Jan Kara; +Cc: Fabian Frederick, linux-kernel, reiserfs-devel, akpm
On Thu, May 15, 2014 at 12:01 AM, Jan Kara <jack@suse.cz> wrote:
> On Sat 03-05-14 22:33:24, Fabian Frederick wrote:
>> __constant_cpu_to_le32 converted to cpu_to_le32
>>
>> Cc: reiserfs-devel@vger.kernel.org
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> Just for my education, where have you learned that __constant_...
> functions are obsolete?
IIRC checkpatch.pl barks if you use __constant_... outside of include/uapi/
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] fs/reiserfs/stree.c: remove obsolete __constant
2014-05-14 22:08 ` Richard Weinberger
@ 2014-05-14 22:27 ` Joe Perches
2014-05-14 22:29 ` Jan Kara
1 sibling, 0 replies; 5+ messages in thread
From: Joe Perches @ 2014-05-14 22:27 UTC (permalink / raw)
To: Richard Weinberger
Cc: Jan Kara, Fabian Frederick, linux-kernel, reiserfs-devel, akpm
On Thu, 2014-05-15 at 00:08 +0200, Richard Weinberger wrote:
> On Thu, May 15, 2014 at 12:01 AM, Jan Kara <jack@suse.cz> wrote:
> > On Sat 03-05-14 22:33:24, Fabian Frederick wrote:
> >> __constant_cpu_to_le32 converted to cpu_to_le32
> >>
> >> Cc: reiserfs-devel@vger.kernel.org
> >> Cc: Andrew Morton <akpm@linux-foundation.org>
> >> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> > Just for my education, where have you learned that __constant_...
> > functions are obsolete?
>
> IIRC checkpatch.pl barks if you use __constant_... outside of include/uapi/
I'd use not preferred and unnecessarily verbose more than obsolete.
These conversions are all tested with __builtin_constant_p
via indirection to macros like __swab32
include/uapi/linux/swab.h:#define __swab32(x) \
include/uapi/linux/swab.h- (__builtin_constant_p((__u32)(x)) ? \
include/uapi/linux/swab.h- ___constant_swab32(x) : \
include/uapi/linux/swab.h- __fswab32(x))
include/uapi/linux/swab.h:#define ___constant_swab32(x) ((__u32)( \
include/uapi/linux/swab.h- (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
include/uapi/linux/swab.h- (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
include/uapi/linux/swab.h- (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
include/uapi/linux/swab.h- (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] fs/reiserfs/stree.c: remove obsolete __constant
2014-05-14 22:08 ` Richard Weinberger
2014-05-14 22:27 ` Joe Perches
@ 2014-05-14 22:29 ` Jan Kara
1 sibling, 0 replies; 5+ messages in thread
From: Jan Kara @ 2014-05-14 22:29 UTC (permalink / raw)
To: Richard Weinberger
Cc: Jan Kara, Fabian Frederick, linux-kernel, reiserfs-devel, akpm
On Thu 15-05-14 00:08:34, Richard Weinberger wrote:
> On Thu, May 15, 2014 at 12:01 AM, Jan Kara <jack@suse.cz> wrote:
> > On Sat 03-05-14 22:33:24, Fabian Frederick wrote:
> >> __constant_cpu_to_le32 converted to cpu_to_le32
> >>
> >> Cc: reiserfs-devel@vger.kernel.org
> >> Cc: Andrew Morton <akpm@linux-foundation.org>
> >> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> > Just for my education, where have you learned that __constant_...
> > functions are obsolete?
>
> IIRC checkpatch.pl barks if you use __constant_... outside of include/uapi/
OK. I've merged the patch into my tree.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-14 22:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-03 20:33 [PATCH V2] fs/reiserfs/stree.c: remove obsolete __constant Fabian Frederick
2014-05-14 22:01 ` Jan Kara
2014-05-14 22:08 ` Richard Weinberger
2014-05-14 22:27 ` Joe Perches
2014-05-14 22:29 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).