public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH 1/1] lib/vfs_file_max(): initialize static variable
@ 2019-04-16 13:57 Caz Yokoyama
  2019-04-16 14:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/1] " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Caz Yokoyama @ 2019-04-16 13:57 UTC (permalink / raw)
  To: igt-dev

I believe un-initialized static variable is most probably not zero.
Correct me if I am wrong.

Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com>
---
 lib/intel_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/intel_os.c b/lib/intel_os.c
index dd93bea1..a4fe6b34 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -281,7 +281,7 @@ void *intel_get_total_pinnable_mem(size_t *total)
 
 static uint64_t vfs_file_max(void)
 {
-	static long long unsigned max;
+	static long long unsigned max = 0;
 	if (max == 0) {
 		FILE *file = fopen("/proc/sys/fs/file-max", "r");
 		max = 80000;
-- 
2.17.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-16 20:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-16 13:57 [igt-dev] [PATCH 1/1] lib/vfs_file_max(): initialize static variable Caz Yokoyama
2019-04-16 14:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/1] " Patchwork
2019-04-16 15:55 ` [igt-dev] [PATCH 1/1] " Caz Yokoyama
2019-04-16 20:25 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [1/1] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox