Message ID | 20231016133135.1203643-3-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3462667vqb; Mon, 16 Oct 2023 06:32:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0kdyAosI+/z2MZUCKgaumemHDSiNIQkks19M0GDVkHiG85tgvPdQnEGPYj9QgWQpRjibZ X-Received: by 2002:a17:90b:1496:b0:27c:f88f:11a5 with SMTP id js22-20020a17090b149600b0027cf88f11a5mr16505839pjb.2.1697463133908; Mon, 16 Oct 2023 06:32:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697463133; cv=none; d=google.com; s=arc-20160816; b=e7RVf7g5aFP8lGmoVpemPgANcmvLL95a8oACQFL12onOilAANHzWsDjq3ry8rfcZke J6zuo5WRw1+p/NC4oPNDXDOe0YySh3nC3BlX0Gh8M0e16mjn9w2UkkdEp5u2ttla07Ic mC/krB189nXCYmGs4W2iXukLDW/btPJ/86NHIN7zdoxSYGRj2gwE0gu86iDYD6e2GuNk 5jr6eFhWRvXmF07W0pvW82btfMReOTNqgFxMpXNllUbEMdVCSfClQKMTuoaSWhD6N7yf PxLIOyFfQwN0oiXzyb47Zj5z8sVjihDffYlRrCNLZxIL8xkwU5Uba0nsAUBMH5yJFbFL m82g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5eeKCGmD1ogfK8HTaFADoKhgXqcQE8rtC1VJ8TfoWgk=; fh=2JBUIg4Hm6CI5OqXiiVJ9qu0u244D7Du+J73tUUcI/M=; b=taeeqpzP0XSyt/ta6Y+V+YTwEHTMcfzmsPkBm5GntZ9eAnh+ZYqwxR5Kk+HP+awIfM RmwhLh4vnNl4JdQ9/WD8sPT58AfOBBSjspXKOCQpsj3pGusJmY2TPkDSN/l55uZW4Gen /uF9VwUBshNXNPc9vKdHZ0Wpg5SpKHY2h/uIPno1pmzQaQkQe0TfAp2NStNyoFrCmcLZ 03GKAxVI/rZbC9x0yOL/LkTYo3hjUiMze6FUOhrjI1avSiHScnZw6AQ04SPsjihjuqWt 7bQXsQXT8pX5Rme1pwTV1wfJAo6pr5PUCORWdhud7WmldFu3nH/ZdiQk67IysaQD1A/y oXAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c4Obzebx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id 9-20020a630f49000000b0057ab7f46381si10148019pgp.76.2023.10.16.06.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:32:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c4Obzebx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C723880AD086; Mon, 16 Oct 2023 06:32:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233694AbjJPNb5 (ORCPT <rfc822;hjfbswb@gmail.com> + 18 others); Mon, 16 Oct 2023 09:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233732AbjJPNbn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 16 Oct 2023 09:31:43 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D165130 for <linux-kernel@vger.kernel.org>; Mon, 16 Oct 2023 06:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697463101; x=1728999101; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4roMkrTkBxn5M4KrWiiG+UKPCzazaRQ4mwiu9FhhIQM=; b=c4Obzebx+22ek0tTzWqTdZ6SDlbcc4z010e8tysMxRi3YLNXIXXGRqv4 gJL0bQAGdxB+RqzG78A0fM9M/NMz+YLscXvf2gjHXhoh2UZWk86bx/i9A Mdp/zEZqGey2396OtzKkbrmlH6a+wmTMbu1y+jk7sVSW7CEMzik6SxJ/x QtDzaTTet6Iwnfo1ac0J8YXwz+x4Z6nAIVNWr0fLPbevlja2ioLeN1ifN 4j4Pxg9L7rLQn/DUhb1tsrGz4inu+qGz6xvLeu+2TvhDFiUzbkcQR1n5n SZulLF1eRGyL2EvN2cHu95BpinXrB7nQ0+bzkYfV5okYQy/+lzjvpqX+O w==; X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="375892089" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="375892089" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 06:31:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="1002934884" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="1002934884" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 16 Oct 2023 06:31:38 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 566CE81C; Mon, 16 Oct 2023 16:31:37 +0300 (EEST) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Luis Chamberlain <mcgrof@kernel.org>, Joel Granados <j.granados@samsung.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-kernel@vger.kernel.org Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Subject: [resend, PATCH v1 2/3] parport: Use list_for_each() helper Date: Mon, 16 Oct 2023 16:31:34 +0300 Message-Id: <20231016133135.1203643-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231016133135.1203643-1-andriy.shevchenko@linux.intel.com> References: <20231016133135.1203643-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 06:32:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779919103415000480 X-GMAIL-MSGID: 1779919103415000480 |
Series |
parport: Switch to some modern APIs
|
|
Commit Message
Andy Shevchenko
Oct. 16, 2023, 1:31 p.m. UTC
Convert hard to read custom code to list_for_each().
No functional changes intended.
Note, we may not use list_for_each_entry() as at the end of the list
the iterator will point to an invalid entry and may not be dereferenced.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/parport/share.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 8037bcd07bcf..38780f6a9119 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -469,9 +469,11 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma, /* Search for the lowest free parport number. */ spin_lock(&full_list_lock); - for (l = all_ports.next, num = 0; l != &all_ports; l = l->next, num++) { + num = 0; + list_for_each(l, &all_ports) { struct parport *p = list_entry(l, struct parport, full_list); - if (p->number != num) + + if (p->number != num++) break; } tmp->portnum = tmp->number = num;