| From ltsi-dev-bounces@lists.linuxfoundation.org Wed Oct 29 09:53:43 2014 |
| From: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> |
| Date: Wed, 29 Oct 2014 08:52:53 +0800 |
| Subject: [LTSI-dev] [PATCH 3/8] pwm: lpss: Fix const qualifier and sparse warnings |
| To: LTSI Mailing List <ltsi-dev@lists.linuxfoundation.org> |
| Cc: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> |
| Message-ID: <1414543978-24145-4-git-send-email-rebecca.swee.fun.chang@intel.com> |
| |
| |
| From: Thierry Reding <thierry.reding@gmail.com> |
| |
| Fixes the following warnings reported by the 0-DAY kernel build testing |
| backend: |
| |
| drivers/pwm/pwm-lpss.c: In function 'pwm_lpss_probe_pci': |
| >> drivers/pwm/pwm-lpss.c:192:2: warning: passing argument 3 of 'pwm_lpss_probe' discards 'const' qualifier from pointer target type [enabled by default] |
| lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info); |
| ^ |
| drivers/pwm/pwm-lpss.c:130:30: note: expected 'struct pwm_lpss_boardinfo *' but argument is of type 'const struct pwm_lpss_boardinfo *' |
| static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, |
| ^ |
| >> drivers/pwm/pwm-lpss.c:143:28: sparse: incorrect type in return expression (different address spaces) |
| drivers/pwm/pwm-lpss.c:143:28: expected struct pwm_lpss_chip * |
| drivers/pwm/pwm-lpss.c:143:28: got void [noderef] <asn:2>*regs |
| >> drivers/pwm/pwm-lpss.c:192:63: sparse: incorrect type in argument 3 (different modifiers) |
| drivers/pwm/pwm-lpss.c:192:63: expected struct pwm_lpss_boardinfo *info |
| drivers/pwm/pwm-lpss.c:192:63: got struct pwm_lpss_boardinfo const *[assigned] info |
| drivers/pwm/pwm-lpss.c: In function 'pwm_lpss_probe_pci': |
| drivers/pwm/pwm-lpss.c:192:2: warning: passing argument 3 of 'pwm_lpss_probe' discards 'const' qualifier from pointer target type [enabled by default] |
| lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info); |
| ^ |
| drivers/pwm/pwm-lpss.c:130:30: note: expected 'struct pwm_lpss_boardinfo *' but argument is of type 'const struct pwm_lpss_boardinfo *' |
| static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, |
| ^ |
| |
| Reported-by: kbuild test robot <fengguang.wu@intel.com> |
| Signed-off-by: Thierry Reding <thierry.reding@gmail.com> |
| (cherry picked from commit 89c0339e0aa097384b3efed894b23820814c21d3) |
| |
| Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> |
| --- |
| drivers/pwm/pwm-lpss.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| --- a/drivers/pwm/pwm-lpss.c |
| +++ b/drivers/pwm/pwm-lpss.c |
| @@ -129,7 +129,7 @@ static const struct pwm_ops pwm_lpss_ops |
| |
| static struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, |
| struct resource *r, |
| - struct pwm_lpss_boardinfo *info) |
| + const struct pwm_lpss_boardinfo *info) |
| { |
| struct pwm_lpss_chip *lpwm; |
| int ret; |
| @@ -140,7 +140,7 @@ static struct pwm_lpss_chip *pwm_lpss_pr |
| |
| lpwm->regs = devm_ioremap_resource(dev, r); |
| if (IS_ERR(lpwm->regs)) |
| - return lpwm->regs; |
| + return ERR_CAST(lpwm->regs); |
| |
| if (info) { |
| lpwm->clk_rate = info->clk_rate; |