* [PATCH] coresight: use const for device_node structures
@ 2017-05-02 8:15 ` Leo Yan
0 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-05-02 8:15 UTC (permalink / raw)
To: Mathieu Poirier, Leo Yan, Suzuki K Poulose, Stephen Boyd,
Greg Kroah-Hartman, linux-arm-kernel, linux-kernel
Almost low level functions from open firmware have used const to
qualify device_node structures, so add const for device_node
parameters in of_coresight related functions.
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
drivers/hwtracing/coresight/of_coresight.c | 4 ++--
include/linux/coresight.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
index 629e031..859ad49 100644
--- a/drivers/hwtracing/coresight/of_coresight.c
+++ b/drivers/hwtracing/coresight/of_coresight.c
@@ -52,7 +52,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
endpoint, of_dev_node_match);
}
-static void of_coresight_get_ports(struct device_node *node,
+static void of_coresight_get_ports(const struct device_node *node,
int *nr_inport, int *nr_outport)
{
struct device_node *ep = NULL;
@@ -102,7 +102,7 @@ static int of_coresight_alloc_memory(struct device *dev,
}
struct coresight_platform_data *of_get_coresight_platform_data(
- struct device *dev, struct device_node *node)
+ struct device *dev, const struct device_node *node)
{
int i = 0, ret = 0, cpu;
struct coresight_platform_data *pdata;
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index 2a5982c..769f2c8 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -264,10 +264,10 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset,
#ifdef CONFIG_OF
extern struct coresight_platform_data *of_get_coresight_platform_data(
- struct device *dev, struct device_node *node);
+ struct device *dev, const struct device_node *node);
#else
static inline struct coresight_platform_data *of_get_coresight_platform_data(
- struct device *dev, struct device_node *node) { return NULL; }
+ struct device *dev, const struct device_node *node) { return NULL; }
#endif
#ifdef CONFIG_PID_NS
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] coresight: use const for device_node structures
@ 2017-05-02 8:15 ` Leo Yan
0 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-05-02 8:15 UTC (permalink / raw)
To: linux-arm-kernel
Almost low level functions from open firmware have used const to
qualify device_node structures, so add const for device_node
parameters in of_coresight related functions.
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
drivers/hwtracing/coresight/of_coresight.c | 4 ++--
include/linux/coresight.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
index 629e031..859ad49 100644
--- a/drivers/hwtracing/coresight/of_coresight.c
+++ b/drivers/hwtracing/coresight/of_coresight.c
@@ -52,7 +52,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
endpoint, of_dev_node_match);
}
-static void of_coresight_get_ports(struct device_node *node,
+static void of_coresight_get_ports(const struct device_node *node,
int *nr_inport, int *nr_outport)
{
struct device_node *ep = NULL;
@@ -102,7 +102,7 @@ static int of_coresight_alloc_memory(struct device *dev,
}
struct coresight_platform_data *of_get_coresight_platform_data(
- struct device *dev, struct device_node *node)
+ struct device *dev, const struct device_node *node)
{
int i = 0, ret = 0, cpu;
struct coresight_platform_data *pdata;
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index 2a5982c..769f2c8 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -264,10 +264,10 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset,
#ifdef CONFIG_OF
extern struct coresight_platform_data *of_get_coresight_platform_data(
- struct device *dev, struct device_node *node);
+ struct device *dev, const struct device_node *node);
#else
static inline struct coresight_platform_data *of_get_coresight_platform_data(
- struct device *dev, struct device_node *node) { return NULL; }
+ struct device *dev, const struct device_node *node) { return NULL; }
#endif
#ifdef CONFIG_PID_NS
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] coresight: use const for device_node structures
2017-05-02 8:15 ` Leo Yan
@ 2017-05-03 20:21 ` Mathieu Poirier
-1 siblings, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2017-05-03 20:21 UTC (permalink / raw)
To: Leo Yan
Cc: Suzuki K Poulose, Stephen Boyd, Greg Kroah-Hartman,
linux-arm-kernel, linux-kernel
Hi Leo,
On Tue, May 02, 2017 at 04:15:03PM +0800, Leo Yan wrote:
> Almost low level functions from open firmware have used const to
> qualify device_node structures, so add const for device_node
> parameters in of_coresight related functions.
>
> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> drivers/hwtracing/coresight/of_coresight.c | 4 ++--
> include/linux/coresight.h | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
> index 629e031..859ad49 100644
> --- a/drivers/hwtracing/coresight/of_coresight.c
> +++ b/drivers/hwtracing/coresight/of_coresight.c
> @@ -52,7 +52,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
> endpoint, of_dev_node_match);
> }
>
> -static void of_coresight_get_ports(struct device_node *node,
> +static void of_coresight_get_ports(const struct device_node *node,
> int *nr_inport, int *nr_outport)
> {
> struct device_node *ep = NULL;
> @@ -102,7 +102,7 @@ static int of_coresight_alloc_memory(struct device *dev,
> }
>
> struct coresight_platform_data *of_get_coresight_platform_data(
> - struct device *dev, struct device_node *node)
> + struct device *dev, const struct device_node *node)
The original code didn't do things right. I suggest:
struct coresight_platform_data *
of_get_coresight_platform_data(struct device *dev,
const struct device_node *node)
> {
> int i = 0, ret = 0, cpu;
> struct coresight_platform_data *pdata;
> diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> index 2a5982c..769f2c8 100644
> --- a/include/linux/coresight.h
> +++ b/include/linux/coresight.h
> @@ -264,10 +264,10 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset,
>
> #ifdef CONFIG_OF
> extern struct coresight_platform_data *of_get_coresight_platform_data(
> - struct device *dev, struct device_node *node);
> + struct device *dev, const struct device_node *node);
Same as above.
Please send me another revision and I'll pick this up for the next cycle.
Thanks,
Mathieu
> #else
> static inline struct coresight_platform_data *of_get_coresight_platform_data(
> - struct device *dev, struct device_node *node) { return NULL; }
> + struct device *dev, const struct device_node *node) { return NULL; }
> #endif
>
> #ifdef CONFIG_PID_NS
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] coresight: use const for device_node structures
@ 2017-05-03 20:21 ` Mathieu Poirier
0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Poirier @ 2017-05-03 20:21 UTC (permalink / raw)
To: linux-arm-kernel
Hi Leo,
On Tue, May 02, 2017 at 04:15:03PM +0800, Leo Yan wrote:
> Almost low level functions from open firmware have used const to
> qualify device_node structures, so add const for device_node
> parameters in of_coresight related functions.
>
> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> drivers/hwtracing/coresight/of_coresight.c | 4 ++--
> include/linux/coresight.h | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
> index 629e031..859ad49 100644
> --- a/drivers/hwtracing/coresight/of_coresight.c
> +++ b/drivers/hwtracing/coresight/of_coresight.c
> @@ -52,7 +52,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
> endpoint, of_dev_node_match);
> }
>
> -static void of_coresight_get_ports(struct device_node *node,
> +static void of_coresight_get_ports(const struct device_node *node,
> int *nr_inport, int *nr_outport)
> {
> struct device_node *ep = NULL;
> @@ -102,7 +102,7 @@ static int of_coresight_alloc_memory(struct device *dev,
> }
>
> struct coresight_platform_data *of_get_coresight_platform_data(
> - struct device *dev, struct device_node *node)
> + struct device *dev, const struct device_node *node)
The original code didn't do things right. I suggest:
struct coresight_platform_data *
of_get_coresight_platform_data(struct device *dev,
const struct device_node *node)
> {
> int i = 0, ret = 0, cpu;
> struct coresight_platform_data *pdata;
> diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> index 2a5982c..769f2c8 100644
> --- a/include/linux/coresight.h
> +++ b/include/linux/coresight.h
> @@ -264,10 +264,10 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset,
>
> #ifdef CONFIG_OF
> extern struct coresight_platform_data *of_get_coresight_platform_data(
> - struct device *dev, struct device_node *node);
> + struct device *dev, const struct device_node *node);
Same as above.
Please send me another revision and I'll pick this up for the next cycle.
Thanks,
Mathieu
> #else
> static inline struct coresight_platform_data *of_get_coresight_platform_data(
> - struct device *dev, struct device_node *node) { return NULL; }
> + struct device *dev, const struct device_node *node) { return NULL; }
> #endif
>
> #ifdef CONFIG_PID_NS
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] coresight: use const for device_node structures
2017-05-03 20:21 ` Mathieu Poirier
@ 2017-05-04 0:40 ` Leo Yan
-1 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-05-04 0:40 UTC (permalink / raw)
To: Mathieu Poirier
Cc: Suzuki K Poulose, Stephen Boyd, Greg Kroah-Hartman,
linux-arm-kernel, linux-kernel
On Wed, May 03, 2017 at 02:21:36PM -0600, Mathieu Poirier wrote:
> Hi Leo,
>
> On Tue, May 02, 2017 at 04:15:03PM +0800, Leo Yan wrote:
> > Almost low level functions from open firmware have used const to
> > qualify device_node structures, so add const for device_node
> > parameters in of_coresight related functions.
> >
> > Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> > drivers/hwtracing/coresight/of_coresight.c | 4 ++--
> > include/linux/coresight.h | 4 ++--
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
> > index 629e031..859ad49 100644
> > --- a/drivers/hwtracing/coresight/of_coresight.c
> > +++ b/drivers/hwtracing/coresight/of_coresight.c
> > @@ -52,7 +52,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
> > endpoint, of_dev_node_match);
> > }
> >
> > -static void of_coresight_get_ports(struct device_node *node,
> > +static void of_coresight_get_ports(const struct device_node *node,
> > int *nr_inport, int *nr_outport)
> > {
> > struct device_node *ep = NULL;
> > @@ -102,7 +102,7 @@ static int of_coresight_alloc_memory(struct device *dev,
> > }
> >
> > struct coresight_platform_data *of_get_coresight_platform_data(
> > - struct device *dev, struct device_node *node)
> > + struct device *dev, const struct device_node *node)
>
> The original code didn't do things right. I suggest:
>
> struct coresight_platform_data *
> of_get_coresight_platform_data(struct device *dev,
> const struct device_node *node)
>
>
> > {
> > int i = 0, ret = 0, cpu;
> > struct coresight_platform_data *pdata;
> > diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> > index 2a5982c..769f2c8 100644
> > --- a/include/linux/coresight.h
> > +++ b/include/linux/coresight.h
> > @@ -264,10 +264,10 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset,
> >
> > #ifdef CONFIG_OF
> > extern struct coresight_platform_data *of_get_coresight_platform_data(
> > - struct device *dev, struct device_node *node);
> > + struct device *dev, const struct device_node *node);
>
> Same as above.
>
> Please send me another revision and I'll pick this up for the next cycle.
Sure, have sent out.
Thanks,
Leo Yan
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] coresight: use const for device_node structures
@ 2017-05-04 0:40 ` Leo Yan
0 siblings, 0 replies; 6+ messages in thread
From: Leo Yan @ 2017-05-04 0:40 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, May 03, 2017 at 02:21:36PM -0600, Mathieu Poirier wrote:
> Hi Leo,
>
> On Tue, May 02, 2017 at 04:15:03PM +0800, Leo Yan wrote:
> > Almost low level functions from open firmware have used const to
> > qualify device_node structures, so add const for device_node
> > parameters in of_coresight related functions.
> >
> > Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > ---
> > drivers/hwtracing/coresight/of_coresight.c | 4 ++--
> > include/linux/coresight.h | 4 ++--
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c
> > index 629e031..859ad49 100644
> > --- a/drivers/hwtracing/coresight/of_coresight.c
> > +++ b/drivers/hwtracing/coresight/of_coresight.c
> > @@ -52,7 +52,7 @@ of_coresight_get_endpoint_device(struct device_node *endpoint)
> > endpoint, of_dev_node_match);
> > }
> >
> > -static void of_coresight_get_ports(struct device_node *node,
> > +static void of_coresight_get_ports(const struct device_node *node,
> > int *nr_inport, int *nr_outport)
> > {
> > struct device_node *ep = NULL;
> > @@ -102,7 +102,7 @@ static int of_coresight_alloc_memory(struct device *dev,
> > }
> >
> > struct coresight_platform_data *of_get_coresight_platform_data(
> > - struct device *dev, struct device_node *node)
> > + struct device *dev, const struct device_node *node)
>
> The original code didn't do things right. I suggest:
>
> struct coresight_platform_data *
> of_get_coresight_platform_data(struct device *dev,
> const struct device_node *node)
>
>
> > {
> > int i = 0, ret = 0, cpu;
> > struct coresight_platform_data *pdata;
> > diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> > index 2a5982c..769f2c8 100644
> > --- a/include/linux/coresight.h
> > +++ b/include/linux/coresight.h
> > @@ -264,10 +264,10 @@ static inline int coresight_timeout(void __iomem *addr, u32 offset,
> >
> > #ifdef CONFIG_OF
> > extern struct coresight_platform_data *of_get_coresight_platform_data(
> > - struct device *dev, struct device_node *node);
> > + struct device *dev, const struct device_node *node);
>
> Same as above.
>
> Please send me another revision and I'll pick this up for the next cycle.
Sure, have sent out.
Thanks,
Leo Yan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-05-04 0:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02 8:15 [PATCH] coresight: use const for device_node structures Leo Yan
2017-05-02 8:15 ` Leo Yan
2017-05-03 20:21 ` Mathieu Poirier
2017-05-03 20:21 ` Mathieu Poirier
2017-05-04 0:40 ` Leo Yan
2017-05-04 0:40 ` Leo Yan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.