From patchwork Mon Sep 28 09:16:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 7276021 Return-Path: X-Original-To: patchwork-linux-pm@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 388229F36A for ; Mon, 28 Sep 2015 09:18:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7028E206AA for ; Mon, 28 Sep 2015 09:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F404E206A4 for ; Mon, 28 Sep 2015 09:18:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757211AbbI1JSh (ORCPT ); Mon, 28 Sep 2015 05:18:37 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:25621 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757191AbbI1JSg (ORCPT ); Mon, 28 Sep 2015 05:18:36 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t8S9HbPV005513 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Sep 2015 09:17:37 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t8S9HaeF026089 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 28 Sep 2015 09:17:37 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t8S9HaK3002905; Mon, 28 Sep 2015 09:17:36 GMT Received: from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 28 Sep 2015 02:17:34 -0700 Date: Mon, 28 Sep 2015 12:16:53 +0300 From: Dan Carpenter To: Pali =?iso-8859-1?Q?Roh=E1r?= , "Andrew F. Davis" Cc: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] power: bq27xxx_battery: signedness bug in bq27xxx_battery_read_health() Message-ID: <20150928091653.GA11367@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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=unavailable 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 We need flags to be signed for the error handling to work. Fixes: 74aab849f342 ('power: bq27xxx_battery: Cleanup health checking') Signed-off-by: Dan Carpenter Acked-by: Andrew F. Davis --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c index 473aa2f..994c78d 100644 --- a/drivers/power/bq27xxx_battery.c +++ b/drivers/power/bq27xxx_battery.c @@ -691,7 +691,7 @@ static bool bq27xxx_battery_dead(struct bq27xxx_device_info *di, u16 flags) */ static int bq27xxx_battery_read_health(struct bq27xxx_device_info *di) { - u16 flags; + int flags; flags = bq27xxx_read(di, BQ27XXX_REG_FLAGS, false); if (flags < 0) {