Message ID | bdde4a5fd5337deb84b7d9e530e7bc83ef17ebec.1639087275.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm: Remove some useless memset | expand |
diff --git a/drivers/gpu/drm/drm_dma.c b/drivers/gpu/drm/drm_dma.c index eb6b741a6f99..df4837dc5030 100644 --- a/drivers/gpu/drm/drm_dma.c +++ b/drivers/gpu/drm/drm_dma.c @@ -51,8 +51,6 @@ */ int drm_legacy_dma_setup(struct drm_device *dev) { - int i; - if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA) || !drm_core_check_feature(dev, DRIVER_LEGACY)) return 0; @@ -64,9 +62,6 @@ int drm_legacy_dma_setup(struct drm_device *dev) if (!dev->dma) return -ENOMEM; - for (i = 0; i <= DRM_MAX_ORDER; i++) - memset(&dev->dma->bufs[i], 0, sizeof(dev->dma->bufs[0])); - return 0; }
'bufs' is an array embedded in an structure (struct drm_device_dma) which is kzalloc just a few lines above. So there is no need to explicitly memset each element on the array. It is already cleared. Remove the useless memset. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- drivers/gpu/drm/drm_dma.c | 5 ----- 1 file changed, 5 deletions(-)