From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755161AbbL0NcH (ORCPT ); Sun, 27 Dec 2015 08:32:07 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34768 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754617AbbL0NcE (ORCPT ); Sun, 27 Dec 2015 08:32:04 -0500 Date: Sun, 27 Dec 2015 19:01:54 +0530 From: Sudip Mukherjee To: Linus Walleij Cc: Ross Zwisler , Alexandre Courbot , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" Subject: Re: [PATCH] gpiolib: fix warning about iterator Message-ID: <20151227133154.GA8735@sudip-pc> References: <1451116719-19158-1-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 26, 2015 at 10:31:15PM +0100, Linus Walleij wrote: > On Sat, Dec 26, 2015 at 8:58 AM, Sudip Mukherjee > wrote: > > > We were getting build warning about "iterator" being used uninitialized. > > Use iterator properly to fix the build warning and in the process remove > > the variable "pos" which is not required now. > > > > Signed-off-by: Sudip Mukherjee > > Aha there is a real patch solving the problem. Sorry Ross, > had to drop your patch and replace it with this. > > Patch applied! oops .. i think i have a small mistake in the patch. After the loop for list_for_each_entry ends we are having: if (iterator->base + iterator->ngpio <= chip->base) goto found; But at the end of the loop iterator will point to head. The condition in the loop is &pos->member != (head). I am sending v2 as reply to this thread. It will be great if you can review and apply that instead of this one. Sorry for the inconvenience. I guess christmas effect. :) regards sudip