kernel/drm: Fix -Winit-self.
authorSascha Wildner <saw@online.de>
Tue, 25 Feb 2014 22:41:28 +0000 (23:41 +0100)
committerSascha Wildner <saw@online.de>
Tue, 25 Feb 2014 23:09:06 +0000 (00:09 +0100)
While here, define __must_check to __heedresult, the equivalent in
DragonFly, and fix one warning which fell out.

sys/dev/drm/drm_edid.c
sys/dev/drm/i915/i915_dma.c
sys/dev/drm/include/linux/compiler.h

index f2ca56e..7c14d40 100644 (file)
@@ -1380,7 +1380,7 @@ static int drm_cvt_modes(struct drm_connector *connector,
        const u8 empty[3] = { 0, 0, 0 };
 
        for (i = 0; i < 4; i++) {
-               int uninitialized_var(width), height;
+               int width = 0, height;
                cvt = &(timing->data.other_data.data.cvt[i]);
 
                if (!memcmp(cvt->code, empty, 3))
index bd0a293..56d9c0c 100644 (file)
@@ -339,12 +339,14 @@ static int i915_emit_cmds(struct drm_device *dev, int __user *buffer,
                          int dwords)
 {
        drm_i915_private_t *dev_priv = dev->dev_private;
-       int i;
+       int i, ret;
 
        if ((dwords+1) * sizeof(int) >= LP_RING(dev_priv)->size - 8)
                return -EINVAL;
 
-       BEGIN_LP_RING((dwords+1)&~1);
+       ret = BEGIN_LP_RING((dwords+1)&~1);
+       if (ret)
+               return ret;
 
        for (i = 0; i < dwords;) {
                int cmd, sz;
index c8f82ed..112f47e 100644 (file)
 #define        unlikely(x)                     __builtin_expect(!!(x), 0)
 #define typeof(x)                      __typeof(x)
 
-#define        uninitialized_var(x)            x = x
-
 #define __read_mostly
 #define __always_unused
-#define __must_check
+#define __must_check                   __heedresult
 
 #endif /* _LINUX_COMPILER_H_ */