From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756235AbdGXT2f (ORCPT ); Mon, 24 Jul 2017 15:28:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:43338 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754483AbdGXT21 (ORCPT ); Mon, 24 Jul 2017 15:28:27 -0400 Date: Mon, 24 Jul 2017 21:28:22 +0200 (CEST) From: Jiri Kosina X-X-Sender: jkosina@pobox.suse.cz To: Lyude Paul cc: Andy Shevchenko , linux-input , Andrew Duggan , stable@vger.kernel.org, Benjamin Tissoires , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] HID: rmi: Make sure the HID device is opened on resume In-Reply-To: <1500918313.6243.1.camel@redhat.com> Message-ID: References: <20170723011509.23651-1-lyude@redhat.com> <1500918313.6243.1.camel@redhat.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) 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 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. -- Jiri Kosina SUSE Labs