mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: swarren@wwwdotorg.org
Cc: linus.walleij@linaro.org, thierry.reding@gmail.com,
	gnurou@gmail.com, linux-gpio@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pinctrl: tegra: use signed bitfields for optional fields
Date: Mon, 16 Mar 2015 21:30:02 +0100	[thread overview]
Message-ID: <b20f23a75058210e8521f014f130e306@agner.ch> (raw)
In-Reply-To: <1426377952-12383-1-git-send-email-stefan@agner.ch>

On 2015-03-15 01:05, Stefan Agner wrote:
> Optional fields are set to -1 by various preprocessor macros. Make
> sure the struct fields can actually store them.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> This lead to a lot of warnings when compiling the Tegra pinctrl drivers
> using LLVM/clang:
> 
> drivers/pinctrl/pinctrl-tegra124.c:2048:2: warning: implicit truncation from
> 'int' to bitfield changes value from -1 to 63 [-Wbitfield-constant-conversion]
>         MIPI_PAD_CTRL_PINGROUP(dsi_b,   0x820, 1, CSI, DSI_B)
>         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/pinctrl/pinctrl-tegra124.c:1807:18: note: expanded from macro
> 'MIPI_PAD_CTRL_PINGROUP'
>                 .rcv_sel_bit = -1,                                      \
>                                ^~
> 
> However, I did not check if this could actually lead to an unintended
> pin configuration...

Stephen, what do you think about this? While I think the patch  is the
right thing to do, it could actually introduce nasty regressions (stuff
which was working due to  "accidentally" wrong pin configuration)...

I need to admit that I did not actually run a kernel with that patch.

--
Stefan

      parent reply	other threads:[~2015-03-16 20:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15  0:05 Stefan Agner
2015-03-16 16:59 ` Stephen Warren
2015-03-16 20:17   ` Stefan Agner
2015-03-16 20:30 ` Stefan Agner [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=b20f23a75058210e8521f014f130e306@agner.ch \
    --to=stefan@agner.ch \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    /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

Powered by JetHome