[v3] media: atomisp: pci: sh_css: Inline single invocation of macro STATS_ENABLED()
Message ID | 20230120171408.16099-1-bpappas@pappasbrent.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp326622wrn; Fri, 20 Jan 2023 09:24:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXuWLdxYzT3g4KD3kMtHhTMjyG7j8mB9DnLqDwVdMCCdt/wuCTXWMryd9wRyA+0bObrL3Dfs X-Received: by 2002:a17:907:d110:b0:7ae:8194:7e06 with SMTP id uy16-20020a170907d11000b007ae81947e06mr18429932ejc.56.1674235490545; Fri, 20 Jan 2023 09:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674235490; cv=none; d=google.com; s=arc-20160816; b=lWA4/JHLcQ+gPIyj2ouPq1jVzHVOCnDcJze0W7i1P3GxSBWBTEXja54md/Glj9dmlD O26HeTO6wU1h5qPkIKiR/SIX6j7YLgUNQ3rj+Jhj1LRQsHs1WqeqOLX65SG8USCgZTOn ZUYY05WXiEFNt2gPN+o6Esl06NOtZTM75lDnyOvkWMiZRPiNAF9tdUTcv3Xv4Fy3F+au EWdXYdgnrme4+babXbVQKlQsbYxfxLxtk1Xekqw3K5gb0gtteJ0YU+DKkgubmpedO7tp zaAlOV/AQo0k1V/FxxDY9Z5PpHsWuw0LKffQRuxfMqbGwoQgj6Mg/UXsWB7nS4x/0mP7 HJLg== 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=glfsyMfiDpMnVMPik4nNEztrcs192016N8D6JN4QT0c=; b=OT9pWt9W0ktMu/Qf/tEszJwjqCG9srPg6uuG9hxLjQ0YagxqHpZT2u/IrpA8pm89j6 4BtwcTN1lWICI2f+I4sciJjIOuoyDgWA/3myFQf+JJT5IdtUKBQ8xnTSYUirJm1V1GyI ljUlvxS4LLaPTXjSWsqCRwUubhQN/U2WJDU7n7grGqO69PSpf0KyvQw7PAMStFWFpGU5 IKhoFQckZq7MUO0o5lQ+v6IWYG3uPrYecwSw+JBbaHHziIjbnNmhYLVCcIUrFejBrq6D Z7iAlu8dmLlxLUFoDafERfH7z7VsCWMJx5tpkr04s8Hwk83XXru5rAMbbYH92ykojSzr xEJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@pappasbrent.com header.s=default header.b=BMEAomSd; 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 nc35-20020a1709071c2300b0086f5bf2b3afsi4280235ejc.395.2023.01.20.09.24.27; Fri, 20 Jan 2023 09:24:50 -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=BMEAomSd; 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 S229782AbjATROr (ORCPT <rfc822;forouhar.linux@gmail.com> + 99 others); Fri, 20 Jan 2023 12:14:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbjATROq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Jan 2023 12:14:46 -0500 Received: from MTA-05-3.privateemail.com (mta-05-3.privateemail.com [68.65.122.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5722794CAA; Fri, 20 Jan 2023 09:14:37 -0800 (PST) Received: from mta-05.privateemail.com (localhost [127.0.0.1]) by mta-05.privateemail.com (Postfix) with ESMTP id B4AF218000A8; Fri, 20 Jan 2023 12:14:36 -0500 (EST) Received: from bpappas-XPS-13-9310.. (rrcs-24-173-168-34.se.biz.rr.com [24.173.168.34]) by mta-05.privateemail.com (Postfix) with ESMTPA id 7282A18000A3; Fri, 20 Jan 2023 12:14:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pappasbrent.com; s=default; t=1674234876; bh=XhRnErx/eCRnzYjBxFH5JC5AofWxMframtiYYl67Vks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BMEAomSdT7IP091Ak8NqDlzZL4cUvOdzcKIrGF1w3PUKxsHahTekoYTWUZztJkj4Y +1v85fApZ+vUt5OPSDguDw1cZm3w62vwz30tC4jGnyLEnMja/caiVcWQGPVUSHdffi ByrvcaAT5vbDhZILlNzh3Zr2xAP2l+nCClxB/19IcNycm5svsUzbv7KGkh4e1qzpx+ 0vy00Qixx3A+/L52+4oPeUMe70q3c1nbyAwE6Jn83cCUuEDIuFPXcjDdmkYqKchUVm jjauVWSEnsCA7zbSwjrewdIEv85SYotjpq2kspqVc3a6fvj0DoVCc3hN1dyyY9M8Vu 4et2tH1F9ltJA== From: Brent Pappas <bpappas@pappasbrent.com> To: error27@gmail.com Cc: andy.shevchenko@gmail.com, 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 v3] media: atomisp: pci: sh_css: Inline single invocation of macro STATS_ENABLED() Date: Fri, 20 Jan 2023 12:14:08 -0500 Message-Id: <20230120171408.16099-1-bpappas@pappasbrent.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <Y8lZreSphK6DIkJg@kadam> References: <Y8lZreSphK6DIkJg@kadam> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> 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?1755563153773440705?= |
Series |
[v3] media: atomisp: pci: sh_css: Inline single invocation of macro STATS_ENABLED()
|
|
Commit Message
Brent Pappas
Jan. 20, 2023, 5:14 p.m. UTC
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 <bpappas@pappasbrent.com>
---
Changelog:
V1 -> V2: Inline macro instead of replacing it with a function.
V2 -> V3: Remove unnecessary check that stage is non-null.
drivers/staging/media/atomisp/pci/sh_css.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Comments
On Fri, Jan 20, 2023 at 7:14 PM Brent Pappas <bpappas@pappasbrent.com> wrote: > > Inline the single invocation of the macro STATS_ENABLED(). > The macro abstraction is not necessary because the logic behind it is only > used once. LGTM, Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Signed-off-by: Brent Pappas <bpappas@pappasbrent.com> > --- > Changelog: > V1 -> V2: Inline macro instead of replacing it with a function. > > V2 -> V3: Remove unnecessary check that stage is non-null. > > 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->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, > -- > 2.34.1 >
On Fri, Jan 20, 2023 at 12:14:08PM -0500, Brent Pappas wrote: > 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 <bpappas@pappasbrent.com> > --- > Changelog: > V1 -> V2: Inline macro instead of replacing it with a function. > > V2 -> V3: Remove unnecessary check that stage is non-null. > Thanks! Reviewed-by: Dan Carpenter <error27@gmail.com> regards, dan carpenter
Hi, On 1/20/23 18:14, Brent Pappas wrote: > 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 <bpappas@pappasbrent.com> Thank you. I have added this to my personal git tree now and I will include this in the atomisp driver pull-req which I will send to the media-subsystem maintainer in a couple of weeks. Regards, Hans > --- > Changelog: > V1 -> V2: Inline macro instead of replacing it with a function. > > V2 -> V3: Remove unnecessary check that stage is non-null. > > 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->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,
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->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,