From patchwork Tue Nov 22 14:34:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9441297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 368FF600BA for ; Tue, 22 Nov 2016 14:35:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2940628547 for ; Tue, 22 Nov 2016 14:35:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DE2C2858A; Tue, 22 Nov 2016 14:35:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0DC9F28588 for ; Tue, 22 Nov 2016 14:35:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FFE46E4D3; Tue, 22 Nov 2016 14:35:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 000C76E4D3 for ; Tue, 22 Nov 2016 14:35:06 +0000 (UTC) Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lnlkd-1cg2TO3075-00hrve; Tue, 22 Nov 2016 15:34:49 +0100 From: Arnd Bergmann To: Daniel Vetter Subject: [PATCH] vgaarb: use valid dev pointer in vgaarb_info() Date: Tue, 22 Nov 2016 15:34:19 +0100 Message-Id: <20161122143445.1896558-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:/stbG3cnBxr2qt4rB/cYkS1KdMMif4wCwHoM/xBeMkHsadjwH59 qoPWAcuz2+V36r9Xz4wHdQPBn2O+oIyfgtHKWgJ5yWAksD6Edb2Vc3Li0OYcHPzPFLVVx4D PjaHtcnVb0jyfKrlBrxoGR7bzKijdJ0WVDRYM3OkAAGv9R2qnB21xAnhjJLKJKiCIFencrH Jt0Rcy2o8nlyeQ6grGEAA== X-UI-Out-Filterresults: notjunk:1; V01:K0:avXz1FrybFU=:Y7zcJ7W4YToY2QROZPOXrT du18G/dWzYH/BG7QjgVO0mndW33zt+rev3eA8cQJikAPSwY3BWGKwVDsc6n3cY8+o1hxylTZI q8MUBvnELR0IqzOMHoW6AdipvJqvr8LNI9utBm4eemCMWp7xAkJDRiRzgP/wEsANpquyaA6u+ iMjZCuMbnI1Rzz1q3wCx2wY1DINHuyN2+7NN9Mf4gdfEM+0VAhCVEg01r5GDN7uJToqQ1lXvp VAZsUR54+ugCCDGM0lXjTCiT1o1+PIiR/4rHKuQhCXEOiDe+IwVAFts+bHm+lwrYAd1Ms65f9 O+Rgy1qSMEaTwHve8T12l9vAMwBX0hDmwGxSSBAc04mllmpi3R64f25AbLd0X+yxhXz/7rPGg SV4dZeR6Xr9ZTNsN05blAI4W0+stA32B2PXm5JHb2hiYz6RwhtgJhIX/u2F3L3EpWPiH6jXY3 DwdsEtAVDIKfUZJ9f26hTGFHVZuyHM+DgWcSTNlavVvWCoCBOGod0wrZChY74mxq54H02bfe8 q8Ylv32Mcqfk3ejWWGlN6wVoJd1QpJMKbdU3JM7F799uzrEQlEE9t3RcFoNVwf+ew8iF6bKro 4F1Fe/p4zAn6E2UtR8SmJclecbR3F20jrGjur/W49goq7FdpLx1JlE59oljtoOya3f0hgrsIG slwLBN+bneQnTLJjbwWZnx0+7EkuDmu00AaO5ef43s/x1CNI8o4fhUGmNpGFHlHewX5o= Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Bjorn Helgaas , Dave Airlie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We now pass the device to the debug messages, but on non-x86, this is an invalid pointer in vga_arb_device_init: drivers/gpu/vga/vgaarb.c: In function 'vga_arb_device_init': drivers/gpu/vga/vgaarb.c:1467:4: error: 'dev' may be used uninitialized in this function [-Werror=maybe-uninitialized] This moves the initialization of the dev pointer outside of the architecture #ifdef. Fixes: a75d68f62106 ("vgaarb: Use dev_printk() when possible") Signed-off-by: Arnd Bergmann --- drivers/gpu/vga/vgaarb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index b3d27182edd9..0f5b2dd24507 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -1407,7 +1407,6 @@ static int __init vga_arb_device_init(void) int rc; struct pci_dev *pdev; struct vga_device *vgadev; - struct device *dev; rc = misc_register(&vga_arb_device); if (rc < 0) @@ -1424,6 +1423,7 @@ static int __init vga_arb_device_init(void) vga_arbiter_add_pci_device(pdev); list_for_each_entry(vgadev, &vga_list, list) { + struct device *dev = &vgadev->pdev->dev; #if defined(CONFIG_X86) || defined(CONFIG_IA64) /* * Override vga_arbiter_add_pci_device()'s I/O based detection @@ -1438,7 +1438,6 @@ static int __init vga_arb_device_init(void) int i; limit = screen_info.lfb_base + screen_info.lfb_size; - dev = &vgadev->pdev->dev; /* Does firmware framebuffer belong to us? */ for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {