[v2,05/37] panfrost: Kill a useless memset(0) in panfrost_create_context()

Submitted by Boris Brezillon on Sept. 16, 2019, 9:36 a.m.

Details

Message ID 20190916093715.32203-6-boris.brezillon@collabora.com
State Accepted
Commit 07085fe8a4c516353454f71d3e34b1dddb844cdd
Headers show
Series "panfrost: Support batch pipelining" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Boris Brezillon Sept. 16, 2019, 9:36 a.m.
ctx is allocated with rzalloc() which takes care of zero-ing the memory
region. No need to call memset(0) on top.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 src/gallium/drivers/panfrost/pan_context.c | 1 -
 1 file changed, 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 06a12662dd36..323a48090365 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -2628,7 +2628,6 @@  panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
 {
         struct panfrost_context *ctx = rzalloc(screen, struct panfrost_context);
         struct panfrost_screen *pscreen = pan_screen(screen);
-        memset(ctx, 0, sizeof(*ctx));
         struct pipe_context *gallium = (struct pipe_context *) ctx;
 
         ctx->is_t6xx = pscreen->gpu_id < 0x0700; /* Literally, "earlier than T700" */

Comments

R-b'

On Mon, Sep 16, 2019 at 11:36:43AM +0200, Boris Brezillon wrote:
> ctx is allocated with rzalloc() which takes care of zero-ing the memory
> region. No need to call memset(0) on top.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  src/gallium/drivers/panfrost/pan_context.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
> index 06a12662dd36..323a48090365 100644
> --- a/src/gallium/drivers/panfrost/pan_context.c
> +++ b/src/gallium/drivers/panfrost/pan_context.c
> @@ -2628,7 +2628,6 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
>  {
>          struct panfrost_context *ctx = rzalloc(screen, struct panfrost_context);
>          struct panfrost_screen *pscreen = pan_screen(screen);
> -        memset(ctx, 0, sizeof(*ctx));
>          struct pipe_context *gallium = (struct pipe_context *) ctx;
>  
>          ctx->is_t6xx = pscreen->gpu_id < 0x0700; /* Literally, "earlier than T700" */
> -- 
> 2.21.0