From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Romanick Subject: Re: [PATCH 04/13] drm/cirrus: Remove unecessary NULL check in gem_free Date: Mon, 07 Apr 2014 08:25:49 -0700 Message-ID: <5342C37D.6080308@freedesktop.org> References: <1396691102-22904-1-git-send-email-daniel.vetter@ffwll.ch> <1396691102-22904-6-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from q7.q7.com (q7.q7.com [69.168.48.248]) by gabe.freedesktop.org (Postfix) with ESMTP id AAC546E6C7 for ; Mon, 7 Apr 2014 08:25:58 -0700 (PDT) In-Reply-To: <1396691102-22904-6-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter , DRI Development Cc: Dave Jones List-Id: dri-devel@lists.freedesktop.org On 04/05/2014 02:44 AM, Daniel Vetter wrote: > The ->gem_free_object never gets called with a NULL pointer, the check > is redundant. Also checking after the upcast allows compilers to elide > it anyway. > > Spotted by coverity. > > Signed-off-by: Daniel Vetter Same as MGA change. Reviewed-by: Ian Romanick > --- > drivers/gpu/drm/cirrus/cirrus_main.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c b/drivers/gpu/drm/cirrus/cirrus_main.c > index b119f66fed92..99c1983f99d2 100644 > --- a/drivers/gpu/drm/cirrus/cirrus_main.c > +++ b/drivers/gpu/drm/cirrus/cirrus_main.c > @@ -271,8 +271,6 @@ void cirrus_gem_free_object(struct drm_gem_object *obj) > { > struct cirrus_bo *cirrus_bo = gem_to_cirrus_bo(obj); > > - if (!cirrus_bo) > - return; > cirrus_bo_unref(&cirrus_bo); > } > >