From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Subject: Re: new version of usbhid autosuspend patch Date: Thu, 27 Sep 2007 20:09:19 +0200 Message-ID: <200709272009.20051.oliver@neukum.org> References: <200709271633.35098.oliver@neukum.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline Sender: owner-linux-input@atrey.karlin.mff.cuni.cz List-Help: List-Owner: List-Post: List-Unsubscribe: To: Dmitry Torokhov Cc: Jiri Kosina , linux-usb-devel@lists.sourceforge.net, linux-input@atrey.karlin.mff.cuni.cz, Pavel Machek List-Id: linux-input@vger.kernel.org Am Donnerstag 27 September 2007 schrieb Dmitry Torokhov: > Hi Oliver, > > On 9/27/07, Oliver Neukum wrote: > > +int hid_check_keys_pressed(struct hid_device *hid) > > +{ > > + struct hid_input *hidinput, *next; > > + int i; > > + > > + list_for_each_entry_safe(hidinput, next, &hid->inputs, list) { > > + for (i = 0; i < NBITS(KEY_MAX); i++) > > + if (hidinput->input->key[i]) > > + return 1; > > + } > > Why are you using the list_for_each_entry_safe? You do not alter the > list in your loop. Relict from an older version. I am preparing a new patch. Thanks Oliver