From patchwork Thu Jul 7 07:33:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9217927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B5ED60467 for ; Thu, 7 Jul 2016 07:35:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21DDF2876F for ; Thu, 7 Jul 2016 07:35:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 152FF28778; Thu, 7 Jul 2016 07:35:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A57A02876F for ; Thu, 7 Jul 2016 07:35:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL3oa-0006WD-Ie; Thu, 07 Jul 2016 07:33:40 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bL3oZ-0006Vq-1s for xen-devel@lists.xenproject.org; Thu, 07 Jul 2016 07:33:39 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id F9/1F-09256-2D50E775; Thu, 07 Jul 2016 07:33:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRWlGSWpSXmKPExsXS6fjDS/cia12 4QesMfovvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPan5SCO+wV7W09TA2MZ9i6GDk5hATyJF78 2MUMYvMK2ElMPH4bzJYQMJTYN38VUA0HB4uAqsTZN1IgYTYBdYm2Z9tZQWwRgTiJQ1fesoPYz ALOEhuXtbOA2MIC+hLXzvWyg7TyCghK/N0hDFGiJfHw1y0WCFtbYtnC18wgJcwC0hLL/3FMYO SZhdAwC0nDLCQNsxAaFjCyrGJUL04tKkst0jXUSyrKTM8oyU3MzNE1NDDTy00tLk5MT81JTCr WS87P3cQIDCMGINjBuPO50yFGSQ4mJVHePXdrw4X4kvJTKjMSizPii0pzUosPMcpwcChJ8L5i qQsXEixKTU+tSMvMAQY0TFqCg0dJhFcDJM1bXJCYW5yZDpE6xajLseDH7bVMQix5+XmpUuK8K 0CKBECKMkrz4EbAousSo6yUMC8j0FFCPAWpRbmZJajyrxjFORiVhHnng0zhycwrgdv0CugIJq AjfrpUgxxRkoiQkmpg5O3vvRD/Zvfd2df7F4qcCzeXLph+fPJ8D+daiWs5S6PzDj15zTAx+MT b/1dkOAusfuoEH31ulVHz4uCJ18+9Dk7PFduTm22+UqXI91VAhfuLax2uH3tY1kxsqF1xTeDI jekmc6ZfzOPZsr3uje4baeuFb5bYGob+O8jpXK/ndks9aTFXZKPtRCWW4oxEQy3mouJEAKFo8 fWpAgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-4.tower-21.messagelabs.com!1467876815!16599335!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60591 invoked from network); 7 Jul 2016 07:33:36 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-4.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 7 Jul 2016 07:33:36 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 07 Jul 2016 01:33:35 -0600 Message-Id: <577E21EE02000078000FBDBD@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Thu, 07 Jul 2016 01:33:34 -0600 From: "Jan Beulich" To: ,, "Juergen Gross" Mime-Version: 1.0 Content-Disposition: inline Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [Xen-devel] [PATCH] xenbus: prefer list_for_each() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP ... over list_for_each_safe() when list modification if accompanied by breaking out of the loop. Signed-off-by: Jan Beulich --- drivers/xen/xenbus/xenbus_dev_frontend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- 4.7-rc6-xen.orig/drivers/xen/xenbus/xenbus_dev_frontend.c +++ 4.7-rc6-xen/drivers/xen/xenbus/xenbus_dev_frontend.c @@ -364,7 +364,7 @@ out: static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u) { - struct watch_adapter *watch, *tmp_watch; + struct watch_adapter *watch; char *path, *token; int err, rc; LIST_HEAD(staging_q); @@ -399,7 +399,7 @@ static int xenbus_write_watch(unsigned m } list_add(&watch->list, &u->watches); } else { - list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) { + list_for_each_entry(watch, &u->watches, list) { if (!strcmp(watch->token, token) && !strcmp(watch->watch.node, path)) { unregister_xenbus_watch(&watch->watch);