[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <562A40EA.40706@linaro.org>
Date: Fri, 23 Oct 2015 16:15:06 +0200
From: Eric Auger <eric.auger@...aro.org>
To: Arnd Bergmann <arnd@...db.de>, linux-arm-kernel@...ts.infradead.org
Cc: eric.auger@...com, alex.williamson@...hat.com,
b.reynal@...tualopensystems.com, kvmarm@...ts.cs.columbia.edu,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
christoffer.dall@...aro.org, patches@...aro.org
Subject: Re: [PATCH v3 2/7] vfio: platform: add capability to register a reset
function
On 10/23/2015 03:07 PM, Arnd Bergmann wrote:
> On Friday 23 October 2015 14:37:10 Eric Auger wrote:
>> +
>> +void vfio_platform_unregister_reset(const char *compat)
>> +{
>> + struct vfio_platform_reset_node *iter, *temp;
>> +
>> + mutex_lock(&driver_lock);
>> + list_for_each_entry_safe(iter, temp, &reset_list, link) {
>> + if (!strcmp(iter->compat, compat)) {
>> + list_del(&iter->link);
>> + break;
>> + }
>> + }
>> +
>> + mutex_unlock(&driver_lock);
>> +}
>> +EXPORT_SYMBOL_GPL(vfio_platform_unregister_reset);
>>
>
> This is slightly unsafe in case you ever get two drivers that register
> with the same compat string. If we care about that, we could pass
> and compare both the string and the function pointer, or the
> vfio_platform_reset_node.
OK
Thanks
Eric
>
> Arnd
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists