lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1356458e54b6de3c2ae4bea7744f3ddd85bce0cc.1309494974.git.dvhart@linux.intel.com>
Date:	Thu, 30 Jun 2011 21:36:14 -0700
From:	Darren Hart <dvhart@...ux.intel.com>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:	Darren Hart <dvhart@...ux.intel.com>, Eric Anholt <eric@...olt.net>
Subject: [PATCH] i915: silence gcc warnings with CONFIG_BUG disabled

With CONFIG_BUG disabled, gcc issues the following warnings:

drivers/gpu/drm/i915/intel_display.c:773: warning: ‘state_string’ defined but not used
drivers/gpu/drm/i915/intel_display.c: In function ‘intel_pin_and_fence_fb_obj’:
drivers/gpu/drm/i915/intel_display.c:1790: warning: ‘alignment’ may be used uninitialized in this function

Fix the "state_string()" error with a __maybe_unused tag.

Fix the "alignment" error by assigning it to 0 in the default case,
this avoids an unecessary initialization in the common case.

Signed-off-by: Darren Hart <dvhart@...ux.intel.com>
CC: Eric Anholt <eric@...olt.net>
---
 drivers/gpu/drm/i915/intel_display.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 21b6f93..adf483e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -770,7 +770,7 @@ void intel_wait_for_pipe_off(struct drm_device *dev, int pipe)
 	}
 }
 
-static const char *state_string(bool enabled)
+static __maybe_unused const char *state_string(bool enabled)
 {
 	return enabled ? "on" : "off";
 }
@@ -1808,6 +1808,8 @@ intel_pin_and_fence_fb_obj(struct drm_device *dev,
 		DRM_ERROR("Y tiled not allowed for scan out buffers\n");
 		return -EINVAL;
 	default:
+		/* silence gcc uninitialized warnings with CONFIG_BUG not set */
+		alignment = 0;
 		BUG();
 	}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ