Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1254636

Re: [PATCH v3 2/7] vfio: platform: add capability to register a reset function

From Eric Auger <eric.auger@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/7] vfio: platform: add capability to register a reset function
Date 2015-10-23 16:20 +0200
Message-ID <qmLmi-3Q4-17@gated-at.bofh.it> (permalink)
References <qmJNw-1va-13@gated-at.bofh.it> <qmJXc-1GX-9@gated-at.bofh.it> <qmKgz-2iZ-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/7] VFIO platform reset module rework Eric Auger <eric.auger@linaro.org> - 2015-10-23 14:40 +0200
  [PATCH v3 2/7] vfio: platform: add capability to register a reset function Eric Auger <eric.auger@linaro.org> - 2015-10-23 14:50 +0200
    Re: [PATCH v3 2/7] vfio: platform: add capability to register a reset function Arnd Bergmann <arnd@arndb.de> - 2015-10-23 15:10 +0200
      Re: [PATCH v3 2/7] vfio: platform: add capability to register a reset  function Eric Auger <eric.auger@linaro.org> - 2015-10-23 16:20 +0200
  [PATCH v3 1/7] vfio: platform: introduce vfio-platform-base module Eric Auger <eric.auger@linaro.org> - 2015-10-23 14:50 +0200
    Re: [PATCH v3 1/7] vfio: platform: introduce vfio-platform-base module Arnd Bergmann <arnd@arndb.de> - 2015-10-23 15:10 +0200

csiph-web