linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: brijesh.singh@amd.com, devicetree@vger.kernel.org,
	airlied@linux.ie, linux-pci@vger.kernel.org,
	richard.weiyang@gmail.com, keith.busch@intel.com,
	jcmvbkbc@gmail.com, baiyaowei@cmss.chinamobile.com,
	frowand.list@gmail.com, lorenzo.pieralisi@arm.com,
	sthemmin@microsoft.com, linux-nvdimm@lists.01.org,
	patrik.r.jakobsson@gmail.com, linux-input@vger.kernel.org,
	gustavo@padovan.org, dyoung@redhat.com, vgoyal@redhat.com,
	thomas.lendacky@amd.com, haiyangz@microsoft.com,
	maarten.lankhorst@linux.intel.com, jglisse@redhat.com,
	seanpaul@chromium.org, bhelgaas@google.com, tglx@linutronix.de,
	yinghai@kernel.org, jonathan.derrick@intel.com, chris@zankel.net,
	monstr@monstr.eu, linux-parisc@vger.kernel.org,
	gregkh@linuxfoundation.org, dmitry.torokhov@gmail.com,
	kexec@lists.infradead.org, ebiederm@xmission.com,
	devel@linuxdriverproject.org, linuxppc-dev@lists.ozlabs.org,
	davem@davemloft.net, kbuild-all@01.org
Subject: Re: [PATCH v5 2/4] resource: Use list_head to link sibling resource
Date: Wed, 13 Jun 2018 14:55:47 +0800	[thread overview]
Message-ID: <20180613065547.GH1820@MiWiFi-R3L-srv> (raw)
In-Reply-To: <alpine.DEB.2.20.1806121708070.3334@hadrien>

On 06/12/18 at 05:10pm, Julia Lawall wrote:
> This looks wrong.  After a list iterator, the index variable points to a
> dummy structure.
> 
> julia
> 
> url:    https://github.com/0day-ci/linux/commits/Baoquan-He/resource-Use-list_head-to-link-sibling-resource/20180612-113600
> :::::: branch date: 7 hours ago
> :::::: commit date: 7 hours ago
> 
> >> kernel/resource.c:265:17-20: ERROR: invalid reference to the index variable of the iterator on line 253
> 
> # https://github.com/0day-ci/linux/commit/e906f15906750a86913ba2b1f08bad99129d3dfc
> git remote add linux-review https://github.com/0day-ci/linux
> git remote update linux-review
> git checkout e906f15906750a86913ba2b1f08bad99129d3dfc
> vim +265 kernel/resource.c
> 
> ^1da177e4 Linus Torvalds 2005-04-16  247
> 5eeec0ec9 Yinghai Lu     2009-12-22  248  static void __release_child_resources(struct resource *r)
> 5eeec0ec9 Yinghai Lu     2009-12-22  249  {
> e906f1590 Baoquan He     2018-06-12  250  	struct resource *tmp, *next;
> 5eeec0ec9 Yinghai Lu     2009-12-22  251  	resource_size_t size;
> 5eeec0ec9 Yinghai Lu     2009-12-22  252
> e906f1590 Baoquan He     2018-06-12 @253  	list_for_each_entry_safe(tmp, next, &r->child, sibling) {
> 5eeec0ec9 Yinghai Lu     2009-12-22  254  		tmp->parent = NULL;
> e906f1590 Baoquan He     2018-06-12  255  		INIT_LIST_HEAD(&tmp->sibling);

							list_del_init(&tmp->sibling);

Thanks, Julia. Here I should use list_del_init(&op->list) to
replace INIT_LIST_HEAD(&tmp->sibling). 

> 5eeec0ec9 Yinghai Lu     2009-12-22  256  		__release_child_resources(tmp);
> 5eeec0ec9 Yinghai Lu     2009-12-22  257
> 5eeec0ec9 Yinghai Lu     2009-12-22  258  		printk(KERN_DEBUG "release child resource %pR\n", tmp);
> 5eeec0ec9 Yinghai Lu     2009-12-22  259  		/* need to restore size, and keep flags */
> 5eeec0ec9 Yinghai Lu     2009-12-22  260  		size = resource_size(tmp);
> 5eeec0ec9 Yinghai Lu     2009-12-22  261  		tmp->start = 0;
> 5eeec0ec9 Yinghai Lu     2009-12-22  262  		tmp->end = size - 1;
> 5eeec0ec9 Yinghai Lu     2009-12-22  263  	}
> e906f1590 Baoquan He     2018-06-12  264
> e906f1590 Baoquan He     2018-06-12 @265  	INIT_LIST_HEAD(&tmp->child);
> 5eeec0ec9 Yinghai Lu     2009-12-22  266  }
> 5eeec0ec9 Yinghai Lu     2009-12-22  267
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

  reply	other threads:[~2018-06-13  6:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 15:10 [PATCH v5 2/4] resource: Use list_head to link sibling resource Julia Lawall
2018-06-13  6:55 ` Baoquan He [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-12  3:28 [PATCH v5 0/4] " Baoquan He
2018-06-12  3:28 ` [PATCH v5 2/4] " Baoquan He
2018-06-12  4:37   ` kbuild test robot
2018-06-12  4:49   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180613065547.GH1820@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=airlied@linux.ie \
    --cc=baiyaowei@cmss.chinamobile.com \
    --cc=bhelgaas@google.com \
    --cc=brijesh.singh@amd.com \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --cc=devel@linuxdriverproject.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@padovan.org \
    --cc=haiyangz@microsoft.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jglisse@redhat.com \
    --cc=jonathan.derrick@intel.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=keith.busch@intel.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=monstr@monstr.eu \
    --cc=patrik.r.jakobsson@gmail.com \
    --cc=richard.weiyang@gmail.com \
    --cc=seanpaul@chromium.org \
    --cc=sthemmin@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=vgoyal@redhat.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).