From patchwork Wed Sep 13 09:15:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 9950783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C4C86024A for ; Wed, 13 Sep 2017 09:16:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E8CE2904E for ; Wed, 13 Sep 2017 09:16:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23956290BF; Wed, 13 Sep 2017 09:16:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_SPAM,RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB5CA2904E for ; Wed, 13 Sep 2017 09:16:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752127AbdIMJQJ (ORCPT ); Wed, 13 Sep 2017 05:16:09 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:37301 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdIMJQF (ORCPT ); Wed, 13 Sep 2017 05:16:05 -0400 Received: by mail-pg0-f68.google.com with SMTP id v5so7377163pgn.4; Wed, 13 Sep 2017 02:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yAK53rNuTN1PDS+WcTtlGpsRpLZ6dM4Lf6Fm27Fko2A=; b=fzxwbGT+DuYoA0UZNnIZjf0vznaSLyjLA8UP8e6cYPrZYwAS7pRS5tQEYy+fA/Z5sq gQPsARsrjG6H30c42fRCiK3yp0t3Ynvo8DvxAgw2A8LZV4+DYjzgVpTJNRUZBB3MSVQ8 9Oj/J/C+Z40E6Hz4YjIJqFz1v+BMZQuyHGavFMM4gGWLJ8wD3AnPciLZYpZVZtCWrR4x OwpbVo7nMX+HKOgBS+e1SeU1B3eG4vhXATe7MMrx0b90CkYp3mXC9z2+OrhOXYl9WwTb 5DzLnjTTe1NjeExC0AJC7hu6BlcMukRCSMjnwazbZm1irOe/f0qran20B5TEWEqhbqZ5 atNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yAK53rNuTN1PDS+WcTtlGpsRpLZ6dM4Lf6Fm27Fko2A=; b=I2CIE109PDYAxK/PY1vlTWOG8BaVOOUuNnRL7r2kNs971SPOzT9HWaoXqzA8U8GCX8 W0Ic35C/HGCoiH4PfaQ5kyDRTVVLHcL7l6RHVniCp0CuTWjmhy/RFDt0ME3s3HrAlozc 2vbSOUFVHLlKpke6/Qll2nTP1nCHYJ7EIM1s/h7RJQu9YPLNQfaFJsW5qmJVzOyw+gF8 12u0YZsTcY87x0SUKtmYhm8/cAV3zjQrleA/oUvyWBvbDGjSiIExpEwoQJL8ds+qN6yW xbIbhYwFy7+isgo/mdUI7CxR7wfJia/CJCiFJdl8jERkjekZ83mbK3zbcJvCGcdwqfgJ 824Q== X-Gm-Message-State: AHPjjUg6tTEvpbwteZcb3Cy6Gu5ia6Bf8CHopdXCv28qj6qS6AJwvyC9 6diW4M3EGahXMUvjFLqA5A== X-Google-Smtp-Source: ADKCNb6OrjW0WCphXmk3/bpdCuXuV3g6gN9E09gvmAekmNzRdGBCrvnpI/w+pTm83S4w7FAGdsAvdg== X-Received: by 10.99.121.129 with SMTP id u123mr17730498pgc.246.1505294164819; Wed, 13 Sep 2017 02:16:04 -0700 (PDT) Received: from localhost.localdomain ([103.42.74.194]) by smtp.gmail.com with ESMTPSA id i63sm26949616pfk.34.2017.09.13.02.16.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Sep 2017 02:16:03 -0700 (PDT) From: Allen Pais To: linux-kernel@vger.kernel.org Cc: mchehab@kernel.org, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Allen Pais Subject: [PATCH v4] [media]atomisp:use ARRAY_SIZE() instead of open coding. Date: Wed, 13 Sep 2017 14:45:58 +0530 Message-Id: <1505294158-28408-1-git-send-email-allen.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The array_length() macro just duplicates ARRAY_SIZE(), so we can delete it. v4: Update the commit message. Signed-off-by: Allen Pais --- drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c index e882b55..bee3043 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c @@ -451,8 +451,6 @@ static enum ia_css_frame_format yuv422_copy_formats[] = { IA_CSS_FRAME_FORMAT_YUYV }; -#define array_length(array) (sizeof(array)/sizeof(array[0])) - /* Verify whether the selected output format is can be produced * by the copy binary given the stream format. * */ @@ -468,7 +466,7 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe) switch (pipe->stream->config.input_config.format) { case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: case IA_CSS_STREAM_FORMAT_YUV420_8: - for (i=0; i