From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Subject: Re: i2c-HID: Delete unnecessary checks before the function call "gpiod_put" Date: Thu, 9 Jul 2015 23:10:16 +0200 Message-ID: <559EE338.4060107@users.sourceforge.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: 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 In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Benjamin Tissoires Cc: Jiri Kosina , Mika Westerberg , linux-input , Linux Kernel Mailing List , kernel-janitors@vger.kernel.org, Julia Lawall >> 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