Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753961AbbGIVKn (ORCPT ); Thu, 9 Jul 2015 17:10:43 -0400 Received: from mout.web.de ([212.227.17.12]:50175 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753503AbbGIVKe (ORCPT ); Thu, 9 Jul 2015 17:10:34 -0400 Subject: Re: i2c-HID: Delete unnecessary checks before the function call "gpiod_put" To: Benjamin Tissoires References: <5307CAA2.8060406@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> <559EDE3D.1030409@users.sourceforge.net> Cc: Jiri Kosina , Mika Westerberg , linux-input , Linux Kernel Mailing List , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <559EE338.4060107@users.sourceforge.net> Date: Thu, 9 Jul 2015 23:10:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ouuDulrqLcr5NM4WX/WJ9sBMA6+mbTzqWUkHcWQVQ5HK3cSnmsD Nh4xyWaD4lRJ/XpmbJWtiM5QMRr/UpK/lMg6fNQSYI3L9IMncFWz7z4gDaQrhyudfiAZku+ cXzOcodlEsTrx8xgyLNLX6/vX4p6r2AChF4H66feOtiohHznSc4MZbYwr2JPAr4LOnxwhVl aClO5OUN/AbNN9W6rjD4Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:E1Op79IO044=:2Z1FpYH57uqM5C06IuG62c XmdmWKJIkBOhOJTxNIy4d3rEvqXy9oJIQ+noOLsyUC5BT9ZbvslgyjP9YXOoi878kjC2K4sni 4KLQIC3fGTPSaTRdFCP32ZrcJpLxiYvtJmb+k/238YDJOP6jNLKiQbhQ4JJwcQhYOnT8cg7u0 OobC8Fe+UF07WtMMtgZbf2GT0ChDK+ZrQNTZqzEYenBUQKyX9Qf22cmvvin7rluRpmYLZkgKB BjmYAyxYXpSdAkChiRvstnZkK8gH5kNLHDSF5Y85nUB1i7vovvn1Wpocf1qrCQWGBWIgbQ2oz GAwqTCn2SehEQjUu8/jJxDCqGdadxzwBb1b1wlI1SGDAJIEZTxcTIDtUCWXhXDxKl0WCxssuv yBFM5SRPpHCPKMccFOZvklryEcRt6YC2zNXZ6XmV51yvH+tyFUXkOSTB4RnHc6hXWM9Zhn2Hu OtyoRVfr5/90LfhNU6ICu8lybj3aMT6/xuPnkw3J6/WrnvATsCzRKa+9fqpeeTGhTpZ0U/eBz Q5CPwVXiHRWx257C2gV6ldErwgpbLFTmQzVURWCHHU7It4V0oHfwKBXJTpDWAJSbLI5rjqAOL ZOnDaubsTgGTUzK8gYxxACgXMdShNGw7s4K4u2YK+mijmUDAUDdj1k5O+ujbqC4G8mVRDe/7z KP5GLqlt6V/ycNibkcvBSvWBb6H26QpD0ANhuk8zUHj9b3o9lWgpNoihkotOzSxK+Nu0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1311 Lines: 30 >> The proposed update candidates are contained in the source >> file "drivers/hid/i2c-hid/i2c-hid.c" from Linux next-20150708. >> >> * i2c_hid_remove() function: >> Can it be tolerated here that the pointer "ihid->desc" might be eventually null? >> >> * i2c_hid_probe() function: >> Is this implementation structured in such a way that a pointer for valid data >> will be usually passed for "ihid->desc" if the statements after the jump >> label "err" will be reached? >> > > Again, in both case it is completely normal to have "ihid->desc == > NULL" given that this field is only retrieved in case of an ACPI > device which does not declares an IRQ but a GPIO. Most ACPI devices I > saw are using a simple IRQ, and the OF instantiations of the driver > will definitively have ihid->desc null. So I do not want to have a > warning for most of i2c-hid devices out there (because I will have to > explain that this is completely normal again and again). Would it make sense to annotate checks before such function calls as "unlikely" then? Regards, Markus -- 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/