Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1629637 > unrolled thread

[PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers

Started byMats Karrman <mats.dev.list@gmail.com>
First post2017-04-24 16:30 +0200
Last post2017-04-25 10:30 +0200
Articles 7 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: typec: Don't prevent using constant typec_mode_desc  initializers Mats Karrman <mats.dev.list@gmail.com> - 2017-04-24 16:30 +0200
    Re: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers Guenter Roeck <groeck@google.com> - 2017-04-24 19:20 +0200
    [PATCH v2] usb: typec: Don't prevent using constant typec_mode_desc  initializers Mats Karrman <mats.dev.list@gmail.com> - 2017-04-24 20:30 +0200
      [PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc  initializers Mats Karrman <mats.dev.list@gmail.com> - 2017-04-24 21:00 +0200
        Re: [PATCH v3] usb: typec: Don't prevent using constant  typec_mode_desc initializers Guenter Roeck <groeck@google.com> - 2017-04-25 07:30 +0200
        Re: [PATCH v3] usb: typec: Don't prevent using constant  typec_mode_desc initializers Greg KH <greg@kroah.com> - 2017-04-25 20:20 +0200
    Re: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers Felipe Balbi <felipe.balbi@linux.intel.com> - 2017-04-25 10:30 +0200

#1629637 — [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers

FromMats Karrman <mats.dev.list@gmail.com>
Date2017-04-24 16:30 +0200
Subject[PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers
Message-ID<tzNa3-87g-47@gated-at.bofh.it>
 From 98ff2be4de83f4d4b5293bfa424c274b25400e1e Mon Sep 17 00:00:00 2001
From: Mats Karrman <mats.dev.list@gmail.com>
Date: Mon, 24 Apr 2017 15:21:39 +0200
Subject: [PATCH] usb: typec: Don't prevent using constant 
typec_mode_desc initializers

---
  drivers/usb/typec/typec.c | 11 ++++++-----
  include/linux/usb/typec.h |  6 +++---
  2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
index 89e540b..db5ee73 100644
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -291,7 +291,7 @@ typec_altmode_roles_show(struct device *dev, struct 
device_attribute *attr,
  }

  static void typec_init_modes(struct typec_altmode *alt,
-                 struct typec_mode_desc *desc, bool is_port)
+                 const struct typec_mode_desc *desc, bool is_port)
  {
      int i;

@@ -378,7 +378,8 @@ static const struct device_type 
typec_altmode_dev_type = {
  };

  static struct typec_altmode *
-typec_register_altmode(struct device *parent, struct typec_altmode_desc 
*desc)
+typec_register_altmode(struct device *parent,
+               const struct typec_altmode_desc *desc)
  {
      struct typec_altmode *alt;
      int ret;
@@ -495,7 +496,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
   */
  struct typec_altmode *
  typec_partner_register_altmode(struct typec_partner *partner,
-                   struct typec_altmode_desc *desc)
+                   const struct typec_altmode_desc *desc)
  {
      return typec_register_altmode(&partner->dev, desc);
  }
@@ -590,7 +591,7 @@ static const struct device_type typec_plug_dev_type = {
   */
  struct typec_altmode *
  typec_plug_register_altmode(struct typec_plug *plug,
-                struct typec_altmode_desc *desc)
+                const struct typec_altmode_desc *desc)
  {
      return typec_register_altmode(&plug->dev, desc);
  }
@@ -1159,7 +1160,7 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode);
   */
  struct typec_altmode *
  typec_port_register_altmode(struct typec_port *port,
-                struct typec_altmode_desc *desc)
+                const struct typec_altmode_desc *desc)
  {
      return typec_register_altmode(&port->dev, desc);
  }
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
index ec78204..d1d2ebc 100644
--- a/include/linux/usb/typec.h
+++ b/include/linux/usb/typec.h
@@ -117,13 +117,13 @@ struct typec_altmode_desc {

  struct typec_altmode
  *typec_partner_register_altmode(struct typec_partner *partner,
-                struct typec_altmode_desc *desc);
+                const struct typec_altmode_desc *desc);
  struct typec_altmode
  *typec_plug_register_altmode(struct typec_plug *plug,
-                 struct typec_altmode_desc *desc);
+                 const struct typec_altmode_desc *desc);
  struct typec_altmode
  *typec_port_register_altmode(struct typec_port *port,
-                 struct typec_altmode_desc *desc);
+                 const struct typec_altmode_desc *desc);
  void typec_unregister_altmode(struct typec_altmode *altmode);

  struct typec_port *typec_altmode2port(struct typec_altmode *alt);
-- 
2.1.4

[toc] | [next] | [standalone]


#1629802 — Re: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers

FromGuenter Roeck <groeck@google.com>
Date2017-04-24 19:20 +0200
SubjectRe: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers
Message-ID<tzPOx-1mD-5@gated-at.bofh.it>
In reply to#1629637
Hi Mats,

On Mon, Apr 24, 2017 at 7:24 AM, Mats Karrman <mats.dev.list@gmail.com> wrote:
> From 98ff2be4de83f4d4b5293bfa424c274b25400e1e Mon Sep 17 00:00:00 2001
> From: Mats Karrman <mats.dev.list@gmail.com>
> Date: Mon, 24 Apr 2017 15:21:39 +0200
> Subject: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc
> initializers
>
> ---
>  drivers/usb/typec/typec.c | 11 ++++++-----
>  include/linux/usb/typec.h |  6 +++---
>  2 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
> index 89e540b..db5ee73 100644
> --- a/drivers/usb/typec/typec.c
> +++ b/drivers/usb/typec/typec.c
> @@ -291,7 +291,7 @@ typec_altmode_roles_show(struct device *dev, struct
> device_attribute *attr,
>  }
>
>  static void typec_init_modes(struct typec_altmode *alt,
> -                 struct typec_mode_desc *desc, bool is_port)
> +                 const struct typec_mode_desc *desc, bool is_port)
>  {
>      int i;
>
> @@ -378,7 +378,8 @@ static const struct device_type typec_altmode_dev_type =
> {
>  };
>
>  static struct typec_altmode *
> -typec_register_altmode(struct device *parent, struct typec_altmode_desc
> *desc)
> +typec_register_altmode(struct device *parent,
> +               const struct typec_altmode_desc *desc)

Unfortunately, this patch is whitespace damaged.

Thanks,
Guenter

>  {
>      struct typec_altmode *alt;
>      int ret;
> @@ -495,7 +496,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
>   */
>  struct typec_altmode *
>  typec_partner_register_altmode(struct typec_partner *partner,
> -                   struct typec_altmode_desc *desc)
> +                   const struct typec_altmode_desc *desc)
>  {
>      return typec_register_altmode(&partner->dev, desc);
>  }
> @@ -590,7 +591,7 @@ static const struct device_type typec_plug_dev_type = {
>   */
>  struct typec_altmode *
>  typec_plug_register_altmode(struct typec_plug *plug,
> -                struct typec_altmode_desc *desc)
> +                const struct typec_altmode_desc *desc)
>  {
>      return typec_register_altmode(&plug->dev, desc);
>  }
> @@ -1159,7 +1160,7 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode);
>   */
>  struct typec_altmode *
>  typec_port_register_altmode(struct typec_port *port,
> -                struct typec_altmode_desc *desc)
> +                const struct typec_altmode_desc *desc)
>  {
>      return typec_register_altmode(&port->dev, desc);
>  }
> diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
> index ec78204..d1d2ebc 100644
> --- a/include/linux/usb/typec.h
> +++ b/include/linux/usb/typec.h
> @@ -117,13 +117,13 @@ struct typec_altmode_desc {
>
>  struct typec_altmode
>  *typec_partner_register_altmode(struct typec_partner *partner,
> -                struct typec_altmode_desc *desc);
> +                const struct typec_altmode_desc *desc);
>  struct typec_altmode
>  *typec_plug_register_altmode(struct typec_plug *plug,
> -                 struct typec_altmode_desc *desc);
> +                 const struct typec_altmode_desc *desc);
>  struct typec_altmode
>  *typec_port_register_altmode(struct typec_port *port,
> -                 struct typec_altmode_desc *desc);
> +                 const struct typec_altmode_desc *desc);
>  void typec_unregister_altmode(struct typec_altmode *altmode);
>
>  struct typec_port *typec_altmode2port(struct typec_altmode *alt);
> --
> 2.1.4
>

[toc] | [prev] | [next] | [standalone]


#1629874 — [PATCH v2] usb: typec: Don't prevent using constant typec_mode_desc initializers

FromMats Karrman <mats.dev.list@gmail.com>
Date2017-04-24 20:30 +0200
Subject[PATCH v2] usb: typec: Don't prevent using constant typec_mode_desc initializers
Message-ID<tzQUj-21B-23@gated-at.bofh.it>
In reply to#1629637
Signed-off-by: Mats Karrman <mats.dev.list@gmail.com>
---
v2:
- Fixed damaged white-space
- Added signed-off-by

  drivers/usb/typec/typec.c | 11 ++++++-----
  include/linux/usb/typec.h |  6 +++---
  2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
index 89e540b..db5ee73 100644
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -291,7 +291,7 @@ typec_altmode_roles_show(struct device *dev, struct device_attribute *attr,
  }
  
  static void typec_init_modes(struct typec_altmode *alt,
-			     struct typec_mode_desc *desc, bool is_port)
+			     const struct typec_mode_desc *desc, bool is_port)
  {
  	int i;
  
@@ -378,7 +378,8 @@ static const struct device_type typec_altmode_dev_type = {
  };
  
  static struct typec_altmode *
-typec_register_altmode(struct device *parent, struct typec_altmode_desc *desc)
+typec_register_altmode(struct device *parent,
+		       const struct typec_altmode_desc *desc)
  {
  	struct typec_altmode *alt;
  	int ret;
@@ -495,7 +496,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
   */
  struct typec_altmode *
  typec_partner_register_altmode(struct typec_partner *partner,
-			       struct typec_altmode_desc *desc)
+			       const struct typec_altmode_desc *desc)
  {
  	return typec_register_altmode(&partner->dev, desc);
  }
@@ -590,7 +591,7 @@ static const struct device_type typec_plug_dev_type = {
   */
  struct typec_altmode *
  typec_plug_register_altmode(struct typec_plug *plug,
-			    struct typec_altmode_desc *desc)
+			    const struct typec_altmode_desc *desc)
  {
  	return typec_register_altmode(&plug->dev, desc);
  }
@@ -1159,7 +1160,7 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode);
   */
  struct typec_altmode *
  typec_port_register_altmode(struct typec_port *port,
-			    struct typec_altmode_desc *desc)
+			    const struct typec_altmode_desc *desc)
  {
  	return typec_register_altmode(&port->dev, desc);
  }
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
index ec78204..d1d2ebc 100644
--- a/include/linux/usb/typec.h
+++ b/include/linux/usb/typec.h
@@ -117,13 +117,13 @@ struct typec_altmode_desc {
  
  struct typec_altmode
  *typec_partner_register_altmode(struct typec_partner *partner,
-				struct typec_altmode_desc *desc);
+				const struct typec_altmode_desc *desc);
  struct typec_altmode
  *typec_plug_register_altmode(struct typec_plug *plug,
-			     struct typec_altmode_desc *desc);
+			     const struct typec_altmode_desc *desc);
  struct typec_altmode
  *typec_port_register_altmode(struct typec_port *port,
-			     struct typec_altmode_desc *desc);
+			     const struct typec_altmode_desc *desc);
  void typec_unregister_altmode(struct typec_altmode *altmode);
  
  struct typec_port *typec_altmode2port(struct typec_altmode *alt);
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1629892 — [PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc initializers

FromMats Karrman <mats.dev.list@gmail.com>
Date2017-04-24 21:00 +0200
Subject[PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc initializers
Message-ID<tzRnk-2cE-11@gated-at.bofh.it>
In reply to#1629874
Signed-off-by: Mats Karrman <mats.dev.list@gmail.com>
---
v3:
- Fixed damaged white-space, finally?

v2:
- Fixed damaged white-space
- Added signed-off-by

 drivers/usb/typec/typec.c | 11 ++++++-----
 include/linux/usb/typec.h |  6 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
index 89e540b..db5ee73 100644
--- a/drivers/usb/typec/typec.c
+++ b/drivers/usb/typec/typec.c
@@ -291,7 +291,7 @@ typec_altmode_roles_show(struct device *dev, struct device_attribute *attr,
 }
 
 static void typec_init_modes(struct typec_altmode *alt,
-			     struct typec_mode_desc *desc, bool is_port)
+			     const struct typec_mode_desc *desc, bool is_port)
 {
 	int i;
 
@@ -378,7 +378,8 @@ static const struct device_type typec_altmode_dev_type = {
 };
 
 static struct typec_altmode *
-typec_register_altmode(struct device *parent, struct typec_altmode_desc *desc)
+typec_register_altmode(struct device *parent,
+		       const struct typec_altmode_desc *desc)
 {
 	struct typec_altmode *alt;
 	int ret;
@@ -495,7 +496,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
  */
 struct typec_altmode *
 typec_partner_register_altmode(struct typec_partner *partner,
-			       struct typec_altmode_desc *desc)
+			       const struct typec_altmode_desc *desc)
 {
 	return typec_register_altmode(&partner->dev, desc);
 }
@@ -590,7 +591,7 @@ static const struct device_type typec_plug_dev_type = {
  */
 struct typec_altmode *
 typec_plug_register_altmode(struct typec_plug *plug,
-			    struct typec_altmode_desc *desc)
+			    const struct typec_altmode_desc *desc)
 {
 	return typec_register_altmode(&plug->dev, desc);
 }
@@ -1159,7 +1160,7 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode);
  */
 struct typec_altmode *
 typec_port_register_altmode(struct typec_port *port,
-			    struct typec_altmode_desc *desc)
+			    const struct typec_altmode_desc *desc)
 {
 	return typec_register_altmode(&port->dev, desc);
 }
diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
index ec78204..d1d2ebc 100644
--- a/include/linux/usb/typec.h
+++ b/include/linux/usb/typec.h
@@ -117,13 +117,13 @@ struct typec_altmode_desc {
 
 struct typec_altmode
 *typec_partner_register_altmode(struct typec_partner *partner,
-				struct typec_altmode_desc *desc);
+				const struct typec_altmode_desc *desc);
 struct typec_altmode
 *typec_plug_register_altmode(struct typec_plug *plug,
-			     struct typec_altmode_desc *desc);
+			     const struct typec_altmode_desc *desc);
 struct typec_altmode
 *typec_port_register_altmode(struct typec_port *port,
-			     struct typec_altmode_desc *desc);
+			     const struct typec_altmode_desc *desc);
 void typec_unregister_altmode(struct typec_altmode *altmode);
 
 struct typec_port *typec_altmode2port(struct typec_altmode *alt);
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1630190 — Re: [PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc initializers

FromGuenter Roeck <groeck@google.com>
Date2017-04-25 07:30 +0200
SubjectRe: [PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc initializers
Message-ID<tA1cZ-m3-1@gated-at.bofh.it>
In reply to#1629892
On Mon, Apr 24, 2017 at 11:52 AM, Mats Karrman <mats.dev.list@gmail.com> wrote:
> Signed-off-by: Mats Karrman <mats.dev.list@gmail.com>
> ---
> v3:
> - Fixed damaged white-space, finally?
>

Yes, this one finally applied. Some description in addition to the
subject line might be nice. Other than that,

Reviewed-by: Guenter Roeck <groeck@chromium.org>

Guenter

> v2:
> - Fixed damaged white-space
> - Added signed-off-by
>
>  drivers/usb/typec/typec.c | 11 ++++++-----
>  include/linux/usb/typec.h |  6 +++---
>  2 files changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/usb/typec/typec.c b/drivers/usb/typec/typec.c
> index 89e540b..db5ee73 100644
> --- a/drivers/usb/typec/typec.c
> +++ b/drivers/usb/typec/typec.c
> @@ -291,7 +291,7 @@ typec_altmode_roles_show(struct device *dev, struct device_attribute *attr,
>  }
>
>  static void typec_init_modes(struct typec_altmode *alt,
> -                            struct typec_mode_desc *desc, bool is_port)
> +                            const struct typec_mode_desc *desc, bool is_port)
>  {
>         int i;
>
> @@ -378,7 +378,8 @@ static const struct device_type typec_altmode_dev_type = {
>  };
>
>  static struct typec_altmode *
> -typec_register_altmode(struct device *parent, struct typec_altmode_desc *desc)
> +typec_register_altmode(struct device *parent,
> +                      const struct typec_altmode_desc *desc)
>  {
>         struct typec_altmode *alt;
>         int ret;
> @@ -495,7 +496,7 @@ EXPORT_SYMBOL_GPL(typec_partner_set_identity);
>   */
>  struct typec_altmode *
>  typec_partner_register_altmode(struct typec_partner *partner,
> -                              struct typec_altmode_desc *desc)
> +                              const struct typec_altmode_desc *desc)
>  {
>         return typec_register_altmode(&partner->dev, desc);
>  }
> @@ -590,7 +591,7 @@ static const struct device_type typec_plug_dev_type = {
>   */
>  struct typec_altmode *
>  typec_plug_register_altmode(struct typec_plug *plug,
> -                           struct typec_altmode_desc *desc)
> +                           const struct typec_altmode_desc *desc)
>  {
>         return typec_register_altmode(&plug->dev, desc);
>  }
> @@ -1159,7 +1160,7 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode);
>   */
>  struct typec_altmode *
>  typec_port_register_altmode(struct typec_port *port,
> -                           struct typec_altmode_desc *desc)
> +                           const struct typec_altmode_desc *desc)
>  {
>         return typec_register_altmode(&port->dev, desc);
>  }
> diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
> index ec78204..d1d2ebc 100644
> --- a/include/linux/usb/typec.h
> +++ b/include/linux/usb/typec.h
> @@ -117,13 +117,13 @@ struct typec_altmode_desc {
>
>  struct typec_altmode
>  *typec_partner_register_altmode(struct typec_partner *partner,
> -                               struct typec_altmode_desc *desc);
> +                               const struct typec_altmode_desc *desc);
>  struct typec_altmode
>  *typec_plug_register_altmode(struct typec_plug *plug,
> -                            struct typec_altmode_desc *desc);
> +                            const struct typec_altmode_desc *desc);
>  struct typec_altmode
>  *typec_port_register_altmode(struct typec_port *port,
> -                            struct typec_altmode_desc *desc);
> +                            const struct typec_altmode_desc *desc);
>  void typec_unregister_altmode(struct typec_altmode *altmode);
>
>  struct typec_port *typec_altmode2port(struct typec_altmode *alt);
> --
> 2.1.4
>

[toc] | [prev] | [next] | [standalone]


#1630850 — Re: [PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc initializers

FromGreg KH <greg@kroah.com>
Date2017-04-25 20:20 +0200
SubjectRe: [PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc initializers
Message-ID<tAdea-88w-5@gated-at.bofh.it>
In reply to#1629892
On Mon, Apr 24, 2017 at 08:52:31PM +0200, Mats Karrman wrote:
> Signed-off-by: Mats Karrman <mats.dev.list@gmail.com>

I can not take patches without any changelog text at all.

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1630290 — Re: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers

FromFelipe Balbi <felipe.balbi@linux.intel.com>
Date2017-04-25 10:30 +0200
SubjectRe: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers
Message-ID<tA41c-2cn-11@gated-at.bofh.it>
In reply to#1629637

[Multipart message — attachments visible in raw view] — view raw

Hi,

Mats Karrman <mats.dev.list@gmail.com> writes:

>  From 98ff2be4de83f4d4b5293bfa424c274b25400e1e Mon Sep 17 00:00:00 2001
> From: Mats Karrman <mats.dev.list@gmail.com>
> Date: Mon, 24 Apr 2017 15:21:39 +0200
> Subject: [PATCH] usb: typec: Don't prevent using constant 
> typec_mode_desc initializers
>

Unfortunately this is not how you send a proper patch :-) Have a read at
Documentation/process/submitting-patches.rst and many questions will be
answered.

-- 
balbi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web