You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/11/08 10:06:31 UTC

[GitHub] andrzej-kaczmarek closed pull request #1495: kernel/os: Add missing const to parameters in os_dev

andrzej-kaczmarek closed pull request #1495: kernel/os: Add missing const to parameters in os_dev
URL: https://github.com/apache/mynewt-core/pull/1495
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/kernel/os/include/os/os_dev.h b/kernel/os/include/os/os_dev.h
index c05f6f251f..4986904739 100644
--- a/kernel/os/include/os/os_dev.h
+++ b/kernel/os/include/os/os_dev.h
@@ -138,7 +138,7 @@ struct os_dev {
     /** Device flags.  */
     uint8_t od_flags;
     /** Device name */
-    char *od_name;
+    const char *od_name;
     STAILQ_ENTRY(os_dev) od_next;
 };
 
@@ -182,7 +182,7 @@ int os_dev_resume(struct os_dev *dev);
  *
  * @return 0 on success, non-zero on failure.
  */
-int os_dev_create(struct os_dev *dev, char *name, uint8_t stage,
+int os_dev_create(struct os_dev *dev, const char *name, uint8_t stage,
         uint8_t priority, os_dev_init_func_t od_init, void *arg);
 
 /**
@@ -195,7 +195,7 @@ int os_dev_create(struct os_dev *dev, char *name, uint8_t stage,
  *
  * @return A pointer to the device corresponding to name, or NULL if not found.
  */
-struct os_dev *os_dev_lookup(char *name);
+struct os_dev *os_dev_lookup(const char *name);
 
 /**
  * Initialize all devices for a given state.
@@ -234,7 +234,7 @@ int os_dev_resume_all(void);
  *
  * @return 0 on success, non-zero on failure.
  */
-struct os_dev *os_dev_open(char *devname, uint32_t timo, void *arg);
+struct os_dev *os_dev_open(const char *devname, uint32_t timo, void *arg);
 
 /**
  * Close a device.
diff --git a/kernel/os/src/os_dev.c b/kernel/os/src/os_dev.c
index 9c10ed160f..24746927ff 100644
--- a/kernel/os/src/os_dev.c
+++ b/kernel/os/src/os_dev.c
@@ -23,7 +23,7 @@
 static STAILQ_HEAD(, os_dev) g_os_dev_list;
 
 static int
-os_dev_init(struct os_dev *dev, char *name, uint8_t stage,
+os_dev_init(struct os_dev *dev, const char *name, uint8_t stage,
         uint8_t priority, os_dev_init_func_t od_init, void *arg)
 {
     dev->od_name = name;
@@ -108,7 +108,7 @@ os_dev_initialize(struct os_dev *dev)
 }
 
 int
-os_dev_create(struct os_dev *dev, char *name, uint8_t stage,
+os_dev_create(struct os_dev *dev, const char *name, uint8_t stage,
         uint8_t priority, os_dev_init_func_t od_init, void *arg)
 {
     int rc;
@@ -185,7 +185,7 @@ os_dev_resume_all(void)
 }
 
 struct os_dev *
-os_dev_lookup(char *name)
+os_dev_lookup(const char *name)
 {
     struct os_dev *dev;
 
@@ -199,7 +199,7 @@ os_dev_lookup(char *name)
 }
 
 struct os_dev *
-os_dev_open(char *devname, uint32_t timo, void *arg)
+os_dev_open(const char *devname, uint32_t timo, void *arg)
 {
     struct os_dev *dev;
     os_sr_t sr;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services