diff mbox series

[v5,04/11] hw/usb: fix const-ness for string params in MTP driver

Message ID 20181009130442.26296-5-berrange@redhat.com (mailing list archive)
State New, archived
Headers show
Series Add a standard authorization framework | expand

Commit Message

Daniel P. Berrangé Oct. 9, 2018, 1:04 p.m. UTC
Various functions accepting 'char *' string parameters were missing
'const' qualifiers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 hw/usb/dev-mtp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Philippe Mathieu-Daudé Oct. 10, 2018, 3:12 p.m. UTC | #1
On 09/10/2018 15:04, Daniel P. Berrangé wrote:
> Various functions accepting 'char *' string parameters were missing
> 'const' qualifiers.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  hw/usb/dev-mtp.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
> index f026419e47..ccbe25820b 100644
> --- a/hw/usb/dev-mtp.c
> +++ b/hw/usb/dev-mtp.c
> @@ -372,7 +372,7 @@ static const USBDesc desc = {
>  /* ----------------------------------------------------------------------- */
>  
>  static MTPObject *usb_mtp_object_alloc(MTPState *s, uint32_t handle,
> -                                       MTPObject *parent, char *name)
> +                                       MTPObject *parent, const char *name)
>  {
>      MTPObject *o = g_new0(MTPObject, 1);
>  
> @@ -454,7 +454,7 @@ static MTPObject *usb_mtp_object_lookup(MTPState *s, uint32_t handle)
>  }
>  
>  static MTPObject *usb_mtp_add_child(MTPState *s, MTPObject *o,
> -                                    char *name)
> +                                    const char *name)
>  {
>      MTPObject *child =
>          usb_mtp_object_alloc(s, s->next_handle++, o, name);
> @@ -473,7 +473,7 @@ static MTPObject *usb_mtp_add_child(MTPState *s, MTPObject *o,
>  }
>  
>  static MTPObject *usb_mtp_object_lookup_name(MTPObject *parent,
> -                                             char *name, int len)
> +                                             const char *name, int len)
>  {
>      MTPObject *iter;
>  
> @@ -640,7 +640,7 @@ static void usb_mtp_inotify_cleanup(MTPState *s)
>      }
>  }
>  
> -static int usb_mtp_add_watch(int inotifyfd, char *path)
> +static int usb_mtp_add_watch(int inotifyfd, const char *path)
>  {
>      uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY;
>  
>
diff mbox series

Patch

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index f026419e47..ccbe25820b 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -372,7 +372,7 @@  static const USBDesc desc = {
 /* ----------------------------------------------------------------------- */
 
 static MTPObject *usb_mtp_object_alloc(MTPState *s, uint32_t handle,
-                                       MTPObject *parent, char *name)
+                                       MTPObject *parent, const char *name)
 {
     MTPObject *o = g_new0(MTPObject, 1);
 
@@ -454,7 +454,7 @@  static MTPObject *usb_mtp_object_lookup(MTPState *s, uint32_t handle)
 }
 
 static MTPObject *usb_mtp_add_child(MTPState *s, MTPObject *o,
-                                    char *name)
+                                    const char *name)
 {
     MTPObject *child =
         usb_mtp_object_alloc(s, s->next_handle++, o, name);
@@ -473,7 +473,7 @@  static MTPObject *usb_mtp_add_child(MTPState *s, MTPObject *o,
 }
 
 static MTPObject *usb_mtp_object_lookup_name(MTPObject *parent,
-                                             char *name, int len)
+                                             const char *name, int len)
 {
     MTPObject *iter;
 
@@ -640,7 +640,7 @@  static void usb_mtp_inotify_cleanup(MTPState *s)
     }
 }
 
-static int usb_mtp_add_watch(int inotifyfd, char *path)
+static int usb_mtp_add_watch(int inotifyfd, const char *path)
 {
     uint32_t mask = IN_CREATE | IN_DELETE | IN_MODIFY;