Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1180685 > unrolled thread

Re: [PATCH] i2c-HID: Delete unnecessary checks before the function call "gpiod_put"

Started byJiri Kosina <jkosina@suse.com>
First post2015-07-09 14:40 +0200
Last post2015-07-09 14:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] i2c-HID: Delete unnecessary checks before the function  call "gpiod_put" Jiri Kosina <jkosina@suse.com> - 2015-07-09 14:40 +0200

#1180685 — Re: [PATCH] i2c-HID: Delete unnecessary checks before the function call "gpiod_put"

FromJiri Kosina <jkosina@suse.com>
Date2015-07-09 14:40 +0200
SubjectRe: [PATCH] i2c-HID: Delete unnecessary checks before the function call "gpiod_put"
Message-ID<pKjhp-9T-37@gated-at.bofh.it>
On Wed, 8 Jul 2015, SF Markus Elfring wrote:

> From: Markus Elfring <elfring@users.sourceforge.net>
> 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 <elfring@users.sourceforge.net>

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/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web