From patchwork Tue Sep 1 14:10:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byongho Lee X-Patchwork-Id: 7105511 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E0BDE9F32B for ; Tue, 1 Sep 2015 14:11:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2197F205F9 for ; Tue, 1 Sep 2015 14:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B3E9204D6 for ; Tue, 1 Sep 2015 14:11:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752327AbbIAOLH (ORCPT ); Tue, 1 Sep 2015 10:11:07 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34306 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752251AbbIAOLG (ORCPT ); Tue, 1 Sep 2015 10:11:06 -0400 Received: by pabzx8 with SMTP id zx8so178346633pab.1 for ; Tue, 01 Sep 2015 07:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=SZmcJ7cruHXdyt+z9uenoPNOIfMktD8IgjiXk7BPyCI=; b=Ui+z7NNIAh+liQ+SaLiq6+zb5h48aElpqN6mx2ePK+h0li8tYxF4qnjRCoapGksb9R 6Wrx1h1jhwC3oWRQ43LgHhqQ+L2Zov2MvDUb+Xyt/IBDaUtVYPNEtx4H/t7AsXhTs3jM FSdRosNEdXRZrvvP0P1kab1s4xoD9KxaoupWGkkfx8meGjbV+f+6ZYz7QERcqIhTh0cu EyQEEyb2HabQy1aE6xwhGwdhYFZtXLq5wFy7bG368zTsz/A/6xX108zaYHgfduAv44kJ ESos6aZbN4LxVwIpJ+nUxtJoBkfHVr0j4m2qJgUg2fod4vmlPm/RWwOBdZ+EqKENy2M0 /mrQ== X-Received: by 10.66.97.102 with SMTP id dz6mr48346464pab.29.1441116665764; Tue, 01 Sep 2015 07:11:05 -0700 (PDT) Received: from arch-nb.localdomain ([175.118.89.137]) by smtp.gmail.com with ESMTPSA id bh5sm10669765pbc.5.2015.09.01.07.11.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Sep 2015 07:11:04 -0700 (PDT) From: Byongho Lee To: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs: replace unnecessary list_for_each_entry_safe to list_for_each_entry Date: Tue, 1 Sep 2015 23:10:57 +0900 Message-Id: <1441116657-57299-1-git-send-email-bhlee.kernel@gmail.com> X-Mailer: git-send-email 2.5.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no removing list element while iterating over list. So, replace list_for_each_entry_safe to list_for_each_entry. Signed-off-by: Byongho Lee --- fs/btrfs/ioctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 0adf5422fce9..9181e640feab 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2699,7 +2699,6 @@ static long btrfs_ioctl_fs_info(struct btrfs_root *root, void __user *arg) { struct btrfs_ioctl_fs_info_args *fi_args; struct btrfs_device *device; - struct btrfs_device *next; struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices; int ret = 0; @@ -2711,7 +2710,7 @@ static long btrfs_ioctl_fs_info(struct btrfs_root *root, void __user *arg) fi_args->num_devices = fs_devices->num_devices; memcpy(&fi_args->fsid, root->fs_info->fsid, sizeof(fi_args->fsid)); - list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) { + list_for_each_entry(device, &fs_devices->devices, dev_list) { if (device->devid > fi_args->max_id) fi_args->max_id = device->devid; }