From patchwork Fri Aug 7 10:21:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 6967481 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1C32C9F358 for ; Fri, 7 Aug 2015 10:21:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C9102068C for ; Fri, 7 Aug 2015 10:21:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5A27A2068A for ; Fri, 7 Aug 2015 10:21:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F41A6E041; Fri, 7 Aug 2015 03:21:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id BB47D6E041 for ; Fri, 7 Aug 2015 03:21:09 -0700 (PDT) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from nuc-i3427.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 43289350-1500048 for multiple; Fri, 07 Aug 2015 11:21:24 +0100 Received: by nuc-i3427.alporthouse.com (sSMTP sendmail emulation); Fri, 07 Aug 2015 11:21:03 +0100 Date: Fri, 7 Aug 2015 11:21:03 +0100 From: Chris Wilson To: Michel Thierry Message-ID: <20150807102103.GD6924@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Michel Thierry , Daniel Vetter , kbuild test robot , Akash Goel , Ben Widawsky , intel-gfx , kbuild-all@01.org References: <201508070425.kWGyPwY9%fengguang.wu@intel.com> <55C4789E.3080906@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <55C4789E.3080906@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Ben Widawsky , Daniel Vetter , intel-gfx , Akash Goel , kbuild-all@01.org, kbuild test robot Subject: Re: [Intel-gfx] [drm-intel:for-linux-next 479/497] drivers/gpu/drm/i915/i915_gem_gtt.c:1086:26: sparse: Using plain integer as NULL pointer X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Aug 07, 2015 at 10:21:34AM +0100, Michel Thierry wrote: > On 8/6/2015 11:00 PM, Daniel Vetter wrote: > >On Thu, Aug 6, 2015 at 10:17 PM, kbuild test robot > > wrote: > >> 1070 if (IS_ENABLED(CONFIG_X86_32)) > >> 1071 /* While we have a proliferation of size_t variables > >> 1072 * we cannot represent the full ppgtt size on 32bit, > >> 1073 * so limit it to the same size as the GGTT (currently > >> 1074 * 2GiB). > >> 1075 */ > >> 1076 ppgtt->base.total = to_i915(ppgtt->base.dev)->gtt.base.total; > >> 1077 ppgtt->base.cleanup = gen8_ppgtt_cleanup; > >> 1078 ppgtt->base.allocate_va_range = gen8_alloc_va_range; > >> 1079 ppgtt->base.insert_entries = gen8_ppgtt_insert_entries; > >> 1080 ppgtt->base.clear_range = gen8_ppgtt_clear_range; > >> 1081 ppgtt->base.unbind_vma = ppgtt_unbind_vma; > >> 1082 ppgtt->base.bind_vma = ppgtt_bind_vma; > >> 1083 > >> 1084 ppgtt->switch_mm = gen8_mm_switch; > >> 1085 > >>>1086 ret = __pdp_init(false, &ppgtt->pdp); > > > >So the first argument of pdp_init ist struct drm_device *dev and yes > >the first thing it does is deref it. > > > > *dev is used only for I915_PDPES_PER_PDP/USES_FULL_48BIT_PPGTT, > which in this path is always false. I didn't expect kbuild to > complain. I'll change it with the other modifications I'm about to > send. Wrong. dev is never deferenced even though it is passed around. diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 41c5e7c9c8ab..37283d5a8a4a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2549,12 +2549,12 @@ struct drm_i915_cmd_table { #define HAS_HW_CONTEXTS(dev) (INTEL_INFO(dev)->gen >= 6) #define HAS_LOGICAL_RING_CONTEXTS(dev) (INTEL_INFO(dev)->gen >= 8) -#define USES_PPGTT(dev) (i915.enable_ppgtt) -#define USES_FULL_PPGTT(dev) (i915.enable_ppgtt >= 2) +#define USES_PPGTT() (i915.enable_ppgtt) +#define USES_FULL_PPGTT() (i915.enable_ppgtt >= 2) #ifdef CONFIG_X86_64 -# define USES_FULL_48BIT_PPGTT(dev) (i915.enable_ppgtt == 3) +# define USES_FULL_48BIT_PPGTT() (i915.enable_ppgtt == 3) #else -# define USES_FULL_48BIT_PPGTT(dev) false +# define USES_FULL_48BIT_PPGTT() false #endif -Chris