From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dmitry Torokhov" Subject: Re: new version of usbhid autosuspend patch Date: Thu, 27 Sep 2007 11:31:35 -0400 Message-ID: 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: <200709271633.35098.oliver@neukum.org> Content-Disposition: inline Sender: owner-linux-input@atrey.karlin.mff.cuni.cz List-Help: List-Owner: List-Post: List-Unsubscribe: To: Oliver Neukum 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 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. -- Dmitry