Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbbGIMev (ORCPT ); Thu, 9 Jul 2015 08:34:51 -0400 Received: from mail.emea.novell.com ([130.57.118.101]:58977 "EHLO mail.emea.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751851AbbGIMen (ORCPT ); Thu, 9 Jul 2015 08:34:43 -0400 Date: Thu, 9 Jul 2015 14:34:13 +0200 (CEST) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: SF Markus Elfring cc: linux-input@vger.kernel.org, Linux Kernel Mailing List , kernel-janitors@vger.kernel.org, Julia Lawall , Benjamin Tissoires Subject: Re: [PATCH] i2c-HID: Delete unnecessary checks before the function call "gpiod_put" In-Reply-To: <559D8874.7090407@users.sourceforge.net> Message-ID: References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <559D8874.7090407@users.sourceforge.net> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 970 Lines: 27 On Wed, 8 Jul 2015, SF Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 8 Jul 2015 22:12:25 +0200 > > The gpiod_put() function performs also input parameter validation > by forwarding its single input pointer to the gpiod_free() function. > Thus the test around the calls is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring As Dan correctly pointed out, this is not as straightforward as it might seem on a firsr sight, because there is a WARN_ON() that might start triggering in case of !ihid->desc. Adding Benjamin. I am not applying this without his Ack. -- Jiri Kosina SUSE Labs -- 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/