From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE06CC43217 for ; Tue, 8 Nov 2022 13:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233705AbiKHNG4 (ORCPT ); Tue, 8 Nov 2022 08:06:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234291AbiKHNGv (ORCPT ); Tue, 8 Nov 2022 08:06:51 -0500 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35EEFA468; Tue, 8 Nov 2022 05:06:50 -0800 (PST) Received: by mail-qk1-f181.google.com with SMTP id z30so8974313qkz.13; Tue, 08 Nov 2022 05:06:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LI5tKvQ3xbrBkw4pUpaVa/1GYtcIna1PWM17WCwqkc4=; b=va+HiDmHMsNkjzcg1PqsywD6KByihnSiyvZhMV/t3REDkf7Ce4xmjiv/Eh/o1/oFM7 DHPFpa+KG7bP3+A7p4iLHPN6BY5adUFJxjhBlwvn7Ji9oEisQcKRIb0sxSSz8PHe1bZN 7heSGr5CuviYAOCW/GD0Z8parrX3YBeuwb0sdM5NL5qJYaFr2G+EuKyDIPPhy6s0jV4v HAvzfV/z2InpgMReBarycPg9ySODQiv9JMhCks1yCgU97IpjATRlEP9pjsUc6/+fwByR 7dXNZ6osjITFece0P86LA/VuLlsjoFYxZcC3oA8lUA2WL1qqquCdiyAwYni6gdsliz03 H6Lw== X-Gm-Message-State: ACrzQf1NgCOO+pUdwzYekenKujMJE12v5wZr15H2qp3SLYBAQahTrKVg eASY1CB0JdzKW0TMwO0cmxY9tYLmaG+G1EJUg3oLe6jb X-Google-Smtp-Source: AMsMyM6mWnv7hmiQNfBMlQvN6ojeFaZNX36NmVT47vgzqWz5SZt+WPWZwPyHGmH0W/MgDOOVPQhecxo4I04uf7M7HcI= X-Received: by 2002:a05:620a:d89:b0:6cf:c98b:744c with SMTP id q9-20020a05620a0d8900b006cfc98b744cmr38188547qkl.443.1667912809286; Tue, 08 Nov 2022 05:06:49 -0800 (PST) MIME-Version: 1.0 References: <7ce6bd54.f8.184570dd1b6.Coremail.wangkailong@jari.cn> In-Reply-To: <7ce6bd54.f8.184570dd1b6.Coremail.wangkailong@jari.cn> From: "Rafael J. Wysocki" Date: Tue, 8 Nov 2022 14:06:36 +0100 Message-ID: Subject: Re: [PATCH] ACPICA: Fix return To: wangkailong@jari.cn Cc: Moore , "Rafael J. Wysocki" , Wentland , Li , Siqueira , Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , Airlie , Vetter , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Tue, Nov 8, 2022 at 12:48 PM wrote: > > return is not a function, parentheses are not required > > Signed-off-by: KaiLong Wang ACPICA material is to be submitted to the upstream project at GitHub (please see MAINTAINERS for the link). You may notice, however, that your changes do not align with the coding style there. Moreover, the patch contains non-ACPICA changes that are not mentioned in the changelog. > --- > drivers/acpi/acpica/evsci.c | 12 +++++------- > drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 17 +++++++---------- > 2 files changed, 12 insertions(+), 17 deletions(-) > > diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c > index 3915ff61412b..63dd2aa2d16a 100644 > --- a/drivers/acpi/acpica/evsci.c > +++ b/drivers/acpi/acpica/evsci.c > @@ -38,9 +38,8 @@ u32 acpi_ev_sci_dispatch(void) > > /* Are there any host-installed SCI handlers? */ > > - if (!acpi_gbl_sci_handler_list) { > - return (int_status); > - } > + if (!acpi_gbl_sci_handler_list) > + return int_status; > > flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); > > @@ -57,7 +56,7 @@ u32 acpi_ev_sci_dispatch(void) > } > > acpi_os_release_lock(acpi_gbl_gpe_lock, flags); > - return (int_status); > + return int_status; > } > > /******************************************************************************* > @@ -193,9 +192,8 @@ acpi_status acpi_ev_remove_all_sci_handlers(void) > acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt, > acpi_ev_sci_xrupt_handler); > > - if (!acpi_gbl_sci_handler_list) { > - return (status); > - } > + if (!acpi_gbl_sci_handler_list) > + return status; > > flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > index 38d71b5c1f2d..66661a20117b 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > @@ -29,7 +29,6 @@ > #include "core_types.h" > #include "resource.h" > #include "ipp.h" > -#include "timing_generator.h" > #include "dc_dmub_srv.h" > > #define DC_LOGGER dc->ctx->logger > @@ -152,9 +151,8 @@ static void dc_stream_free(struct kref *kref) > > void dc_stream_release(struct dc_stream_state *stream) > { > - if (stream != NULL) { > + if (stream != NULL) > kref_put(&stream->refcount, dc_stream_free); > - } > } > > struct dc_stream_state *dc_create_stream_for_sink( > @@ -316,11 +314,11 @@ bool dc_stream_set_cursor_attributes( > struct dc *dc; > bool reset_idle_optimizations = false; > > - if (NULL == stream) { > + if (stream == NULL) { > dm_error("DC: dc_stream is NULL!\n"); > return false; > } > - if (NULL == attributes) { > + if (attributes == NULL) { > dm_error("DC: attributes is NULL!\n"); > return false; > } > @@ -399,12 +397,12 @@ bool dc_stream_set_cursor_position( > struct dc *dc = stream->ctx->dc; > bool reset_idle_optimizations = false; > > - if (NULL == stream) { > + if (stream == NULL) { > dm_error("DC: dc_stream is NULL!\n"); > return false; > } > > - if (NULL == position) { > + if (position == NULL) { > dm_error("DC: cursor position is NULL!\n"); > return false; > } > @@ -468,9 +466,8 @@ bool dc_stream_add_writeback(struct dc *dc, > } > } > > - if (!isDrc) { > + if (!isDrc) > stream->writeback_info[stream->num_wb_info++] = *wb_info; > - } > > if (dc->hwss.enable_writeback) { > struct dc_stream_status *stream_status = dc_stream_get_status(stream); > @@ -526,7 +523,7 @@ bool dc_stream_remove_writeback(struct dc *dc, > /* remove writeback info for disabled writeback pipes from stream */ > for (i = 0, j = 0; i < stream->num_wb_info; i++) { > if (stream->writeback_info[i].wb_enabled) { > - if (j < i) > + if (i != j) > /* trim the array */ > stream->writeback_info[j] = stream->writeback_info[i]; > j++; > -- > 2.36.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B616C433FE for ; Tue, 8 Nov 2022 13:06:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 557D110E0C7; Tue, 8 Nov 2022 13:06:54 +0000 (UTC) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56A4610E0C7; Tue, 8 Nov 2022 13:06:50 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id i9so8981114qki.10; Tue, 08 Nov 2022 05:06:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LI5tKvQ3xbrBkw4pUpaVa/1GYtcIna1PWM17WCwqkc4=; b=GBpp36WjmE4kGMUUhxp84WyeKTn5LRcR6znluXB1o2CQlhorvQXAdhVlWKkSfgM3TG tSoMhTcnSx+pv+o6fIZzTPgazb05XggoVmya0ZPVO8R62iEXJXFmb2l9vPHhTPSsLLIz gHfWppGhePiDcgswLU1J/yD90/fXFtuUtsINKP70hQIui7Vky+uS0iks4r8eKDYGjYQL ePafWa+kE24V+OZPZq517KxG4t5fLNuOGdQn/iU3gLVf47/UR5+/9cL69tuxoCvy6LFl cbJK3NsnT50LeLc9ni3RioWOY9uKKVMvIG+X7Rv6wtSWYu3gC4RRLS5kYdAadJqS5WVX GJiw== X-Gm-Message-State: ACrzQf0R+t7DD3x2LQFbtTF3ud2vOT7JrE4Ta9/V2pzJ2toEb4bdNRDd uzs4nOMr68Qlt+3S8AaiDAJS2m2ey6RJNj1esHk= X-Google-Smtp-Source: AMsMyM6mWnv7hmiQNfBMlQvN6ojeFaZNX36NmVT47vgzqWz5SZt+WPWZwPyHGmH0W/MgDOOVPQhecxo4I04uf7M7HcI= X-Received: by 2002:a05:620a:d89:b0:6cf:c98b:744c with SMTP id q9-20020a05620a0d8900b006cfc98b744cmr38188547qkl.443.1667912809286; Tue, 08 Nov 2022 05:06:49 -0800 (PST) MIME-Version: 1.0 References: <7ce6bd54.f8.184570dd1b6.Coremail.wangkailong@jari.cn> In-Reply-To: <7ce6bd54.f8.184570dd1b6.Coremail.wangkailong@jari.cn> From: "Rafael J. Wysocki" Date: Tue, 8 Nov 2022 14:06:36 +0100 Message-ID: Subject: Re: [PATCH] ACPICA: Fix return To: wangkailong@jari.cn Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Pan, Xinhui" , Li , "Rafael J. Wysocki" , Siqueira , Moore , amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Nov 8, 2022 at 12:48 PM wrote: > > return is not a function, parentheses are not required > > Signed-off-by: KaiLong Wang ACPICA material is to be submitted to the upstream project at GitHub (please see MAINTAINERS for the link). You may notice, however, that your changes do not align with the coding style there. Moreover, the patch contains non-ACPICA changes that are not mentioned in the changelog. > --- > drivers/acpi/acpica/evsci.c | 12 +++++------- > drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 17 +++++++---------- > 2 files changed, 12 insertions(+), 17 deletions(-) > > diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c > index 3915ff61412b..63dd2aa2d16a 100644 > --- a/drivers/acpi/acpica/evsci.c > +++ b/drivers/acpi/acpica/evsci.c > @@ -38,9 +38,8 @@ u32 acpi_ev_sci_dispatch(void) > > /* Are there any host-installed SCI handlers? */ > > - if (!acpi_gbl_sci_handler_list) { > - return (int_status); > - } > + if (!acpi_gbl_sci_handler_list) > + return int_status; > > flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); > > @@ -57,7 +56,7 @@ u32 acpi_ev_sci_dispatch(void) > } > > acpi_os_release_lock(acpi_gbl_gpe_lock, flags); > - return (int_status); > + return int_status; > } > > /******************************************************************************* > @@ -193,9 +192,8 @@ acpi_status acpi_ev_remove_all_sci_handlers(void) > acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt, > acpi_ev_sci_xrupt_handler); > > - if (!acpi_gbl_sci_handler_list) { > - return (status); > - } > + if (!acpi_gbl_sci_handler_list) > + return status; > > flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > index 38d71b5c1f2d..66661a20117b 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > @@ -29,7 +29,6 @@ > #include "core_types.h" > #include "resource.h" > #include "ipp.h" > -#include "timing_generator.h" > #include "dc_dmub_srv.h" > > #define DC_LOGGER dc->ctx->logger > @@ -152,9 +151,8 @@ static void dc_stream_free(struct kref *kref) > > void dc_stream_release(struct dc_stream_state *stream) > { > - if (stream != NULL) { > + if (stream != NULL) > kref_put(&stream->refcount, dc_stream_free); > - } > } > > struct dc_stream_state *dc_create_stream_for_sink( > @@ -316,11 +314,11 @@ bool dc_stream_set_cursor_attributes( > struct dc *dc; > bool reset_idle_optimizations = false; > > - if (NULL == stream) { > + if (stream == NULL) { > dm_error("DC: dc_stream is NULL!\n"); > return false; > } > - if (NULL == attributes) { > + if (attributes == NULL) { > dm_error("DC: attributes is NULL!\n"); > return false; > } > @@ -399,12 +397,12 @@ bool dc_stream_set_cursor_position( > struct dc *dc = stream->ctx->dc; > bool reset_idle_optimizations = false; > > - if (NULL == stream) { > + if (stream == NULL) { > dm_error("DC: dc_stream is NULL!\n"); > return false; > } > > - if (NULL == position) { > + if (position == NULL) { > dm_error("DC: cursor position is NULL!\n"); > return false; > } > @@ -468,9 +466,8 @@ bool dc_stream_add_writeback(struct dc *dc, > } > } > > - if (!isDrc) { > + if (!isDrc) > stream->writeback_info[stream->num_wb_info++] = *wb_info; > - } > > if (dc->hwss.enable_writeback) { > struct dc_stream_status *stream_status = dc_stream_get_status(stream); > @@ -526,7 +523,7 @@ bool dc_stream_remove_writeback(struct dc *dc, > /* remove writeback info for disabled writeback pipes from stream */ > for (i = 0, j = 0; i < stream->num_wb_info; i++) { > if (stream->writeback_info[i].wb_enabled) { > - if (j < i) > + if (i != j) > /* trim the array */ > stream->writeback_info[j] = stream->writeback_info[i]; > j++; > -- > 2.36.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76F08C433FE for ; Tue, 8 Nov 2022 13:07:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7084110E44D; Tue, 8 Nov 2022 13:06:55 +0000 (UTC) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56A4610E0C7; Tue, 8 Nov 2022 13:06:50 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id i9so8981114qki.10; Tue, 08 Nov 2022 05:06:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LI5tKvQ3xbrBkw4pUpaVa/1GYtcIna1PWM17WCwqkc4=; b=GBpp36WjmE4kGMUUhxp84WyeKTn5LRcR6znluXB1o2CQlhorvQXAdhVlWKkSfgM3TG tSoMhTcnSx+pv+o6fIZzTPgazb05XggoVmya0ZPVO8R62iEXJXFmb2l9vPHhTPSsLLIz gHfWppGhePiDcgswLU1J/yD90/fXFtuUtsINKP70hQIui7Vky+uS0iks4r8eKDYGjYQL ePafWa+kE24V+OZPZq517KxG4t5fLNuOGdQn/iU3gLVf47/UR5+/9cL69tuxoCvy6LFl cbJK3NsnT50LeLc9ni3RioWOY9uKKVMvIG+X7Rv6wtSWYu3gC4RRLS5kYdAadJqS5WVX GJiw== X-Gm-Message-State: ACrzQf0R+t7DD3x2LQFbtTF3ud2vOT7JrE4Ta9/V2pzJ2toEb4bdNRDd uzs4nOMr68Qlt+3S8AaiDAJS2m2ey6RJNj1esHk= X-Google-Smtp-Source: AMsMyM6mWnv7hmiQNfBMlQvN6ojeFaZNX36NmVT47vgzqWz5SZt+WPWZwPyHGmH0W/MgDOOVPQhecxo4I04uf7M7HcI= X-Received: by 2002:a05:620a:d89:b0:6cf:c98b:744c with SMTP id q9-20020a05620a0d8900b006cfc98b744cmr38188547qkl.443.1667912809286; Tue, 08 Nov 2022 05:06:49 -0800 (PST) MIME-Version: 1.0 References: <7ce6bd54.f8.184570dd1b6.Coremail.wangkailong@jari.cn> In-Reply-To: <7ce6bd54.f8.184570dd1b6.Coremail.wangkailong@jari.cn> From: "Rafael J. Wysocki" Date: Tue, 8 Nov 2022 14:06:36 +0100 Message-ID: Subject: Re: [PATCH] ACPICA: Fix return To: wangkailong@jari.cn Content-Type: text/plain; charset="UTF-8" X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Pan, Xinhui" , Li , Airlie , "Rafael J. Wysocki" , Siqueira , Moore , amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Vetter , Deucher , Wentland , =?UTF-8?Q?Christian_K=C3=B6nig?= Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Tue, Nov 8, 2022 at 12:48 PM wrote: > > return is not a function, parentheses are not required > > Signed-off-by: KaiLong Wang ACPICA material is to be submitted to the upstream project at GitHub (please see MAINTAINERS for the link). You may notice, however, that your changes do not align with the coding style there. Moreover, the patch contains non-ACPICA changes that are not mentioned in the changelog. > --- > drivers/acpi/acpica/evsci.c | 12 +++++------- > drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 17 +++++++---------- > 2 files changed, 12 insertions(+), 17 deletions(-) > > diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c > index 3915ff61412b..63dd2aa2d16a 100644 > --- a/drivers/acpi/acpica/evsci.c > +++ b/drivers/acpi/acpica/evsci.c > @@ -38,9 +38,8 @@ u32 acpi_ev_sci_dispatch(void) > > /* Are there any host-installed SCI handlers? */ > > - if (!acpi_gbl_sci_handler_list) { > - return (int_status); > - } > + if (!acpi_gbl_sci_handler_list) > + return int_status; > > flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); > > @@ -57,7 +56,7 @@ u32 acpi_ev_sci_dispatch(void) > } > > acpi_os_release_lock(acpi_gbl_gpe_lock, flags); > - return (int_status); > + return int_status; > } > > /******************************************************************************* > @@ -193,9 +192,8 @@ acpi_status acpi_ev_remove_all_sci_handlers(void) > acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt, > acpi_ev_sci_xrupt_handler); > > - if (!acpi_gbl_sci_handler_list) { > - return (status); > - } > + if (!acpi_gbl_sci_handler_list) > + return status; > > flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > index 38d71b5c1f2d..66661a20117b 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c > @@ -29,7 +29,6 @@ > #include "core_types.h" > #include "resource.h" > #include "ipp.h" > -#include "timing_generator.h" > #include "dc_dmub_srv.h" > > #define DC_LOGGER dc->ctx->logger > @@ -152,9 +151,8 @@ static void dc_stream_free(struct kref *kref) > > void dc_stream_release(struct dc_stream_state *stream) > { > - if (stream != NULL) { > + if (stream != NULL) > kref_put(&stream->refcount, dc_stream_free); > - } > } > > struct dc_stream_state *dc_create_stream_for_sink( > @@ -316,11 +314,11 @@ bool dc_stream_set_cursor_attributes( > struct dc *dc; > bool reset_idle_optimizations = false; > > - if (NULL == stream) { > + if (stream == NULL) { > dm_error("DC: dc_stream is NULL!\n"); > return false; > } > - if (NULL == attributes) { > + if (attributes == NULL) { > dm_error("DC: attributes is NULL!\n"); > return false; > } > @@ -399,12 +397,12 @@ bool dc_stream_set_cursor_position( > struct dc *dc = stream->ctx->dc; > bool reset_idle_optimizations = false; > > - if (NULL == stream) { > + if (stream == NULL) { > dm_error("DC: dc_stream is NULL!\n"); > return false; > } > > - if (NULL == position) { > + if (position == NULL) { > dm_error("DC: cursor position is NULL!\n"); > return false; > } > @@ -468,9 +466,8 @@ bool dc_stream_add_writeback(struct dc *dc, > } > } > > - if (!isDrc) { > + if (!isDrc) > stream->writeback_info[stream->num_wb_info++] = *wb_info; > - } > > if (dc->hwss.enable_writeback) { > struct dc_stream_status *stream_status = dc_stream_get_status(stream); > @@ -526,7 +523,7 @@ bool dc_stream_remove_writeback(struct dc *dc, > /* remove writeback info for disabled writeback pipes from stream */ > for (i = 0, j = 0; i < stream->num_wb_info; i++) { > if (stream->writeback_info[i].wb_enabled) { > - if (j < i) > + if (i != j) > /* trim the array */ > stream->writeback_info[j] = stream->writeback_info[i]; > j++; > -- > 2.36.1