From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933868AbbCPUab (ORCPT ); Mon, 16 Mar 2015 16:30:31 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:43658 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933155AbbCPUa1 (ORCPT ); Mon, 16 Mar 2015 16:30:27 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 16 Mar 2015 21:30:02 +0100 From: Stefan Agner 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 In-Reply-To: <1426377952-12383-1-git-send-email-stefan@agner.ch> References: <1426377952-12383-1-git-send-email-stefan@agner.ch> Message-ID: User-Agent: Roundcube Webmail/1.1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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