Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752293AbdHMOyk (ORCPT ); Sun, 13 Aug 2017 10:54:40 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:11004 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751074AbdHMOyj (ORCPT ); Sun, 13 Aug 2017 10:54:39 -0400 X-IronPort-AV: E=Sophos;i="5.41,368,1498514400"; d="scan'208";a="286924156" Date: Sun, 13 Aug 2017 16:54:37 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: ruscur@russell.cc, 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 Subject: qustion about eeh_add_virt_device Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 907 Lines: 32 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