diff mbox

[03/98] drm.h: use __kernel_size_t instead of size_t

Message ID 1433000370-19509-4-git-send-email-mikko.rapeli@iki.fi (mailing list archive)
State New, archived
Headers show

Commit Message

Mikko Rapeli May 30, 2015, 3:37 p.m. UTC
Fixes userspace compilation error:

drm/drm.h:132:2: error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/drm/drm.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Emil Velikov June 3, 2015, 5:19 p.m. UTC | #1
On 30 May 2015 at 16:37, Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> Fixes userspace compilation error:
>
> drm/drm.h:132:2: error: unknown type name ‘size_t’
>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
>  include/uapi/drm/drm.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index ff6ef62..b197650 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -129,11 +129,11 @@ struct drm_version {
>         int version_major;        /**< Major version */
>         int version_minor;        /**< Minor version */
>         int version_patchlevel;   /**< Patch level */
> -       size_t name_len;          /**< Length of name buffer */
> +       __kernel_size_t name_len;         /**< Length of name buffer */
>         char __user *name;        /**< Name of driver */
> -       size_t date_len;          /**< Length of date buffer */
> +       __kernel_size_t date_len;         /**< Length of date buffer */
>         char __user *date;        /**< User-space buffer to hold date */
> -       size_t desc_len;          /**< Length of desc buffer */
> +       __kernel_size_t desc_len;         /**< Length of desc buffer */
>         char __user *desc;        /**< User-space buffer to hold desc */
>  };
>
> @@ -143,7 +143,7 @@ struct drm_version {
>   * \sa drmGetBusid() and drmSetBusId().
>   */
>  struct drm_unique {
> -       size_t unique_len;        /**< Length of unique */
> +       __kernel_size_t unique_len;       /**< Length of unique */
As the file is used by other platforms than Linux this change will
break them. Can you add a typedef similar to how __u8 and friends are
handled at the top of the file.

Thanks
Emil
Mikko Rapeli Aug. 30, 2015, 10:42 a.m. UTC | #2
On Wed, Jun 03, 2015 at 06:19:48PM +0100, Emil Velikov wrote:
> On 30 May 2015 at 16:37, Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> > Fixes userspace compilation error:
> >
> > drm/drm.h:132:2: error: unknown type name ‘size_t’
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> >  include/uapi/drm/drm.h | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> > index ff6ef62..b197650 100644
> > --- a/include/uapi/drm/drm.h
> > +++ b/include/uapi/drm/drm.h
> > @@ -129,11 +129,11 @@ struct drm_version {
> >         int version_major;        /**< Major version */
> >         int version_minor;        /**< Minor version */
> >         int version_patchlevel;   /**< Patch level */
> > -       size_t name_len;          /**< Length of name buffer */
> > +       __kernel_size_t name_len;         /**< Length of name buffer */
> >         char __user *name;        /**< Name of driver */
> > -       size_t date_len;          /**< Length of date buffer */
> > +       __kernel_size_t date_len;         /**< Length of date buffer */
> >         char __user *date;        /**< User-space buffer to hold date */
> > -       size_t desc_len;          /**< Length of desc buffer */
> > +       __kernel_size_t desc_len;         /**< Length of desc buffer */
> >         char __user *desc;        /**< User-space buffer to hold desc */
> >  };
> >
> > @@ -143,7 +143,7 @@ struct drm_version {
> >   * \sa drmGetBusid() and drmSetBusId().
> >   */
> >  struct drm_unique {
> > -       size_t unique_len;        /**< Length of unique */
> > +       __kernel_size_t unique_len;       /**< Length of unique */
> As the file is used by other platforms than Linux this change will
> break them. Can you add a typedef similar to how __u8 and friends are
> handled at the top of the file.

Yes, I added typedef size_t   __kernel_size_t; for other platforms.

-Mikko
Daniel Vetter Oct. 15, 2015, 6:49 a.m. UTC | #3
On Wed, Jun 03, 2015 at 06:19:48PM +0100, Emil Velikov wrote:
> On 30 May 2015 at 16:37, Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> > Fixes userspace compilation error:
> >
> > drm/drm.h:132:2: error: unknown type name ‘size_t’
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> >  include/uapi/drm/drm.h | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> > index ff6ef62..b197650 100644
> > --- a/include/uapi/drm/drm.h
> > +++ b/include/uapi/drm/drm.h
> > @@ -129,11 +129,11 @@ struct drm_version {
> >         int version_major;        /**< Major version */
> >         int version_minor;        /**< Minor version */
> >         int version_patchlevel;   /**< Patch level */
> > -       size_t name_len;          /**< Length of name buffer */
> > +       __kernel_size_t name_len;         /**< Length of name buffer */
> >         char __user *name;        /**< Name of driver */
> > -       size_t date_len;          /**< Length of date buffer */
> > +       __kernel_size_t date_len;         /**< Length of date buffer */
> >         char __user *date;        /**< User-space buffer to hold date */
> > -       size_t desc_len;          /**< Length of desc buffer */
> > +       __kernel_size_t desc_len;         /**< Length of desc buffer */
> >         char __user *desc;        /**< User-space buffer to hold desc */
> >  };
> >
> > @@ -143,7 +143,7 @@ struct drm_version {
> >   * \sa drmGetBusid() and drmSetBusId().
> >   */
> >  struct drm_unique {
> > -       size_t unique_len;        /**< Length of unique */
> > +       __kernel_size_t unique_len;       /**< Length of unique */
> As the file is used by other platforms than Linux this change will
> break them. Can you add a typedef similar to how __u8 and friends are
> handled at the top of the file.

This file isn't used by anyone else than Linus since years. All of the
typedefs can be nuked imo.
-Daniel
diff mbox

Patch

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index ff6ef62..b197650 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -129,11 +129,11 @@  struct drm_version {
 	int version_major;	  /**< Major version */
 	int version_minor;	  /**< Minor version */
 	int version_patchlevel;	  /**< Patch level */
-	size_t name_len;	  /**< Length of name buffer */
+	__kernel_size_t name_len;	  /**< Length of name buffer */
 	char __user *name;	  /**< Name of driver */
-	size_t date_len;	  /**< Length of date buffer */
+	__kernel_size_t date_len;	  /**< Length of date buffer */
 	char __user *date;	  /**< User-space buffer to hold date */
-	size_t desc_len;	  /**< Length of desc buffer */
+	__kernel_size_t desc_len;	  /**< Length of desc buffer */
 	char __user *desc;	  /**< User-space buffer to hold desc */
 };
 
@@ -143,7 +143,7 @@  struct drm_version {
  * \sa drmGetBusid() and drmSetBusId().
  */
 struct drm_unique {
-	size_t unique_len;	  /**< Length of unique */
+	__kernel_size_t unique_len;	  /**< Length of unique */
 	char __user *unique;	  /**< Unique name for driver instantiation */
 };