Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1158451 > unrolled thread
| Started by | Sergei Zviagintsev <sergei@s15v.net> |
|---|---|
| First post | 2015-06-04 12:50 +0200 |
| Last post | 2015-06-04 13:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] kdbus: use FIELD_SIZEOF in kdbus_member_set_user macro Sergei Zviagintsev <sergei@s15v.net> - 2015-06-04 12:50 +0200
Re: [PATCH] kdbus: use FIELD_SIZEOF in kdbus_member_set_user macro David Herrmann <dh.herrmann@gmail.com> - 2015-06-04 13:40 +0200
| From | Sergei Zviagintsev <sergei@s15v.net> |
|---|---|
| Date | 2015-06-04 12:50 +0200 |
| Subject | [PATCH] kdbus: use FIELD_SIZEOF in kdbus_member_set_user macro |
| Message-ID | <pxASK-6NR-15@gated-at.bofh.it> |
sizeof(((_t *)0)->_m) -> FIELD_SIZEOF(_t, _m)
Use conventional macro according to chapter 17 of
Documentation/CodingStyle.
Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
---
ipc/kdbus/util.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ipc/kdbus/util.h b/ipc/kdbus/util.h
index 9fedf8ab41cd..529716669fe7 100644
--- a/ipc/kdbus/util.h
+++ b/ipc/kdbus/util.h
@@ -40,7 +40,7 @@
({ \
u64 __user *_sz = \
(void __user *)((u8 __user *)(_b) + offsetof(_t, _m)); \
- copy_to_user(_sz, _s, sizeof(((_t *)0)->_m)); \
+ copy_to_user(_sz, _s, FIELD_SIZEOF(_t, _m)); \
})
/**
--
1.8.3.1
--
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/
[toc] | [next] | [standalone]
| From | David Herrmann <dh.herrmann@gmail.com> |
|---|---|
| Date | 2015-06-04 13:40 +0200 |
| Message-ID | <pxBF8-7YJ-7@gated-at.bofh.it> |
| In reply to | #1158451 |
Hi
On Thu, Jun 4, 2015 at 12:39 PM, Sergei Zviagintsev <sergei@s15v.net> wrote:
> sizeof(((_t *)0)->_m) -> FIELD_SIZEOF(_t, _m)
>
> Use conventional macro according to chapter 17 of
> Documentation/CodingStyle.
>
> Signed-off-by: Sergei Zviagintsev <sergei@s15v.net>
> ---
> ipc/kdbus/util.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Thanks
David
> diff --git a/ipc/kdbus/util.h b/ipc/kdbus/util.h
> index 9fedf8ab41cd..529716669fe7 100644
> --- a/ipc/kdbus/util.h
> +++ b/ipc/kdbus/util.h
> @@ -40,7 +40,7 @@
> ({ \
> u64 __user *_sz = \
> (void __user *)((u8 __user *)(_b) + offsetof(_t, _m)); \
> - copy_to_user(_sz, _s, sizeof(((_t *)0)->_m)); \
> + copy_to_user(_sz, _s, FIELD_SIZEOF(_t, _m)); \
> })
>
> /**
> --
> 1.8.3.1
>
--
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/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web