Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1330553pxb; Fri, 1 Apr 2022 10:21:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuj1gpHxQk8ZdZeg8+B6BdB97n3Rg9SQG1PBHbAJz4b4KSOgFMesC41bG6SGE7GzUclEiv X-Received: by 2002:a05:6402:1347:b0:41b:79bf:cf12 with SMTP id y7-20020a056402134700b0041b79bfcf12mr9116860edw.195.1648833700476; Fri, 01 Apr 2022 10:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648833700; cv=none; d=google.com; s=arc-20160816; b=tHRE2LZ4vKJ7Kj++klqUdHP25gz7HiDDUwm4Y3fihTBNvyNtkTekeBJcCKcNVFoygC GAK03jIOWj38jCogluq/JNPU8qb2skPM/Sj5gkAiK8cGgFMuGIqnNCgN2km1oaisQtgK TcW+9VbC2QkLssesIeGrzR7YF3ErCl4WcS0ZTPvXb/YXAppBEPs9PGmO/90Tsj4qJfgz nTMp7xtiE5dEMyKk4wt/hMDW4NhUOhtu+G9iF07IZVVnZD+AwbSKqB18Z6YGAQP6Sx8w M/JI3Pjiu2NayJT/mv/JRM5Vh6EP0ji0sv8SbZQHwKRkk3j5MWarC/pRt4tVaj09/6cG IRtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6g/YpfYbHgEpxLuwRB55kVTmB3NxzgAkvHCUBgrl0tg=; b=k6MVBH9kVdNhKqig+pPIuimnZemcto6L3bo7LVfnI90C7S7X3kSpd4LlnFYmWNGl2+ 8wL9EdF2vGQBVPpg2GfEzYndn1hgc/hnTC8CW8DLtCXtL3bPfpKOcggLD8k6UVM9cdEl LSYZnDVveb2X8H/NJt4p/ASR5moc8bh9ll/O+Y+4GZf6oAcMhVcMn6Ure31Zq/6F5+XV P0Gra8VvLg1BeW/ctGQ0E9V205vDkiXlXC9XS8CRDvK2OSZDQ7m9nj6NFw8zy2s95lMy DCEhQ7dxNzuZW/abOPi6Ndmv/g28my+Eaw0GvSlGzpTGF1kyO7OiTBv5rl+AFAFtrADm oSUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jw/LLZTk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c19-20020a05640227d300b00418f9868569si2269570ede.402.2022.04.01.10.21.12; Fri, 01 Apr 2022 10:21:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="jw/LLZTk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242719AbiDAFkm (ORCPT + 99 others); Fri, 1 Apr 2022 01:40:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235087AbiDAFkl (ORCPT ); Fri, 1 Apr 2022 01:40:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D45D8193157 for ; Thu, 31 Mar 2022 22:38:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 761AF61B46 for ; Fri, 1 Apr 2022 05:38:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54FAFC340EE; Fri, 1 Apr 2022 05:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648791531; bh=idRurwlZhLY56xIhw05sesud6IxCOS559aOyQIT4ofY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jw/LLZTkEvakWoDSp1NQe8eAwdydMnAdUSdDxeQO4xijVb7dg07E4puORFyTPG9HL vOQLgWLn9HBFgZ+KO+6ZFRSoF9NOldy6Rz00Pz3KSvZp3za1R+onauIra4k9nCTeI+ zUvHc5AvLYDz+reuH49yAQSIRCbSiEmdhwLzs/+s= Date: Fri, 1 Apr 2022 07:38:49 +0200 From: Greg Kroah-Hartman To: Jakob Koschel Cc: Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Hridya Valsaraju , Suren Baghdasaryan , linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [PATCH] staging: android: ashmem: remove usage of list iterator after the loop body Message-ID: References: <20220331213934.866804-1-jakobkoschel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331213934.866804-1-jakobkoschel@gmail.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 31, 2022 at 11:39:34PM +0200, Jakob Koschel wrote: > In preparation to limit the scope of a list iterator to the list > traversal loop, use a dedicated pointer to point to the found element > [1]. > > Before, the code implicitly used the head when no element was found > when using &pos->list. Since the new variable is only set if an > element was found, the head needs to be used explicitly if the > variable is NULL. > > Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] > Signed-off-by: Jakob Koschel > --- > drivers/staging/android/ashmem.c | 21 ++++++++++++--------- > 1 file changed, 12 insertions(+), 9 deletions(-) What tree did you make this against? This file is no longer in Linus's tree. thanks, greg k-h