lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_NyK_O=CypSz+WrAbM2MpsP_7D2RjB6JAu_qmyEnAVc6Q@mail.gmail.com>
Date:   Mon, 16 Jan 2023 12:57:15 -0500
From:   Alex Deucher <alexdeucher@...il.com>
To:     Deepak R Varma <drv@...lo.com>
Cc:     Harry Wentland <harry.wentland@....com>,
        Leo Li <sunpeng.li@....com>,
        Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        "Pan, Xinhui" <Xinhui.Pan@....com>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>, amd-gfx@...ts.freedesktop.org,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Praveen Kumar <kumarpraveen@...ux.microsoft.com>,
        Saurabh Singh Sengar <ssengar@...rosoft.com>
Subject: Re: [PATCH] drm/amd/display: use swap() helper macro in bios_parser

Applied.  Thanks!

On Sun, Jan 15, 2023 at 4:26 AM Deepak R Varma <drv@...lo.com> wrote:
>
> Use swap() helper macro instead of open coded swap instructions. The
> change also facilitates code cleanup and realignment for improved
> readability.  Issue identified using swap.cocci Coccinelle semantic
> patch script.
>
> Signed-off-by: Deepak R Varma <drv@...lo.com>
> ---
>  drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
> index 074e70a5c458..7b5894adbf51 100644
> --- a/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
> +++ b/drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
> @@ -2929,7 +2929,6 @@ static enum bp_result construct_integrated_info(
>         struct atom_common_table_header *header;
>         struct atom_data_revision revision;
>
> -       struct clock_voltage_caps temp = {0, 0};
>         uint32_t i;
>         uint32_t j;
>
> @@ -3032,14 +3031,8 @@ static enum bp_result construct_integrated_info(
>         for (i = 1; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
>                 for (j = i; j > 0; --j) {
>                         if (info->disp_clk_voltage[j].max_supported_clk <
> -                               info->disp_clk_voltage[j-1].max_supported_clk
> -                               ) {
> -                               /* swap j and j - 1*/
> -                               temp = info->disp_clk_voltage[j-1];
> -                               info->disp_clk_voltage[j-1] =
> -                                       info->disp_clk_voltage[j];
> -                               info->disp_clk_voltage[j] = temp;
> -                       }
> +                           info->disp_clk_voltage[j-1].max_supported_clk)
> +                               swap(info->disp_clk_voltage[j-1], info->disp_clk_voltage[j]);
>                 }
>         }
>
> --
> 2.34.1
>
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ