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]
Date:   Tue, 26 Sep 2017 12:10:26 -0400
From:   Alex Deucher <alexdeucher@...il.com>
To:     Thomas Meyer <thomas@...3r.de>
Cc:     "Deucher, Alexander" <alexander.deucher@....com>,
        Christian Koenig <christian.koenig@....com>,
        Dave Airlie <airlied@...ux.ie>,
        amd-gfx list <amd-gfx@...ts.freedesktop.org>,
        Maling list - DRI developers 
        <dri-devel@...ts.freedesktop.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] drm/amd/powerplay: Cocci spatch "alloc_cast"

On Thu, Sep 21, 2017 at 2:33 AM, Thomas Meyer <thomas@...3r.de> wrote:
> Remove casting the values returned by memory allocation functions like
> kmalloc, kzalloc, kmem_cache_alloc, kmem_cache_zalloc etc."
> Found by coccinelle spatch "api/alloc/alloc_cast.cocci"
>
> Signed-off-by: Thomas Meyer <thomas@...3r.de>
> ---
>
> diff -u -p a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
> @@ -291,7 +291,7 @@ static int get_mm_clock_voltage_table(
>         table_size = sizeof(uint32_t) +
>                         sizeof(phm_ppt_v1_mm_clock_voltage_dependency_record) *
>                         mm_dependency_table->ucNumEntries;
> -       mm_table = (phm_ppt_v1_mm_clock_voltage_dependency_table *)
> +       mm_table =
>                         kzalloc(table_size, GFP_KERNEL);

Please fix up the whitespace.  E.g.,
 mm_table = kzalloc(table_size, GFP_KERNEL);

Alex


>
>         if (!mm_table)
> @@ -519,7 +519,7 @@ static int get_socclk_voltage_dependency
>                         sizeof(phm_ppt_v1_clock_voltage_dependency_record) *
>                         clk_dep_table->ucNumEntries;
>
> -       clk_table = (phm_ppt_v1_clock_voltage_dependency_table *)
> +       clk_table =
>                         kzalloc(table_size, GFP_KERNEL);
>
>         if (!clk_table)
> @@ -554,7 +554,7 @@ static int get_mclk_voltage_dependency_t
>                         sizeof(phm_ppt_v1_clock_voltage_dependency_record) *
>                         mclk_dep_table->ucNumEntries;
>
> -       mclk_table = (phm_ppt_v1_clock_voltage_dependency_table *)
> +       mclk_table =
>                         kzalloc(table_size, GFP_KERNEL);
>
>         if (!mclk_table)
> @@ -596,7 +596,7 @@ static int get_gfxclk_voltage_dependency
>                         sizeof(phm_ppt_v1_clock_voltage_dependency_record) *
>                         clk_dep_table->ucNumEntries;
>
> -       clk_table = (struct phm_ppt_v1_clock_voltage_dependency_table *)
> +       clk_table =
>                         kzalloc(table_size, GFP_KERNEL);
>
>         if (!clk_table)
> @@ -663,7 +663,7 @@ static int get_pix_clk_voltage_dependenc
>                         sizeof(phm_ppt_v1_clock_voltage_dependency_record) *
>                         clk_dep_table->ucNumEntries;
>
> -       clk_table = (struct phm_ppt_v1_clock_voltage_dependency_table *)
> +       clk_table =
>                         kzalloc(table_size, GFP_KERNEL);
>
>         if (!clk_table)
> @@ -728,7 +728,7 @@ static int get_dcefclk_voltage_dependenc
>                         sizeof(phm_ppt_v1_clock_voltage_dependency_record) *
>                         num_entries;
>
> -       clk_table = (struct phm_ppt_v1_clock_voltage_dependency_table *)
> +       clk_table =
>                         kzalloc(table_size, GFP_KERNEL);
>
>         if (!clk_table)
> @@ -772,7 +772,7 @@ static int get_pcie_table(struct pp_hwmg
>                         sizeof(struct phm_ppt_v1_pcie_record) *
>                         atom_pcie_table->ucNumEntries;
>
> -       pcie_table = (struct phm_ppt_v1_pcie_table *)
> +       pcie_table =
>                         kzalloc(table_size, GFP_KERNEL);
>
>         if (!pcie_table)
> @@ -1026,7 +1026,7 @@ static int get_vddc_lookup_table(
>         table_size = sizeof(uint32_t) +
>                         sizeof(phm_ppt_v1_voltage_lookup_record) * max_levels;
>
> -       table = (phm_ppt_v1_voltage_lookup_table *)
> +       table =
>                         kzalloc(table_size, GFP_KERNEL);
>
>         if (NULL == table)
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ