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


Groups > linux.kernel > #1710546 > unrolled thread

qustion about eeh_add_virt_device

Started byJulia Lawall <julia.lawall@lip6.fr>
First post2017-08-13 17:00 +0200
Last post2017-08-22 07:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  qustion about eeh_add_virt_device Julia Lawall <julia.lawall@lip6.fr> - 2017-08-13 17:00 +0200
    Re: qustion about eeh_add_virt_device Russell Currey <ruscur@russell.cc> - 2017-08-22 07:50 +0200

#1710546 — qustion about eeh_add_virt_device

FromJulia Lawall <julia.lawall@lip6.fr>
Date2017-08-13 17:00 +0200
Subjectqustion about eeh_add_virt_device
Message-ID<ue2wV-8qw-1@gated-at.bofh.it>
Hello,

At the suggestion of Christoph Hellwig, I am working on inlining the
functions stored in the err_handler field of a pci_driver structure into
the pci_driver structure itself.  A number of functions in the file
arch/powerpc/kernel/eeh_driver.c have code like:

        if (!driver->err_handler ||
            !driver->err_handler->error_detected) {
                eeh_pcid_put(dev);
                return NULL;
        }

This I would just convert to:

        if (!driver->error_detected) {
                eeh_pcid_put(dev);
                return NULL;
        }

But I am not sure what is best to do about eeh_add_virt_device, which
contains:

                if (driver->err_handler)
		        return NULL;

Should I try to find a subfield of the err_handler that is guaranteed to
be there if anything is there?  Or could the test just be dropped, leaving
a direct return NULL?

thanks,
julia

[toc] | [next] | [standalone]


#1717038

FromRussell Currey <ruscur@russell.cc>
Date2017-08-22 07:50 +0200
Message-ID<uhaeB-6o2-1@gated-at.bofh.it>
In reply to#1710546
On Sun, 2017-08-13 at 16:54 +0200, Julia Lawall wrote:
> Hello,

Hello, sorry for the delayed response.

> 
> At the suggestion of Christoph Hellwig, I am working on inlining the
> functions stored in the err_handler field of a pci_driver structure into
> the pci_driver structure itself.  A number of functions in the file
> arch/powerpc/kernel/eeh_driver.c have code like:
> 
>         if (!driver->err_handler ||
>             !driver->err_handler->error_detected) {
>                 eeh_pcid_put(dev);
>                 return NULL;
>         }
> 
> This I would just convert to:
> 
>         if (!driver->error_detected) {
>                 eeh_pcid_put(dev);
>                 return NULL;
>         }
> 
> But I am not sure what is best to do about eeh_add_virt_device, which
> contains:
> 
>                 if (driver->err_handler)
> 		        return NULL;
> 
> Should I try to find a subfield of the err_handler that is guaranteed to
> be there if anything is there?  Or could the test just be dropped, leaving
> a direct return NULL?

I believe the test can be dropped.

- Russell

> 
> thanks,
> julia

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web