From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752914AbdEDAlT (ORCPT ); Wed, 3 May 2017 20:41:19 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:36204 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbdEDAlL (ORCPT ); Wed, 3 May 2017 20:41:11 -0400 Date: Thu, 4 May 2017 08:40:59 +0800 From: Leo Yan To: Mathieu Poirier Cc: Suzuki K Poulose , Stephen Boyd , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] coresight: use const for device_node structures Message-ID: <20170504004058.GE17974@leoy-ThinkPad-T440> References: <1493712903-16726-1-git-send-email-leo.yan@linaro.org> <20170503202136.GA7860@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170503202136.GA7860@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Signed-off-by: Leo Yan > > --- > > 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