Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752219AbaGGPk7 (ORCPT ); Mon, 7 Jul 2014 11:40:59 -0400 Received: from mail-ob0-f170.google.com ([209.85.214.170]:58020 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbaGGPk6 (ORCPT ); Mon, 7 Jul 2014 11:40:58 -0400 MIME-Version: 1.0 In-Reply-To: <1403782279-10116-1-git-send-email-rickard_strandqvist@spectrumdigital.se> References: <1403782279-10116-1-git-send-email-rickard_strandqvist@spectrumdigital.se> Date: Mon, 7 Jul 2014 17:40:57 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: pinctrl-msm.c: Cleaning up if unsigned is less than zero From: Linus Walleij To: Rickard Strandqvist Cc: "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 26, 2014 at 1:31 PM, Rickard Strandqvist wrote: > Remove checking if a unsigned is less than zero > > This was found using a static code analysis program called cppcheck. > > Signed-off-by: Rickard Strandqvist (...) > - if (WARN_ON(g->mux_bit < 0)) > + if (WARN_ON(g->mux_bit != 0)) Is that correct? If the variable cannot be < 0 should the check not simply be deleted, since this is all it checks for? Yours, Linus Walleij -- 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/