[Intel-gfx] [PATCH] drm/i915: Use sizeof(*fb) not sizeof(struct ...) in get_initial_plane_config()

Damien Lespiau damien.lespiau at intel.com
Wed Jan 21 06:07:19 PST 2015


Suggested-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 01dc80b..73b5923 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6586,7 +6586,7 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
 	struct drm_framebuffer *fb;
 	struct intel_framebuffer *intel_fb;
 
-	intel_fb = kzalloc(sizeof(struct intel_framebuffer), GFP_KERNEL);
+	intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
 	if (!intel_fb) {
 		DRM_DEBUG_KMS("failed to alloc fb\n");
 		return;
@@ -7618,7 +7618,7 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc,
 	struct drm_framebuffer *fb;
 	struct intel_framebuffer *intel_fb;
 
-	intel_fb = kzalloc(sizeof(struct intel_framebuffer), GFP_KERNEL);
+	intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
 	if (!intel_fb) {
 		DRM_DEBUG_KMS("failed to alloc fb\n");
 		return;
@@ -7714,7 +7714,7 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc,
 	struct drm_framebuffer *fb;
 	struct intel_framebuffer *intel_fb;
 
-	intel_fb = kzalloc(sizeof(struct intel_framebuffer), GFP_KERNEL);
+	intel_fb = kzalloc(sizeof(*intel_fb), GFP_KERNEL);
 	if (!intel_fb) {
 		DRM_DEBUG_KMS("failed to alloc fb\n");
 		return;
-- 
1.8.3.1



More information about the Intel-gfx mailing list