Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753466AbdHVFo7 (ORCPT ); Tue, 22 Aug 2017 01:44:59 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55807 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbdHVFo6 (ORCPT ); Tue, 22 Aug 2017 01:44:58 -0400 X-ME-Sender: X-Sasl-enc: GY9CAN266JF+pJi+7P/djHtC79y9PuqpQ9Ph+thAd1Yo 1503380696 Message-ID: <1503380692.7369.0.camel@russell.cc> Subject: Re: qustion about eeh_add_virt_device From: Russell Currey To: Julia Lawall , benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: hch@infradead.org Date: Tue, 22 Aug 2017 15:44:52 +1000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1115 Lines: 41 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