From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41L75w2ZVSzF1Qp for ; Wed, 4 Jul 2018 14:18:44 +1000 (AEST) Date: Wed, 4 Jul 2018 12:18:34 +0800 From: Baoquan He To: Andy Shevchenko Cc: Linux Kernel Mailing List , Andrew Morton , Rob Herring , Dan Williams , Nicolas Pitre , Josh Triplett , kbuild test robot , Borislav Petkov , Patrik Jakobsson , David Airlie , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Dmitry Torokhov , Frank Rowand , Keith Busch , Jon Derrick , Lorenzo Pieralisi , Bjorn Helgaas , Thomas Gleixner , brijesh.singh@amd.com, =?iso-8859-1?B?Suly9G1l?= Glisse , Tom Lendacky , Greg Kroah-Hartman , baiyaowei@cmss.chinamobile.com, richard.weiyang@gmail.com, devel@linuxdriverproject.org, linux-input , linux-nvdimm@lists.01.org, devicetree , linux-pci@vger.kernel.org, Eric Biederman , Vivek Goyal , Dave Young , Yinghai Lu , kexec@lists.infradead.org, Michal Simek , "David S. Miller" , Chris Zankel , Max Filippov , Gustavo Padovan , Maarten Lankhorst , Sean Paul , linux-parisc@vger.kernel.org, "open list:LINUX FOR POWERPC PA SEMI PWRFICIENT" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: Re: [PATCH v5 1/4] resource: Move reparent_resources() to kernel/resource.c and make it public Message-ID: <20180704041834.GA2762@MiWiFi-R3L-srv> References: <20180612032831.29747-1-bhe@redhat.com> <20180612032831.29747-2-bhe@redhat.com> <20180612093812.GC1820@MiWiFi-R3L-srv> <20180703145503.GA1225@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 07/03/18 at 11:57pm, Andy Shevchenko wrote: > On Tue, Jul 3, 2018 at 5:55 PM, Baoquan He wrote: > > On 06/12/18 at 05:24pm, Andy Shevchenko wrote: > >> On Tue, Jun 12, 2018 at 5:20 PM, Andy Shevchenko > >> wrote: > > >> > I briefly looked at the code and error codes we have, so, my proposal > >> > is one of the following > >> > >> > - use -ECANCELED (not the best choice for first occurrence here, > >> > though I can't find better) > >> > >> Actually -ENOTSUPP might suit the first case (although the actual > >> would be something like -EOVERLAP, which we don't have) > > > > Sorry for late reply, and many thanks for your great suggestion. > > > > > I am fine to use -ENOTSUPP as the first returned value, and -ECANCELED > > for the 2nd one. > > I have no strong opinion, but I like (slightly better) this approach ^^^ Done, post v6 in this way, many thanks. > > > Or define an enum as you suggested inside the function > > or in header file. > > > > > Or use -EBUSY for the first case because existing resource is > > overlapping but not fully contained by 'res'; and -EINVAL for > > the 2nd case since didn't find any one resources which is contained by > > 'res', means we passed in a invalid resource. > > > > All is fine to me, I can repost with each of them. > > >> > - use positive integers (or enum), like > >> > #define RES_REPARENTED 0 > >> > #define RES_OVERLAPPED 1 > >> > #define RES_NOCONFLICT 2 > > -- > With Best Regards, > Andy Shevchenko