Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1329035 > unrolled thread

[PATCH] reset: lpc18xx: Make reset_control_ops const

Started byPhilipp Zabel <p.zabel@pengutronix.de>
First post2016-02-08 14:30 +0100
Last post2016-02-08 21:30 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] reset: lpc18xx: Make reset_control_ops const Philipp Zabel <p.zabel@pengutronix.de> - 2016-02-08 14:30 +0100
    Re: [PATCH] reset: lpc18xx: Make reset_control_ops const Joachim Eastwood <manabian@gmail.com> - 2016-02-08 17:20 +0100
    Re: [PATCH] reset: lpc18xx: Make reset_control_ops const kbuild test robot <lkp@intel.com> - 2016-02-08 21:30 +0100

#1329035 — [PATCH] reset: lpc18xx: Make reset_control_ops const

FromPhilipp Zabel <p.zabel@pengutronix.de>
Date2016-02-08 14:30 +0100
Subject[PATCH] reset: lpc18xx: Make reset_control_ops const
Message-ID<qZU39-5Ph-33@gated-at.bofh.it>
The lpc18xx_rgu_ops structure is never modified. Make it const.

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

diff --git a/drivers/reset/reset-lpc18xx.c b/drivers/reset/reset-lpc18xx.c
index 70922e9..3b8a4f5 100644
--- a/drivers/reset/reset-lpc18xx.c
+++ b/drivers/reset/reset-lpc18xx.c
@@ -136,7 +136,7 @@ static int lpc18xx_rgu_status(struct reset_controller_dev *rcdev,
 	return !(readl(rc->base + offset) & bit);
 }
 
-static struct reset_control_ops lpc18xx_rgu_ops = {
+static const struct reset_control_ops lpc18xx_rgu_ops = {
 	.reset		= lpc18xx_rgu_reset,
 	.assert		= lpc18xx_rgu_assert,
 	.deassert	= lpc18xx_rgu_deassert,
-- 
2.7.0.rc3

[toc] | [next] | [standalone]


#1329252

FromJoachim Eastwood <manabian@gmail.com>
Date2016-02-08 17:20 +0100
Message-ID<qZWHD-7Fq-5@gated-at.bofh.it>
In reply to#1329035
Hi Philipp,

On 8 February 2016 at 14:28, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> The lpc18xx_rgu_ops structure is never modified. Make it const.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/reset/reset-lpc18xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/reset/reset-lpc18xx.c b/drivers/reset/reset-lpc18xx.c
> index 70922e9..3b8a4f5 100644
> --- a/drivers/reset/reset-lpc18xx.c
> +++ b/drivers/reset/reset-lpc18xx.c
> @@ -136,7 +136,7 @@ static int lpc18xx_rgu_status(struct reset_controller_dev *rcdev,
>         return !(readl(rc->base + offset) & bit);
>  }
>
> -static struct reset_control_ops lpc18xx_rgu_ops = {
> +static const struct reset_control_ops lpc18xx_rgu_ops = {
>         .reset          = lpc18xx_rgu_reset,
>         .assert         = lpc18xx_rgu_assert,
>         .deassert       = lpc18xx_rgu_deassert,

Acked-by: Joachim Eastwood <manabian@gmail.com>


regards,
Joachim Eastwood

[toc] | [prev] | [next] | [standalone]


#1329530

Fromkbuild test robot <lkp@intel.com>
Date2016-02-08 21:30 +0100
Message-ID<r00BA-1PS-3@gated-at.bofh.it>
In reply to#1329035

[Multipart message — attachments visible in raw view] — view raw

Hi Philipp,

[auto build test WARNING on v4.5-rc3]
[also build test WARNING on 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-lpc18xx-Make-reset_control_ops-const/20160208-213147
config: arm-lpc18xx_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-lpc18xx.c: In function 'lpc18xx_rgu_probe':
>> drivers/reset/reset-lpc18xx.c:197:16: warning: assignment discards 'const' qualifier from pointer target type
     rc->rcdev.ops = &lpc18xx_rgu_ops;
                   ^

vim +/const +197 drivers/reset/reset-lpc18xx.c

c392b65b Joachim Eastwood 2015-05-06  181  	if (ret) {
c392b65b Joachim Eastwood 2015-05-06  182  		dev_err(&pdev->dev, "unable to enable delay clock\n");
c392b65b Joachim Eastwood 2015-05-06  183  		goto dis_clk_reg;
c392b65b Joachim Eastwood 2015-05-06  184  	}
c392b65b Joachim Eastwood 2015-05-06  185  
c392b65b Joachim Eastwood 2015-05-06  186  	fcclk = clk_get_rate(rc->clk_reg) / USEC_PER_SEC;
c392b65b Joachim Eastwood 2015-05-06  187  	firc = clk_get_rate(rc->clk_delay) / USEC_PER_SEC;
c392b65b Joachim Eastwood 2015-05-06  188  	if (fcclk == 0 || firc == 0)
c392b65b Joachim Eastwood 2015-05-06  189  		rc->delay_us = 2;
c392b65b Joachim Eastwood 2015-05-06  190  	else
c392b65b Joachim Eastwood 2015-05-06  191  		rc->delay_us = DIV_ROUND_UP(fcclk, firc * firc);
c392b65b Joachim Eastwood 2015-05-06  192  
c392b65b Joachim Eastwood 2015-05-06  193  	spin_lock_init(&rc->lock);
c392b65b Joachim Eastwood 2015-05-06  194  
c392b65b Joachim Eastwood 2015-05-06  195  	rc->rcdev.owner = THIS_MODULE;
c392b65b Joachim Eastwood 2015-05-06  196  	rc->rcdev.nr_resets = 64;
c392b65b Joachim Eastwood 2015-05-06 @197  	rc->rcdev.ops = &lpc18xx_rgu_ops;
c392b65b Joachim Eastwood 2015-05-06  198  	rc->rcdev.of_node = pdev->dev.of_node;
c392b65b Joachim Eastwood 2015-05-06  199  
c392b65b Joachim Eastwood 2015-05-06  200  	platform_set_drvdata(pdev, rc);
c392b65b Joachim Eastwood 2015-05-06  201  
c392b65b Joachim Eastwood 2015-05-06  202  	ret = reset_controller_register(&rc->rcdev);
c392b65b Joachim Eastwood 2015-05-06  203  	if (ret) {
c392b65b Joachim Eastwood 2015-05-06  204  		dev_err(&pdev->dev, "unable to register device\n");
c392b65b Joachim Eastwood 2015-05-06  205  		goto dis_clks;

:::::: The code at line 197 was first introduced by commit
:::::: c392b65ba853f653cff3d1c7de2138bd6906d536 reset: add driver for lpc18xx rgu

:::::: TO: Joachim Eastwood <manabian@gmail.com>
:::::: CC: Philipp Zabel <p.zabel@pengutronix.de>

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web