All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reset: sunxi: Make reset_control_ops const
@ 2016-02-08 13:29 Philipp Zabel
  2016-02-08 14:50 ` kbuild test robot
  2016-02-08 15:59 ` Maxime Ripard
  0 siblings, 2 replies; 3+ messages in thread
From: Philipp Zabel @ 2016-02-08 13:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Maxime Ripard, Philipp Zabel

The sunxi_reset_ops structure is never modified. Make it const.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/reset/reset-sunxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c
index 8d41a18..677f865 100644
--- a/drivers/reset/reset-sunxi.c
+++ b/drivers/reset/reset-sunxi.c
@@ -70,7 +70,7 @@ static int sunxi_reset_deassert(struct reset_controller_dev *rcdev,
 	return 0;
 }
 
-static struct reset_control_ops sunxi_reset_ops = {
+static const struct reset_control_ops sunxi_reset_ops = {
 	.assert		= sunxi_reset_assert,
 	.deassert	= sunxi_reset_deassert,
 };
-- 
2.7.0.rc3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] reset: sunxi: Make reset_control_ops const
  2016-02-08 13:29 [PATCH] reset: sunxi: Make reset_control_ops const Philipp Zabel
@ 2016-02-08 14:50 ` kbuild test robot
  2016-02-08 15:59 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2016-02-08 14:50 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: kbuild-all, linux-kernel, Maxime Ripard, Philipp Zabel

[-- Attachment #1: Type: text/plain, Size: 3268 bytes --]

Hi Philipp,

[auto build test WARNING on mripard/sunxi/for-next]
[also build test WARNING on v4.5-rc3 next-20160208]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Philipp-Zabel/reset-sunxi-Make-reset_control_ops-const/20160208-213419
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git sunxi/for-next
config: arm-sunxi_defconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All warnings (new ones prefixed by >>):

   drivers/reset/reset-sunxi.c: In function 'sunxi_reset_init':
>> drivers/reset/reset-sunxi.c:109:18: warning: assignment discards 'const' qualifier from pointer target type
     data->rcdev.ops = &sunxi_reset_ops;
                     ^
   drivers/reset/reset-sunxi.c: In function 'sunxi_reset_probe':
   drivers/reset/reset-sunxi.c:165:18: warning: assignment discards 'const' qualifier from pointer target type
     data->rcdev.ops = &sunxi_reset_ops;
                     ^

vim +/const +109 drivers/reset/reset-sunxi.c

8f1ae77f Maxime Ripard   2013-09-24   93  	size = resource_size(&res);
8f1ae77f Maxime Ripard   2013-09-24   94  	if (!request_mem_region(res.start, size, np->name)) {
8f1ae77f Maxime Ripard   2013-09-24   95  		ret = -EBUSY;
8f1ae77f Maxime Ripard   2013-09-24   96  		goto err_alloc;
8f1ae77f Maxime Ripard   2013-09-24   97  	}
8f1ae77f Maxime Ripard   2013-09-24   98  
8f1ae77f Maxime Ripard   2013-09-24   99  	data->membase = ioremap(res.start, size);
8f1ae77f Maxime Ripard   2013-09-24  100  	if (!data->membase) {
8f1ae77f Maxime Ripard   2013-09-24  101  		ret = -ENOMEM;
8f1ae77f Maxime Ripard   2013-09-24  102  		goto err_alloc;
8f1ae77f Maxime Ripard   2013-09-24  103  	}
8f1ae77f Maxime Ripard   2013-09-24  104  
41544f9f Tyler Baker     2015-01-12  105  	spin_lock_init(&data->lock);
41544f9f Tyler Baker     2015-01-12  106  
8f1ae77f Maxime Ripard   2013-09-24  107  	data->rcdev.owner = THIS_MODULE;
8f1ae77f Maxime Ripard   2013-09-24  108  	data->rcdev.nr_resets = size * 32;
8f1ae77f Maxime Ripard   2013-09-24 @109  	data->rcdev.ops = &sunxi_reset_ops;
8f1ae77f Maxime Ripard   2013-09-24  110  	data->rcdev.of_node = np;
8f1ae77f Maxime Ripard   2013-09-24  111  
d1f15aa0 Masahiro Yamada 2015-11-05  112  	return reset_controller_register(&data->rcdev);
8f1ae77f Maxime Ripard   2013-09-24  113  
8f1ae77f Maxime Ripard   2013-09-24  114  err_alloc:
8f1ae77f Maxime Ripard   2013-09-24  115  	kfree(data);
8f1ae77f Maxime Ripard   2013-09-24  116  	return ret;
8f1ae77f Maxime Ripard   2013-09-24  117  };

:::::: The code at line 109 was first introduced by commit
:::::: 8f1ae77f466660b6da2455cccecc07ae631fa66d reset: Add Allwinner SoCs Reset Controller Driver

:::::: TO: Maxime Ripard <maxime.ripard@free-electrons.com>
:::::: CC: Maxime Ripard <maxime.ripard@free-electrons.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 17450 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] reset: sunxi: Make reset_control_ops const
  2016-02-08 13:29 [PATCH] reset: sunxi: Make reset_control_ops const Philipp Zabel
  2016-02-08 14:50 ` kbuild test robot
@ 2016-02-08 15:59 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2016-02-08 15:59 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

Hi Philipp,

On Mon, Feb 08, 2016 at 02:29:01PM +0100, Philipp Zabel wrote:
> The sunxi_reset_ops structure is never modified. Make it const.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/reset/reset-sunxi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c
> index 8d41a18..677f865 100644
> --- a/drivers/reset/reset-sunxi.c
> +++ b/drivers/reset/reset-sunxi.c
> @@ -70,7 +70,7 @@ static int sunxi_reset_deassert(struct reset_controller_dev *rcdev,
>  	return 0;
>  }
>  
> -static struct reset_control_ops sunxi_reset_ops = {
> +static const struct reset_control_ops sunxi_reset_ops = {
>  	.assert		= sunxi_reset_assert,
>  	.deassert	= sunxi_reset_deassert,
>  };

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-08 16:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 13:29 [PATCH] reset: sunxi: Make reset_control_ops const Philipp Zabel
2016-02-08 14:50 ` kbuild test robot
2016-02-08 15:59 ` Maxime Ripard

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.