drm: Fix kcalloc parameters swapped
authorAxel Lin <axel.lin@gmail.com>
Fri, 10 Feb 2012 12:04:52 +0000 (20:04 +0800)
committerDave Airlie <airlied@redhat.com>
Mon, 13 Feb 2012 12:07:36 +0000 (12:07 +0000)
The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/gma500/intel_gmbus.c
drivers/gpu/drm/i915/intel_i2c.c

index 147584ac8d02a271d80c40510ec3d70e8d64e918..9db90527bf0ff20b0f9822c265b708fbe636185d 100644 (file)
@@ -395,7 +395,7 @@ int gma_intel_setup_gmbus(struct drm_device *dev)
        struct drm_psb_private *dev_priv = dev->dev_private;
        int ret, i;
 
-       dev_priv->gmbus = kcalloc(sizeof(struct intel_gmbus), GMBUS_NUM_PORTS,
+       dev_priv->gmbus = kcalloc(GMBUS_NUM_PORTS, sizeof(struct intel_gmbus),
                                  GFP_KERNEL);
        if (dev_priv->gmbus == NULL)
                return -ENOMEM;
index 7fa4f640e6fdff683acb0871f649771f9eaca2f6..03573e00471b553c2b30befeffc8bb5d5c8c3781 100644 (file)
@@ -375,7 +375,7 @@ int intel_setup_gmbus(struct drm_device *dev)
        struct drm_i915_private *dev_priv = dev->dev_private;
        int ret, i;
 
-       dev_priv->gmbus = kcalloc(sizeof(struct intel_gmbus), GMBUS_NUM_PORTS,
+       dev_priv->gmbus = kcalloc(GMBUS_NUM_PORTS, sizeof(struct intel_gmbus),
                                  GFP_KERNEL);
        if (dev_priv->gmbus == NULL)
                return -ENOMEM;