From: Yash Shah <yash.shah@sifive.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "linux-riscv@lists.infradead.org" <linux-riscv@lists.infradead.org>
Subject: RE: [bug report] gpio/sifive: Add GPIO driver for SiFive SoCs
Date: Fri, 24 Jan 2020 04:44:24 +0000 [thread overview]
Message-ID: <CH2PR13MB3368DFCC0681A92FBB52352C8C0E0@CH2PR13MB3368.namprd13.prod.outlook.com> (raw)
In-Reply-To: <20200122093642.jneuumkqojgem5hk@kili.mountain>
> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Sent: 22 January 2020 15:07
> To: Yash Shah <yash.shah@sifive.com>
> Cc: linux-riscv@lists.infradead.org
> Subject: [bug report] gpio/sifive: Add GPIO driver for SiFive SoCs
>
> Hello Yash Shah,
>
> The patch 96868dce644d: "gpio/sifive: Add GPIO driver for SiFive SoCs" from
> Dec 10, 2019, leads to the following static checker
> warning:
>
> drivers/gpio/gpio-sifive.c:97 sifive_gpio_irq_enable()
> warn: passing casted pointer '&chip->irq_state' to 'assign_bit()' 32 vs
> 64.
>
> drivers/gpio/gpio-sifive.c
> 86 gc->direction_input(gc, offset);
> 87
> 88 spin_lock_irqsave(&gc->bgpio_lock, flags);
> 89 /* Clear any sticky pending interrupts */
> 90 regmap_write(chip->regs, SIFIVE_GPIO_RISE_IP, bit);
> 91 regmap_write(chip->regs, SIFIVE_GPIO_FALL_IP, bit);
> 92 regmap_write(chip->regs, SIFIVE_GPIO_HIGH_IP, bit);
> 93 regmap_write(chip->regs, SIFIVE_GPIO_LOW_IP, bit);
> 94 spin_unlock_irqrestore(&gc->bgpio_lock, flags);
> 95
> 96 /* Enable interrupts */
> 97 assign_bit(offset, (unsigned long *)&chip->irq_state, 1);
> ^^^^^^^^^^^^^^^^^ Better to just declare -
> >irq_state as an unsigned long so you don't have to worry about endianness.
Sure, will send the fix.
Thanks for reporting.
- Yash
>
> 98 sifive_gpio_set_ie(chip, offset);
>
> regards,
> dan carpenter
prev parent reply other threads:[~2020-01-24 4:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-22 9:36 [bug report] gpio/sifive: Add GPIO driver for SiFive SoCs Dan Carpenter
2020-01-24 4:44 ` Yash Shah [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CH2PR13MB3368DFCC0681A92FBB52352C8C0E0@CH2PR13MB3368.namprd13.prod.outlook.com \
--to=yash.shah@sifive.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-riscv@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).