From patchwork Sun Mar 28 11:29:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 88753 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2SBTmNr029699 for ; Sun, 28 Mar 2010 11:29:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754154Ab0C1L3q (ORCPT ); Sun, 28 Mar 2010 07:29:46 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:59895 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647Ab0C1L3p (ORCPT ); Sun, 28 Mar 2010 07:29:45 -0400 Received: by mail-bw0-f209.google.com with SMTP id 1so2876701bwz.21 for ; Sun, 28 Mar 2010 04:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=dyYfd3oY7+cBTqPkArihUfZUO2GmrUypIXVJ8W0Pi4Y=; b=CLoddjXuEmr5Kscj7RWG2e9pXC/XdIsd3N2RJFVn7h4+OgEIwSGv1YHFdi/m1FHvl7 TTGgYcBVSPWsHn14QXEtmg4CrytkIecYTE4iHt0ntIGMGe1mVi18/vFyRlnAdq64ZxCo 3p9OXIif6TS/ni4KXfWU5grDgxV/ai8So9ufk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=CegxOzXnd8MxgIG1nUM+qb+AJ31CM2Ll5iCgwZc6PHymr6V4SeA0SeDqJCBduz+Cpr hWtI+ep9dpGK9qXJlXbkoTuUwtmhI4w93HG3TDtapwI2U5fl2dklFMWhM0vcJLvGf/0X +6DkWFQCM0GKyFEbRAFtURfFNNjZMHRNQDBB0= Received: by 10.204.48.136 with SMTP id r8mr2263696bkf.120.1269775783162; Sun, 28 Mar 2010 04:29:43 -0700 (PDT) Received: from bicker ([196.43.68.224]) by mx.google.com with ESMTPS id x16sm27234281bku.5.2010.03.28.04.29.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Mar 2010 04:29:42 -0700 (PDT) Date: Sun, 28 Mar 2010 14:29:35 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Srinivasa Deevi , Laurent Pinchart , Hans Verkuil , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] video/cx231xx: cleanup. remove unneed null checks Message-ID: <20100328112935.GQ5069@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 28 Mar 2010 11:29:48 +0000 (UTC) diff --git a/drivers/media/video/cx231xx/cx231xx-core.c b/drivers/media/video/cx231xx/cx231xx-core.c index 4a60dfb..866fb12 100644 --- a/drivers/media/video/cx231xx/cx231xx-core.c +++ b/drivers/media/video/cx231xx/cx231xx-core.c @@ -95,10 +95,9 @@ int cx231xx_register_extension(struct cx231xx_ops *ops) mutex_lock(&cx231xx_devlist_mutex); mutex_lock(&cx231xx_extension_devlist_lock); list_add_tail(&ops->next, &cx231xx_extension_devlist); - list_for_each_entry(dev, &cx231xx_devlist, devlist) { - if (dev) - ops->init(dev); - } + list_for_each_entry(dev, &cx231xx_devlist, devlist) + ops->init(dev); + printk(KERN_INFO DRIVER_NAME ": %s initialized\n", ops->name); mutex_unlock(&cx231xx_extension_devlist_lock); mutex_unlock(&cx231xx_devlist_mutex); @@ -111,10 +110,8 @@ void cx231xx_unregister_extension(struct cx231xx_ops *ops) struct cx231xx *dev = NULL; mutex_lock(&cx231xx_devlist_mutex); - list_for_each_entry(dev, &cx231xx_devlist, devlist) { - if (dev) - ops->fini(dev); - } + list_for_each_entry(dev, &cx231xx_devlist, devlist) + ops->fini(dev); mutex_lock(&cx231xx_extension_devlist_lock); printk(KERN_INFO DRIVER_NAME ": %s removed\n", ops->name);