From patchwork Mon Jul 22 18:04:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2831520 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BEF50C0319 for ; Mon, 22 Jul 2013 18:05:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E47A020283 for ; Mon, 22 Jul 2013 18:05:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECE5C2027D for ; Mon, 22 Jul 2013 18:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932623Ab3GVSF2 (ORCPT ); Mon, 22 Jul 2013 14:05:28 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:54459 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932264Ab3GVSF1 (ORCPT ); Mon, 22 Jul 2013 14:05:27 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MQC00C5HNL1WLS0@mailout1.samsung.com> for linux-media@vger.kernel.org; Tue, 23 Jul 2013 03:05:26 +0900 (KST) X-AuditID: cbfee61b-b7efe6d000007b11-14-51ed7466f339 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 50.79.31505.6647DE15; Tue, 23 Jul 2013 03:05:26 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MQC00AGGNK2Y9A0@mmp1.samsung.com>; Tue, 23 Jul 2013 03:05:26 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: g.liakhovetski@gmx.de, prabhakar.csengg@gmail.com, laurent.pinchart@ideasonboard.com, hverkuil@xs4all.nl, kyungmin.park@samsung.com, Sylwester Nawrocki Subject: [PATCH RFC 1/5] V4L2: Drop bus_type check in v4l2-async match functions Date: Mon, 22 Jul 2013 20:04:43 +0200 Message-id: <1374516287-7638-2-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1374516287-7638-1-git-send-email-s.nawrocki@samsung.com> References: <1374516287-7638-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOLMWRmVeSWpSXmKPExsVy+t9jAd20kreBBk8mqlm83ziPyeLU5GdM Fmeb3rBbdE5cwm7Rs2Erq8XL+yuYLQ6/aWd1YPfYOesuu8eHj3Eesztmsnr0bVnF6PF5k5zH qa+f2QPYorhsUlJzMstSi/TtErgyJjdOZyq4xlVx5OE2tgbGKZxdjJwcEgImElNPvmKDsMUk LtxbD2RzcQgJLGKU+HClnR3C6WCS+PX1IVgVm4ChRO/RPkYQW0RAXuJJ7w2wDmaBHYwSLfP/ giWEBQIkDiw6CWRzcLAIqEpM6pEHCfMKuEos+PIMLCwhoCAxZ5INSJhTwE3i4s12FhBbCKhk +oQvLBMYeRcwMqxiFE0tSC4oTkrPNdIrTswtLs1L10vOz93ECA6uZ9I7GFc1WBxiFOBgVOLh 9fB+GyjEmlhWXJl7iFGCg1lJhHejHlCINyWxsiq1KD++qDQntfgQozQHi5I478FW60AhgfTE ktTs1NSC1CKYLBMHp1QDo2nv4zuzHGIXhwfxyNz7uzPK6jlrkD/TrMaAHR/4Oi+d3r3nuaBv tc8Whq6GXo9QL9dFh76mOE+eX/v+w4/qDbs1Hj3wO+ut1smkvu/RocDpfB9tV50seLLptPEN qw9prkkR5UkKq33c3TN+6CayCXkvXbj6Wdn/o9eWty3xnMS6dPW3Bb9TfimxFGckGmoxFxUn AgBRDQNSKgIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 These match_* functions are internal callbacks and are always invoked only after checking asd->bus_type. So drop redundant checks in match_i2c() and match_platform() functions. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- drivers/media/v4l2-core/v4l2-async.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index aae2417..ff87c29 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -27,7 +27,6 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) #if IS_ENABLED(CONFIG_I2C) struct i2c_client *client = i2c_verify_client(dev); return client && - asd->bus_type == V4L2_ASYNC_BUS_I2C && asd->match.i2c.adapter_id == client->adapter->nr && asd->match.i2c.address == client->addr; #else @@ -37,8 +36,7 @@ static bool match_i2c(struct device *dev, struct v4l2_async_subdev *asd) static bool match_platform(struct device *dev, struct v4l2_async_subdev *asd) { - return asd->bus_type == V4L2_ASYNC_BUS_PLATFORM && - !strcmp(asd->match.platform.name, dev_name(dev)); + return !strcmp(asd->match.platform.name, dev_name(dev)); } static LIST_HEAD(subdev_list);