From: Daniel Vetter Subject: Re: [PATCH 06/12] drm: fix __alpha__ PCI lookup Date: Wed, 23 Jul 2014 21:29:48 +0200 Message-ID: <20140723192948.GB15237@phenom.ffwll.local> References: <1406129207-1302-1-git-send-email-dh.herrmann@gmail.com> <1406129207-1302-7-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A06B6E696 for ; Wed, 23 Jul 2014 12:29:40 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id l18so1639696wgh.14 for ; Wed, 23 Jul 2014 12:29:38 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1406129207-1302-7-git-send-email-dh.herrmann@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Herrmann Cc: Daniel Vetter , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Jul 23, 2014 at 05:26:41PM +0200, David Herrmann wrote: > Testing the return value of list_entry() for NULL is a no-op (as it is > just a fancy container_of() / offsetof()). Drop the superfluous if-clause > and instead verify the actual root-node is available. This is probably > what it was meant to test for from the beginning, anyway. > > Signed-off-by: David Herrmann Oh drm handling of alpha. I've tried to dig out how this all works together and it's dangerous. drm totally ignored this thing called dma api so needed to handle cpu phys address vs. bus address offsets itself. If you munge around also in the agp code (which is really only used by drm) then you'll notice that it's handled completely differently on alpha vs. ppc. Tbh I'd wait until this is all officially dead and then rip it all out. -Daniel > --- > drivers/gpu/drm/drm_fops.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c > index a402061..afba0bf 100644 > --- a/drivers/gpu/drm/drm_fops.c > +++ b/drivers/gpu/drm/drm_fops.c > @@ -330,11 +330,11 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor) > dev->hose = pci_dev->sysdata; > pci_dev_put(pci_dev); > } > - if (!dev->hose) { > + > + if (!dev->hose && pci_root_buses.next) { > struct pci_bus *b = list_entry(pci_root_buses.next, > - struct pci_bus, node); > - if (b) > - dev->hose = b->sysdata; > + struct pci_bus, node); > + dev->hose = b->sysdata; > } > } > #endif > -- > 2.0.2 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch