From patchwork Sat May 22 19:53:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 101672 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 o4MJsfMl018639 for ; Sat, 22 May 2010 19:54:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758047Ab0EVTyZ (ORCPT ); Sat, 22 May 2010 15:54:25 -0400 Received: from mail-qy0-f183.google.com ([209.85.221.183]:39929 "EHLO mail-qy0-f183.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755773Ab0EVTyY (ORCPT ); Sat, 22 May 2010 15:54:24 -0400 Received: by qyk13 with SMTP id 13so3450137qyk.1 for ; Sat, 22 May 2010 12:54:24 -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=W37v8xrKbofULQTjeSo0tUeeKiXw5mw0xJXymaYpzQE=; b=fQBqG7t1ZOJjkIa7gVrSMJpCiPwDfmkbxGSVboDqHJXZmfSbFg3LWtPiC9efFlSRqz P1VguM5Mx/zjPEBnQs9pTf/CiV6dOiASb4vKHcuUxnzafKpukWmitWUKjbcJ3eKEEjGL kQWjmyYtoALuxzgDg5v8UNwpTI1InDHtJltSE= 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=YlLYrv0EPdKMeqfP26k8qKglmOr1nFyex4kc6TuAMY33J5QV4Cf942gUlXVmM1mzjE oRJhxTdDna6mFYys17QK4sArdonX46HyDlz81587U1cktfaIlwo7wvPg00vF/fNWHy6X Ae/CkBdvxra1sNJ7aS0/O1HS+msxKs17mMTsE= Received: by 10.224.58.152 with SMTP id g24mr2168008qah.382.1274558062658; Sat, 22 May 2010 12:54:22 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id 20sm1410601qyk.8.2010.05.22.12.54.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 22 May 2010 12:54:21 -0700 (PDT) Date: Sat, 22 May 2010 21:53:27 +0200 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Devin Heitmueller , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] em28xx: remove unneeded null checks Message-ID: <20100522194854.GH22515@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]); Sat, 22 May 2010 19:54:41 +0000 (UTC) diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 331e1ca..44c63cb 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -1186,8 +1186,7 @@ int em28xx_register_extension(struct em28xx_ops *ops) mutex_lock(&em28xx_devlist_mutex); list_add_tail(&ops->next, &em28xx_extension_devlist); list_for_each_entry(dev, &em28xx_devlist, devlist) { - if (dev) - ops->init(dev); + ops->init(dev); } printk(KERN_INFO "Em28xx: Initialized (%s) extension\n", ops->name); mutex_unlock(&em28xx_devlist_mutex); @@ -1201,10 +1200,8 @@ void em28xx_unregister_extension(struct em28xx_ops *ops) mutex_lock(&em28xx_devlist_mutex); list_for_each_entry(dev, &em28xx_devlist, devlist) { - if (dev) - ops->fini(dev); + ops->fini(dev); } - printk(KERN_INFO "Em28xx: Removed (%s) extension\n", ops->name); list_del(&ops->next); mutex_unlock(&em28xx_devlist_mutex);