Skip to contentSkip to conversation

intel: Only define variable when it's used.

PATCH In review Thomas Klausner 1 participant 6 messages Jul 20, 2014 – Sep 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 intel: Only define variable when it's used.

---
 intel/test_decode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
intel/test_decode.c +4 -1
index b710f34..f9127cf 100644
@@ -90,7 +90,10 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename)
 {
 	FILE *out = NULL;
 	void *ptr, *ref_ptr, *batch_ptr;
-	size_t size, ref_size, batch_size;
+#ifdef HAVE_OPEN_MEMSTREAM
+	size_t size;
+#endif
+	size_t ref_size, batch_size;
 	const char *ref_suffix = "-ref.txt";
 	char *ref_filename;
 
Signature · 1 line
1.9.4
#1 lore raw

PATCH 2/4 nouveau: Remove unused static function.

---
 nouveau/bufctx.c | 6 ------
 1 file changed, 6 deletions(-)
nouveau/bufctx.c +0 -6
index 23d6f09..4f76e5d 100644
@@ -44,12 +44,6 @@ struct nouveau_bufref_priv {
 	struct nouveau_bufctx *bufctx;
 };
 
-static inline struct nouveau_bufref_priv *
-nouveau_bufref(struct nouveau_bufref *bctx)
-{
-	return (struct nouveau_bufref_priv *)bctx;
-}
-
 struct nouveau_bufbin_priv {
 	struct nouveau_bufref_priv *list;
 	int relocs;
Signature · 1 line
1.9.4
#2 lore raw

PATCH 3/4 Add NetBSD atomic ops support.

In reply to Thomas Klausner
---
 xf86atomic.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
xf86atomic.h +17 -0
index db2f619..d0f85fc 100644
@@ -92,6 +92,23 @@ typedef struct { uint_t atomic; } atomic_t;
 
 #endif
 
+#if defined(__NetBSD__) && !defined(HAS_ATOMIC_OPS)  /* NetBSD */
+
+#include <sys/atomic.h>
+#define HAS_ATOMIC_OPS 1
+
+typedef struct { int atomic; } atomic_t;
+
+# define atomic_read(x) (int) ((x)->atomic)
+# define atomic_set(x, val) ((x)->atomic = (val))
+# define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
+# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
+# define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
+# define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
+# define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)
+
+#endif
+
 #if ! HAS_ATOMIC_OPS
 #error libdrm requires atomic operations, please define them for your CPU/compiler.
 #endif
Signature · 1 line
1.9.4
#3 lore raw

PATCH 4/4 Fix libdrm's atomic_dec_and_test on Solaris.

In reply to Thomas Klausner

_nv means new value, not old value!

---
 xf86atomic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xf86atomic.h +1 -1
index d0f85fc..4e7691f 100644
@@ -85,7 +85,7 @@ typedef struct { uint_t atomic; } atomic_t;
 # define atomic_read(x) (int) ((x)->atomic)
 # define atomic_set(x, val) ((x)->atomic = (uint_t)(val))
 # define atomic_inc(x) (atomic_inc_uint (&(x)->atomic))
-# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1)
+# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0)
 # define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v)))
 # define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v)))
 # define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)
Signature · 1 line
1.9.4
#4 lore raw
In reply to Thomas Klausner

Hi!

I'm new here, so I don't know how to find the correct people to review this patchset. Please let me know.

Thanks,
Thomas

Quoted 29 lines · Thomas Klausner
---
 intel/test_decode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
intel/test_decode.c +4 -1
index b710f34..f9127cf 100644
@@ -90,7 +90,10 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename)
 {
 	FILE *out = NULL;
 	void *ptr, *ref_ptr, *batch_ptr;
-	size_t size, ref_size, batch_size;
+#ifdef HAVE_OPEN_MEMSTREAM
+	size_t size;
+#endif
+	size_t ref_size, batch_size;
 	const char *ref_suffix = "-ref.txt";
 	char *ref_filename;
 
Signature · 6 lines
1.9.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

Re-ping.
These patches are quite simple...
Thomas

Quoted 43 lines · Thomas Klausner

Hi!

I'm new here, so I don't know how to find the correct people to review this patchset. Please let me know.

Thanks,
Thomas

Quoted 29 lines · Thomas Klausner
---
 intel/test_decode.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
intel/test_decode.c +4 -1
index b710f34..f9127cf 100644
@@ -90,7 +90,10 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename)
 {
 	FILE *out = NULL;
 	void *ptr, *ref_ptr, *batch_ptr;
-	size_t size, ref_size, batch_size;
+#ifdef HAVE_OPEN_MEMSTREAM
+	size_t size;
+#endif
+	size_t ref_size, batch_size;
 	const char *ref_suffix = "-ref.txt";
 	char *ref_filename;
 
Signature · 6 lines
1.9.4

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel