From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751837AbdGXTqh (ORCPT ); Mon, 24 Jul 2017 15:46:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45720 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdGXTq1 (ORCPT ); Mon, 24 Jul 2017 15:46:27 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 15B0F7EA8E Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lyude@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 15B0F7EA8E Message-ID: <1500925583.6243.4.camel@redhat.com> Subject: Re: [PATCH] HID: rmi: Make sure the HID device is opened on resume From: Lyude Paul To: Jiri Kosina Cc: Andy Shevchenko , linux-input , Andrew Duggan , stable@vger.kernel.org, Benjamin Tissoires , "linux-kernel@vger.kernel.org" Date: Mon, 24 Jul 2017 15:46:23 -0400 In-Reply-To: References: <20170723011509.23651-1-lyude@redhat.com> <1500918313.6243.1.camel@redhat.com> Organization: Red Hat Inc. Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 24 Jul 2017 19:46:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yeah I noticed that, sorry if my response wasn't very clear! Should probably wait to have my morning coffee before responding to these messages :P On Mon, 2017-07-24 at 21:28 +0200, Jiri Kosina wrote: > On Mon, 24 Jul 2017, Lyude Paul wrote: > > > > > So, call hid_hw_open() in rmi_post_resume() so we make sure > > > > that > > > > the > > > > device is alive before we try talking to it. > > > > > > > > This fixes RMI device suspend/resume over HID. > > > > - int ret; > > > > + int ret = 0; > > > > > > What's the point? > > > > So that we can use the same out: label at the end of the function > > that > > calls hid_hw_close() to return success. This being said though I > > just > > realized that setting ret will initialize it to 0 anyway, so I > > guess > > this can be dropped > > Andy's point was that hid_hw_open() is obviously re-initializing the > ret > before its first use as a return value, so there is no need to > initialize > it at a declaration time. >