From patchwork Thu Jan 19 14:42:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Pappas X-Patchwork-Id: 45822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp366594wrn; Thu, 19 Jan 2023 06:47:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXuqm10Th+MBLylALEHZOF095SX962Ai3DgBldzXDPEJSUaHCuvl9OsheVjOnI1UAlpUpECS X-Received: by 2002:a05:6a20:8f02:b0:af:c871:bf4b with SMTP id b2-20020a056a208f0200b000afc871bf4bmr15631718pzk.26.1674139624097; Thu, 19 Jan 2023 06:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674139624; cv=none; d=google.com; s=arc-20160816; b=07OIFuMo34YPCL3I/x7KXwOq2IyWivlNmAxbzZPbrhJidKJTvmwgHvnagQ3kVOIxTy Q67XS4O/tpJlThqpqgc6c+nT7wOcJwca7P0rvlgPSCNiuWd9w8i6goYjdLJFAmQRh76U Vnw2fFgRBvGwF3/OQ9xnHb4USceOFECgYOiewRIjt53447Cd1PeVd7L1h67qNVAr9WfD H9Xni5rZLP3lzHK19OwT/KJowSUBD/k0cZbtArtioyfJLEMAjh+3DRPLP5d1JYjrBKoK Xdfja4JC/Qeczih4hJ1yLd+Hh1GrNTMJOhF3Kh6aJNwsalsf/sySbB5yyCNGUZisDZNF MLQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CTqAKkNy9JKc8s9cY0z4qliWYdSe4auDpG5YYx8WVdM=; b=oUIQDGk+wTQXal0FGFT9uv3F54pO/JypPR2kBLInitYvLeV2djWYc4mbxqzualZeCQ bSyVVfqBoEXl30tYJOmdBaQ7TJq8fJbosljYbLf4AndYvYPVu7fn7xDKoTFJsb+evwqC 3v81HB9A5Ct7NR69SbD8Q4xA7sTRNGaB1zPHUVWUdi+7POxvZZZndFHrOFVvNL0agDs+ HSWAFHyrEdXKxfdohiSYsXhkgBpuOuZPjoAVIqugO8yg8Im/J9pLyKDpc1bnEwMuDyay gkIdEKOMlqLyHxnogZUN/jxL/zZ9nzcveLrRRZpUirn6JyiTm4sPfUg3cj9Iv6V2TxFE HD7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@pappasbrent.com header.s=default header.b=nOXLzkyo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l65-20020a639144000000b004cfc40121easi7181139pge.24.2023.01.19.06.46.50; Thu, 19 Jan 2023 06:47:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@pappasbrent.com header.s=default header.b=nOXLzkyo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbjASOqO (ORCPT + 99 others); Thu, 19 Jan 2023 09:46:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbjASOpk (ORCPT ); Thu, 19 Jan 2023 09:45:40 -0500 Received: from MTA-10-4.privateemail.com (mta-10-4.privateemail.com [198.54.122.149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6EA287580; Thu, 19 Jan 2023 06:42:49 -0800 (PST) Received: from mta-10.privateemail.com (localhost [127.0.0.1]) by mta-10.privateemail.com (Postfix) with ESMTP id 5914618000A8; Thu, 19 Jan 2023 09:42:29 -0500 (EST) Received: from bpappas-XPS-13-9310.ucf.edu (050-088-208-136.res.spectrum.com [50.88.208.136]) by mta-10.privateemail.com (Postfix) with ESMTPA id 42B2218000A6; Thu, 19 Jan 2023 09:42:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pappasbrent.com; s=default; t=1674139349; bh=OvjuU8Er9NffYgNl0xuyyr+JSQYsrtMIdTAEnQq5WTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nOXLzkyosRaBdcMN0ZtH9/fbx+5YhAyqwHHv5q6hJa62Uz3nqSUeMi5h/tCyIRMyK 4vHtnIVbhL5ijYpmiIk1adATGuASKjFzwenkc1dejLQdaFvQ3LtLvkHUTejSknAHDY RIoQmrHhhEwWG1c47UaYT4r2q7KW4TxnoL85j+Yv2ROaWHz1yzCHJkj69k0UKiiAgQ gvlXQINieg7EN7utJaTLzAllIGXjeUqz6vDFKnoa9FEUz4/UOQw7aQ/Q2js2zUCuPs 61Brz1d7i3QnXi4ctGq66B7xRRa3KmDTurjw2QZrcHDx+yXaLKvxWbXBIAl4Ep7++T 4QGtk6eRF9IdQ== From: Brent Pappas To: andy.shevchenko@gmail.com Cc: andy@kernel.org, bpappas@pappasbrent.com, colin.i.king@gmail.com, gregkh@linuxfoundation.org, hdegoede@redhat.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, mchehab@kernel.org, sakari.ailus@linux.intel.com Subject: [PATCH v2] media: atomisp: pci: sh_css: Inline single invocation of macro STATS_ENABLED() Date: Thu, 19 Jan 2023 09:42:03 -0500 Message-Id: <20230119144203.17084-1-bpappas@pappasbrent.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SORTED_RECIPS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755462630548743213?= X-GMAIL-MSGID: =?utf-8?q?1755462630548743213?= Inline the single invocation of the macro STATS_ENABLED(). The macro abstraction is not necessary because the logic behind it is only used once. Signed-off-by: Brent Pappas --- drivers/staging/media/atomisp/pci/sh_css.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index 726cb7aa4ecd..93789500416f 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -97,9 +97,6 @@ */ #define JPEG_BYTES (16 * 1024 * 1024) -#define STATS_ENABLED(stage) (stage && stage->binary && stage->binary->info && \ - (stage->binary->info->sp.enable.s3a || stage->binary->info->sp.enable.dis)) - struct sh_css my_css; int __printf(1, 0) (*sh_css_printf)(const char *fmt, va_list args) = NULL; @@ -3743,7 +3740,9 @@ ia_css_pipe_enqueue_buffer(struct ia_css_pipe *pipe, * The SP will read the params after it got * empty 3a and dis */ - if (STATS_ENABLED(stage)) { + if (stage && stage->binary && stage->binary->info && + (stage->binary->info->sp.enable.s3a || + stage->binary->info->sp.enable.dis)) { /* there is a stage that needs it */ return_err = ia_css_bufq_enqueue_buffer(thread_id, queue_id,