From patchwork Fri Nov 6 11:24:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 7568321 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C5089F4F5 for ; Fri, 6 Nov 2015 11:24:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5133420721 for ; Fri, 6 Nov 2015 11:24:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EDA520722 for ; Fri, 6 Nov 2015 11:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161066AbbKFLYf (ORCPT ); Fri, 6 Nov 2015 06:24:35 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:36662 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031997AbbKFLYf (ORCPT ); Fri, 6 Nov 2015 06:24:35 -0500 Received: from ayla.of.borg ([84.195.106.123]) by albert.telenet-ops.be with bizsmtp id eBQZ1r00N2fm56U06BQZmP; Fri, 06 Nov 2015 12:24:34 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1Zuf8D-0000TS-Bu; Fri, 06 Nov 2015 12:24:33 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1Zuf8L-0006j6-H6; Fri, 06 Nov 2015 12:24:41 +0100 From: Geert Uytterhoeven To: Robert Dolca , Lauro Ramos Venancio , Aloisio Almeida Jr , Samuel Ortiz Cc: linux-wireless@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] NFC: fdp: Detect errors from fdp_nci_patch_otp() Date: Fri, 6 Nov 2015 12:24:40 +0100 Message-Id: <1446809080-25823-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_otp’: drivers/nfc/fdp/fdp.c:372: warning: comparison is always false due to limited range of data type drivers/nfc/fdp/fdp.c: In function ‘fdp_nci_patch_ram’: drivers/nfc/fdp/fdp.c:443: warning: comparison is always false due to limited range of data type fdp_nci_patch_otp() may return a negative error, which is silently ignored by assigning it to a u8. Change conn_id from u8 to int to fix this. Signed-off-by: Geert Uytterhoeven --- fdp_nci_patch_otp() and fdp_nci_patch_ram() are almost identical. Please merge them, or create a common helper. --- drivers/nfc/fdp/fdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index ccb07a1b153db27f..23e53780728beb76 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -352,7 +352,7 @@ static int fdp_nci_patch_otp(struct nci_dev *ndev) { struct fdp_nci_info *info = nci_get_drvdata(ndev); struct device *dev = &info->phy->i2c_dev->dev; - u8 conn_id; + int conn_id; int r = 0; if (info->otp_version >= info->otp_patch_version) @@ -423,7 +423,7 @@ static int fdp_nci_patch_ram(struct nci_dev *ndev) { struct fdp_nci_info *info = nci_get_drvdata(ndev); struct device *dev = &info->phy->i2c_dev->dev; - u8 conn_id; + int conn_id; int r = 0; if (info->ram_version >= info->ram_patch_version)