From: linux@roeck-us•net (Guenter Roeck)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] watchdog: sunxi: Fix compilation with C=2
Date: Fri, 04 Apr 2014 10:35:54 -0700 [thread overview]
Message-ID: <533EED7A.20307@roeck-us.net> (raw)
In-Reply-To: <1396632265-16124-1-git-send-email-emilio@elopez.com.ar>
On 04/04/2014 10:24 AM, Emilio L?pez wrote:
> When compiling sunxi_defconfig while using C=2, the following error
> causes the compilation to fail:
>
> drivers/watchdog/sunxi_wdt.c:60:15: error: constant 0b0001 is not a valid number
>
> Fix it by using hex notation instead of the non-standard binary one
>
What defines "non-standard" here ? Isn't this a sparse problem that should possibly
be fixed in sparse instead ?
[ I don't mind changing it as the 0bXXXX notation doesn't seem to be used much
in the kernel, but we should not claim something to be non-standard if it is
just not widely used. As normal compilation doesn't seem to have a problem,
we should be sure that it is non-standard if we claim it to be non-standard. ]
Thanks,
Guenter
> Signed-off-by: Emilio L?pez <emilio@elopez•com.ar>
> ---
> drivers/watchdog/sunxi_wdt.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c
> index cd00a78..693b9d2 100644
> --- a/drivers/watchdog/sunxi_wdt.c
> +++ b/drivers/watchdog/sunxi_wdt.c
> @@ -57,17 +57,17 @@ struct sunxi_wdt_dev {
> */
>
> static const int wdt_timeout_map[] = {
> - [1] = 0b0001, /* 1s */
> - [2] = 0b0010, /* 2s */
> - [3] = 0b0011, /* 3s */
> - [4] = 0b0100, /* 4s */
> - [5] = 0b0101, /* 5s */
> - [6] = 0b0110, /* 6s */
> - [8] = 0b0111, /* 8s */
> - [10] = 0b1000, /* 10s */
> - [12] = 0b1001, /* 12s */
> - [14] = 0b1010, /* 14s */
> - [16] = 0b1011, /* 16s */
> + [1] = 0x1, /* 1s */
> + [2] = 0x2, /* 2s */
> + [3] = 0x3, /* 3s */
> + [4] = 0x4, /* 4s */
> + [5] = 0x5, /* 5s */
> + [6] = 0x6, /* 6s */
> + [8] = 0x7, /* 8s */
> + [10] = 0x8, /* 10s */
> + [12] = 0x9, /* 12s */
> + [14] = 0xA, /* 14s */
> + [16] = 0xB, /* 16s */
> };
>
> static int sunxi_wdt_ping(struct watchdog_device *wdt_dev)
>
next prev parent reply other threads:[~2014-04-04 17:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 17:24 [PATCH] watchdog: sunxi: Fix compilation with C=2 Emilio López
2014-04-04 17:35 ` Guenter Roeck [this message]
2014-04-04 17:57 ` Emilio López
2014-04-04 18:01 ` Guenter Roeck
2014-04-04 18:02 ` Guenter Roeck
2014-05-11 19:46 ` Emilio López
2014-05-15 8:52 ` Maxime Ripard
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=533EED7A.20307@roeck-us.net \
--to=linux@roeck-us$(echo .)net \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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