From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Wed, 11 Jun 2014 23:37:25 +0200 Subject: [U-Boot] unsigned int for gpio Message-ID: <1402522645.4361.18.camel@yellow> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Simon, in commit 95a260a9 dm: Enable gpio command to support driver model Now that named GPIO banks are supported, along with a way of obtaining the status of a GPIO (input or output), we can provide an enhanced GPIO command for driver model. Where the driver provides its own operation for obtaining the GPIO state, this is used, otherwise a generic version is sufficient. you made the following change: - int gpio; + unsigned int gpio; This breaks the code after it though: /* turn the gpio name into a gpio number */ gpio = name_to_gpio(str_gpio); if (gpio < 0) goto show_usage; And causes warnings with clang like: common/cmd_gpio.c:159:11: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (gpio < 0) ~~~~ ^ ~ Do you recall why it is made unsigned? Regards, Jeroen