From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427002AbeBORID (ORCPT ); Thu, 15 Feb 2018 12:08:03 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:5654 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1423255AbeBORIA (ORCPT ); Thu, 15 Feb 2018 12:08:00 -0500 Subject: Re: [PATCH v13 7/9] ACPI: Translate the I/O range of non-MMIO devices before scanning To: Andy Shevchenko References: <1518543933-22456-1-git-send-email-john.garry@huawei.com> <1518543933-22456-8-git-send-email-john.garry@huawei.com> CC: Mika Westerberg , "Rafael J. Wysocki" , Lorenzo Pieralisi , "Rafael J. Wysocki" , Hanjun Guo , "Rob Herring" , Bjorn Helgaas , "Arnd Bergmann" , Mark Rutland , Olof Johansson , Dann Frazier , Rob Herring , Joe Perches , Benjamin Herrenschmidt , , "Linux Kernel Mailing List" , ACPI Devel Maling List , Linuxarm , Corey Minyard , devicetree , Linux-Arch , Randy Dunlap From: John Garry Message-ID: <59e5293f-0ea5-12f4-27db-b13bbcf0918b@huawei.com> Date: Thu, 15 Feb 2018 17:07:24 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.238] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/02/2018 16:16, Andy Shevchenko wrote: > Another approach is to use ~0UL if that is preferable. > >>>> >>> + list_for_each_entry(rentry, &resource_list, node) >>>> >>> + resources[count++] = *rentry->res; >>> >> It has similarities with acpi_create_platform_device(). >>> >> I guess we can utilize existing code. >> > For sure, this particular segment is effectively same as part of >> > acpi_create_platform_device(): > Not the same, acpi_create_platform_device() does a bit more than > copying the resources. If it indeed makes no hurt... > >> > list_for_each_entry(rentry, &resource_list, node) >> > acpi_platform_fill_resource(adev, rentry->res, >> > &resources[count++]); >> > So is your idea to refactor this common segment into a helper function? > ...I would go with helper. > Hi Andy, Since the plan now is that this code is no longer going to be added to drivers/acpi, but instead pushed to the LLDD, I am pondering whether we should still factor out of this common code. Opinion? Thanks, John >>>> >>> + char *name = &acpi_indirect_io_mfd_cell[count].name[0];