[bug report] drm: atmel-hlcdc: add driver ops to differentiate HLCDC and XLCDC IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Manikandan Muralidharan,

Commit aa71584b323a ("drm: atmel-hlcdc: add driver ops to
differentiate HLCDC and XLCDC IP") from Apr 24, 2024 (linux-next),
leads to the following Smatch static checker warning:

	drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c:573 atmel_hlcdc_plane_update_buffers()
	error: uninitialized symbol 'sr'.

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
    556 static void atmel_hlcdc_plane_update_buffers(struct atmel_hlcdc_plane *plane,
    557                                              struct atmel_hlcdc_plane_state *state)
    558 {
    559         const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc;
    560         struct atmel_hlcdc_dc *dc = plane->base.dev->dev_private;
    561         struct drm_framebuffer *fb = state->base.fb;
    562         u32 sr;
    563         int i;
    564 
    565         if (!dc->desc->is_xlcdc)
    566                 sr = atmel_hlcdc_layer_read_reg(&plane->layer, ATMEL_HLCDC_LAYER_CHSR);

sr is uninitialized on else path.

    567 
    568         for (i = 0; i < state->nplanes; i++) {
    569                 struct drm_gem_dma_object *gem = drm_fb_dma_get_gem_obj(fb, i);
    570 
    571                 state->dscrs[i]->addr = gem->dma_addr + state->offsets[i];
    572 
--> 573                 dc->desc->ops->lcdc_update_buffers(plane, state, sr, i);
                                                                         ^^
Uninitialized.

    574 
    575                 if (desc->layout.xstride[i])
    576                         atmel_hlcdc_layer_write_cfg(&plane->layer,
    577                                                     desc->layout.xstride[i],
    578                                                     state->xstride[i]);
    579 
    580                 if (desc->layout.pstride[i])
    581                         atmel_hlcdc_layer_write_cfg(&plane->layer,
    582                                                     desc->layout.pstride[i],
    583                                                     state->pstride[i]);
    584         }
    585 }

regards,
dan carpenter



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux