From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759115AbcLSLLP (ORCPT ); Mon, 19 Dec 2016 06:11:15 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33862 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755464AbcLSLLN (ORCPT ); Mon, 19 Dec 2016 06:11:13 -0500 Date: Mon, 19 Dec 2016 12:11:15 +0100 From: Johan Hovold To: Geert Uytterhoeven Cc: Johan Hovold , "Ji-Ze Hong (Peter Hong)" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] USB: serial: f81534: Detect errors from f81534_logic_to_phy_port() Message-ID: <20161219111115.GL21690@localhost> References: <1482052768-4714-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1482052768-4714-1-git-send-email-geert@linux-m68k.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 18, 2016 at 10:19:28AM +0100, Geert Uytterhoeven wrote: > With gcc 4.1.2: > > drivers/usb/serial/f81534.c: In function ‘f81534_port_probe’: > drivers/usb/serial/f81534.c:1250: warning: comparison is always false due to limited range of data type > > f81534_logic_to_phy_port() may return a negative error value, which is > ignored by assigning it to u8 f81534_port_private.phy_num. > > Use an intermediate variable of type int to fix this. > While at it, forward the actual error code instead of converting it to > -ENODEV, and drop the useless check for F81534_NUM_PORT, as the callee > always returns a valid port number in case of success. > > Fixes: 0c9bd6004d258d46 ("USB: serial: add Fintek F81532/534 driver") > Signed-off-by: Geert Uytterhoeven > --- > v2: > - Drop useless check for F81534_NUM_PORT. Thanks for the update. I'll queue this one up for -rc2. Johan