[Mesa-dev] [PATCH 1/3] noop: simplify some functions

Marek Olšák maraeo at gmail.com
Tue Aug 30 08:28:00 UTC 2016


On Mon, Aug 29, 2016 at 7:23 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 29 August 2016 at 16:29, Marek Olšák <maraeo at gmail.com> wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>  src/gallium/drivers/noop/noop_state.c | 56 +++++------------------------------
>>  1 file changed, 7 insertions(+), 49 deletions(-)
>>
>> diff --git a/src/gallium/drivers/noop/noop_state.c b/src/gallium/drivers/noop/noop_state.c
>> index 0c0ad9f..01538bfe27 100644
>> --- a/src/gallium/drivers/noop/noop_state.c
>> +++ b/src/gallium/drivers/noop/noop_state.c
>> @@ -35,63 +35,39 @@ static void noop_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info
>>  }
>>
>>  static void noop_set_blend_color(struct pipe_context *ctx,
>>                                   const struct pipe_blend_color *state)
>>  {
>>  }
>>
>>  static void *noop_create_blend_state(struct pipe_context *ctx,
>>                                       const struct pipe_blend_state *state)
>>  {
>> -   struct pipe_blend_state *nstate = CALLOC_STRUCT(pipe_blend_state);
>> -
>> -   if (!nstate) {
>> -      return NULL;
>> -   }
>> -   *nstate = *state;
>> -   return nstate;
>> +   return malloc(1);
> You want to use [CM]ALLOC to match the FREE.

Consider those fixed. Anything else?

Thanks,
Marek


More information about the mesa-dev mailing list