From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: add check for valid init_clock_gating-pointer Date: Sun, 19 Jun 2011 21:04:29 +0100 Message-ID: <013811$h8fkv@fmsmga002.fm.intel.com> References: <1308176679-13766-1-git-send-email-w.sang@pengutronix.de> <20110615153000.00438750@jbarnes-desktop> <20110616132846.GE23579@pengutronix.de> <20110616081557.5f64f603@jbarnes-desktop> <20110619192211.GA23889@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id BD2859E8A8 for ; Sun, 19 Jun 2011 13:04:32 -0700 (PDT) In-Reply-To: <20110619192211.GA23889@pengutronix.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Wolfram Sang Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Sun, 19 Jun 2011 21:22:11 +0200, Wolfram Sang wrote: > On Thu, Jun 16, 2011 at 04:47:53PM +0100, Chris Wilson wrote: > > On Thu, 16 Jun 2011 08:15:57 -0700, Jesse Barnes wrote: > > > On Thu, 16 Jun 2011 15:28:46 +0200 > > > Wolfram Sang wrote: > > > > How about BUG_ON(!ptr) in the init-routine for a bit more grace? And/or > > > > a warning in the else-block? It seems to happen to users... > > > > > > Yeah, a BUG_ON would be fine. > > > > if (WARN_ON(!ptr, "no display vtable")) > > return -ENODEV; > > That would mean converting the involved void-functions to int to propagate the > error (intel_init_clock_gating, intel_modeset_init). Not a big deal, but quite > intrusive. Do you really mean that? A choice between a BUG_ON and error propagation? Choose error propagation, one day it will be for real. ;-) -Chris -- Chris Wilson, Intel Open Source Technology Centre