Permalink
Browse files

kernel/drm: Fix -Winit-self.

While here, define __must_check to __heedresult, the equivalent in
DragonFly, and fix one warning which fell out.
  • Loading branch information...
Sascha Wildner
Sascha Wildner committed Feb 25, 2014
1 parent 8abf17a commit a3faafcbc6219f85f78f1c5455e45f24d6b9641a
Showing with 6 additions and 6 deletions.
  1. +1 −1 sys/dev/drm/drm_edid.c
  2. +4 −2 sys/dev/drm/i915/i915_dma.c
  3. +1 −3 sys/dev/drm/include/linux/compiler.h
View
@@ -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))
@@ -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;
@@ -60,10 +60,8 @@
#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_ */

0 comments on commit a3faafc

Please sign in to comment.