From patchwork Mon May 4 08:07:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 6323641 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 28B6BBEEE5 for ; Mon, 4 May 2015 08:07:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 367C5202DD for ; Mon, 4 May 2015 08:07:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45FBE202D1 for ; Mon, 4 May 2015 08:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752056AbbEDIHs (ORCPT ); Mon, 4 May 2015 04:07:48 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:36510 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409AbbEDIHo (ORCPT ); Mon, 4 May 2015 04:07:44 -0400 Received: by lagv1 with SMTP id v1so98792151lag.3; Mon, 04 May 2015 01:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kKWEt/1KNBWcw5OK1Hl/g38cUp/ZBfJ02BdzN6YPiD4=; b=aMNhim7a9rJCkjiHPm6GEwfxaJRrB5MbugZTqpmlVqJ+x9TfkUvJX7VDqnBo9EWHQe hKpiT1nym+vP+rAeJ9Y4+V0Rh3nIYdDYkDk8yYoaIbFnI1AsFY6V4yGcVcyxzQiKuShP FyEpkT9mclEQnYOb6H3h2K0+DrCiy0nWFMvs2nJg34Li6XwIgMg+L3LVWWh6mKIPFqoF oUGGmAzVKUt3hEdPMdl9vqrIP8wBwJ3kYDfqj91hU8wrLDRt3URIWPE7D5ulboOnZPdk 1/AxkuwHh3MiL497sJVwHMP2UrbZPWSt7o5RFtsW+8Yll4PWSaeuOk2YbKwl7MAOxb3n opCw== X-Received: by 10.112.220.34 with SMTP id pt2mr18641822lbc.81.1430726862299; Mon, 04 May 2015 01:07:42 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by mx.google.com with ESMTPSA id og9sm239159lbb.22.2015.05.04.01.07.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 May 2015 01:07:41 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , Mauro Carvalho Chehab , Laurent Pinchart , Sakari Ailus , Ramakrishnan Muthukrishnan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 4/4] media/vivid: Code cleanout Date: Mon, 4 May 2015 10:07:32 +0200 Message-Id: <1430726852-11715-5-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1430726852-11715-1-git-send-email-ricardo.ribalda@gmail.com> References: <1430726852-11715-1-git-send-email-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Remove code duplication by merging two cases in a switch. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/platform/vivid/vivid-tpg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index 2e5129a6bc2f..8cac0bdefd9a 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -294,6 +294,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) } switch (fourcc) { + case V4L2_PIX_FMT_GREY: case V4L2_PIX_FMT_RGB332: tpg->twopixelsize[0] = 2; break; @@ -333,9 +334,6 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) case V4L2_PIX_FMT_YUV32: tpg->twopixelsize[0] = 2 * 4; break; - case V4L2_PIX_FMT_GREY: - tpg->twopixelsize[0] = 2; - break; case V4L2_PIX_FMT_NV12: case V4L2_PIX_FMT_NV21: case V4L2_PIX_FMT_NV12M: