Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758952AbbFBNM5 (ORCPT ); Tue, 2 Jun 2015 09:12:57 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:33578 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753267AbbFBNMu (ORCPT ); Tue, 2 Jun 2015 09:12:50 -0400 Message-ID: <556DABCC.2080302@samsung.com> Date: Tue, 02 Jun 2015 22:12:44 +0900 From: Krzysztof Kozlowski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Laurentiu Palcu , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse CC: Dan Carpenter , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power_supply: bq25890: make chip_id int References: <1433241411-27423-1-git-send-email-laurentiu.palcu@intel.com> In-Reply-To: <1433241411-27423-1-git-send-email-laurentiu.palcu@intel.com> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 822 Lines: 22 W dniu 02.06.2015 o 19:36, Laurentiu Palcu pisze: > Smatch static checker correctly detected an impossible condition because > chip_id was declared as u8, instead of int: > > drivers/power/bq25890_charger.c:843 bq25890_probe() > warn: impossible condition '(bq->chip_id < 0) => (0-255 < 0)' > > Also, while at it, fix the return value too. I wondered whether this should be split into two commits... but actually returning uninitialized value is not possible now because of the cast, so: Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/