From patchwork Fri Sep 21 13:40:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 147279 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp839063ljw; Fri, 21 Sep 2018 06:42:38 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdah3LadZgKdwpr+7ISER6L1jOpMrRt5gdLJhZ77LsFRz4cX2P7iXV0rEjR8e2U+Fy20AKxp X-Received: by 2002:a62:8ad1:: with SMTP id o78-v6mr46242186pfk.17.1537537358776; Fri, 21 Sep 2018 06:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537537358; cv=none; d=google.com; s=arc-20160816; b=JNjiv26BDiPRH3kVrDD7hMz2LE2U6xKok/6Q3vqrxDP1MskGepSilsETpDeQQJFgIt /aBbM6LM6Ae2YIucNrmAO6zlc7YPPciZa4b7xUs9ejyBhBGXgga3pyuLVM6J0gV75HxG KcPx71j4fzbsarLSccNIJdAxOMzW3k2e1+RqO2uKh/sPILXd6LtuknSvdG34KY06IcQO 6MYo6E2oAljztClOheJFOQl4vL65Vn9YwNwrKAD64G1iLn1Ozi5ZZ43pz3HEbCRs5GRg lnFF0RCwYevoLvTfg33zFnl0ddj7PLirwcBTlw2XnyDR8t5toQBgZXsSzBxvzzhhEwey jQMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=amN7ddXkResdHNrYb0iY3daOfe5OJqdHWfYz3x09ACo=; b=kQ5TcYMmQFBtlWQmDfXtBfcvLtAzbzV1Nnj39N4t+zRNkzZxZyMTKmeFnC2RnFvzw6 Q8oq9c/H6kx5joOhgYAyhXdW9ZoIWXgc6mHAjIMs6xQs8OmzDleoYYqtncI8pitIUsgt 60vJoRMk0ciKR5tcv7w5of6BdZsJ4wAMq6jPHZsL+FtUCu317fO39e2vd32htqbemEIB x+LgA+L76Qow9iQNMp9yT/QNqfOUbOBw607p0fasznD1BxfS7D4rnVpyRKI+EGwYANCT DTm9rKV1D9/LeThrv4fx5WkmgJszAi/5H/PgvQRPa7LBtDrsMrKg6JMmYZCIVJab5ZGm s46w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Mp/d4UTg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u90-v6si30252948pfk.82.2018.09.21.06.42.38; Fri, 21 Sep 2018 06:42:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Mp/d4UTg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390484AbeIUTbc (ORCPT + 32 others); Fri, 21 Sep 2018 15:31:32 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:39964 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390084AbeIUT3g (ORCPT ); Fri, 21 Sep 2018 15:29:36 -0400 Received: by mail-io1-f66.google.com with SMTP id l14-v6so12206447iob.7 for ; Fri, 21 Sep 2018 06:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=amN7ddXkResdHNrYb0iY3daOfe5OJqdHWfYz3x09ACo=; b=Mp/d4UTgcJSm6suijva9O0ARRHCzFsHG0E61wEWgrJA8roIsxCLYllX4I/4eC7QUUD nDwU7Ox46ctqyxgx+PlrGqmYNevt1YBC8AcwUn7hqrLIsCM6F+8+YgpNqEfeaDgOZVs0 aBU4kk935QXfLVEg3OQ2nYdgu0PVXN6YmfcOc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=amN7ddXkResdHNrYb0iY3daOfe5OJqdHWfYz3x09ACo=; b=dle+Mi1VPF/YEg0HL+VpfB4ZORQJ7JCjRF9OJahYpaKMAcwD7uSDVOjRZ2cBLVG4EE 7qnIVv+NUZ3RanxfbHnitzj/LBfufYDj5r+iQ/bkMXIOg/yRZWY1vcK1z8KnSYGfS4Yp /+EewbIFXobX7E1TQtlLC0MMObq0/EyFPcGJ8b7XHNTUv/lp4K/f7K6OwKtVX1mJqLNN mZ0fZT2UuRDx64zJtzwcaJgRsDVx6cV3MJzCgjwfHkv6uWGKAQ69SCEBSpf5FGJ3N+qz 9qEhcshFRINhzfp4Q6hg3TSVvo+YCgojywp6me8pLp5HATl+Q508AptnJI8I06cn8T6f ZguQ== X-Gm-Message-State: APzg51CuMd5Lfod8hCB7TcTkOsIrJL8u4kbpUYEDCINKnah6BJdJUDvX KP89NXVncYHaH2uqUBtkcjqGpFYrOvA= X-Received: by 2002:a02:97c5:: with SMTP id v5-v6mr8154135jaj.72.1537537240722; Fri, 21 Sep 2018 06:40:40 -0700 (PDT) Received: from localhost.localdomain ([209.82.80.116]) by smtp.gmail.com with ESMTPSA id c12-v6sm9896298ioq.81.2018.09.21.06.40.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 06:40:40 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski , Srinivas Kandagatla Subject: [PATCH 05/26] nvmem: use list_for_each_entry_safe in nvmem_device_remove_all_cells() Date: Fri, 21 Sep 2018 06:40:05 -0700 Message-Id: <20180921134026.4596-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20180921134026.4596-1-srinivas.kandagatla@linaro.org> References: <20180921134026.4596-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Use the provided helper for iterating over list entries without having to use the list_entry() macro. Signed-off-by: Bartosz Golaszewski Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.19.0 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 72313a1d215f..0e963d83a099 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -308,14 +308,11 @@ static void nvmem_cell_drop(struct nvmem_cell *cell) static void nvmem_device_remove_all_cells(const struct nvmem_device *nvmem) { - struct nvmem_cell *cell; - struct list_head *p, *n; + struct nvmem_cell *cell, *p; - list_for_each_safe(p, n, &nvmem_cells) { - cell = list_entry(p, struct nvmem_cell, node); + list_for_each_entry_safe(cell, p, &nvmem_cells, node) if (cell->nvmem == nvmem) nvmem_cell_drop(cell); - } } static void nvmem_cell_add(struct nvmem_cell *cell)