From patchwork Wed Aug 12 15:30:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11710969 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BE621392 for ; Wed, 12 Aug 2020 15:31:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1721C207DA for ; Wed, 12 Aug 2020 15:31:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1721C207DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EBDEE8D0013; Wed, 12 Aug 2020 11:31:07 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E6E0D8D0001; Wed, 12 Aug 2020 11:31:07 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D85DE8D0013; Wed, 12 Aug 2020 11:31:07 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id C114E8D0001 for ; Wed, 12 Aug 2020 11:31:07 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 68EFD824805A for ; Wed, 12 Aug 2020 15:31:07 +0000 (UTC) X-FDA: 77142304974.23.sort38_4411fb826fec Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 610423760C for ; Wed, 12 Aug 2020 15:31:06 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,andriy.shevchenko@linux.intel.com,,RULES_HIT:30012:30054,0,RBL:192.55.52.88:@linux.intel.com:.lbl8.mailshell.net-64.95.201.95 62.18.0.100;04y8pk17ky4bejgwaii6x4hd1ant5opjyxc6mkxyn7bfcjownjx4siojh9fzox8.msodu15iexq7gbch9gszjhwh4zrg7n3rkind15nchcwewnfqawchjr7cu71iyi1.4-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: sort38_4411fb826fec X-Filterd-Recvd-Size: 2421 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 15:31:05 +0000 (UTC) IronPort-SDR: Mwh2RuMJdToJNzsp00EXaOmvDldvbXWG96IgQoCzbzrTLksATNQKwPDckrEProWWGmaEV2A9W+ /qX8KPc76xlw== X-IronPort-AV: E=McAfee;i="6000,8403,9711"; a="172021073" X-IronPort-AV: E=Sophos;i="5.76,304,1592895600"; d="scan'208";a="172021073" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 08:31:02 -0700 IronPort-SDR: CAcyA46brzt77YfVdkav3dOUG1QtqW8TnYd+26SQAVRwRm1bJZUJ4U3m5RhnGjFbncWGpNtAcq 8/fhXymRFDCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,304,1592895600"; d="scan'208";a="325107722" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 12 Aug 2020 08:31:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id BEEA515C; Wed, 12 Aug 2020 18:30:59 +0300 (EEST) From: Andy Shevchenko To: Andrew Morton , linux-mm@kvack.org Cc: Andy Shevchenko Subject: [PATCH v1] mm/dmapool.c: Replace open-coded list_first_entry() Date: Wed, 12 Aug 2020 18:30:59 +0300 Message-Id: <20200812153059.51089-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 610423760C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: There is a place in the code where open-coded version of list_first_entry() is used. Replace that with the standard macro. While here, separate definitions from the code to avoid a churn by janitors. Signed-off-by: Andy Shevchenko --- mm/dmapool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/dmapool.c b/mm/dmapool.c index f9fb9bbd733e..049ac1459714 100644 --- a/mm/dmapool.c +++ b/mm/dmapool.c @@ -283,8 +283,8 @@ void dma_pool_destroy(struct dma_pool *pool) while (!list_empty(&pool->page_list)) { struct dma_page *page; - page = list_entry(pool->page_list.next, - struct dma_page, page_list); + + page = list_first_entry(&pool->page_list, struct dma_page, page_list); if (is_page_busy(page)) { if (pool->dev) dev_err(pool->dev,