Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys Remove some more needless #ifdef __NetBSD__.
details: https://anonhg.NetBSD.org/src/rev/da4db74b36a1
branches: riastradh-drm2
changeset: 788551:da4db74b36a1
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Sep 08 16:11:29 2013 +0000
description:
Remove some more needless #ifdef __NetBSD__.
diffstat:
sys/external/bsd/drm2/dist/drm/drm_context.c | 5 --
sys/external/bsd/drm2/dist/drm/drm_crtc.c | 50 +----------------------
sys/external/bsd/drm2/dist/drm/drm_edid.c | 19 --------
sys/external/bsd/drm2/dist/drm/drm_gem.c | 9 +---
sys/external/bsd/drm2/dist/drm/drm_global.c | 2 -
sys/external/bsd/drm2/dist/drm/drm_irq.c | 4 -
sys/external/bsd/drm2/dist/include/drm/drmP.h | 13 -----
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h | 27 ------------
sys/external/bsd/drm2/dist/include/drm/drm_mm.h | 2 -
sys/modules/drm2/Makefile | 3 +-
10 files changed, 6 insertions(+), 128 deletions(-)
diffs (truncated from 409 to 300 lines):
diff -r 97448bdb1f44 -r da4db74b36a1 sys/external/bsd/drm2/dist/drm/drm_context.c
--- a/sys/external/bsd/drm2/dist/drm/drm_context.c Sun Sep 08 16:10:23 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_context.c Sun Sep 08 16:11:29 2013 +0000
@@ -121,9 +121,7 @@
{
mutex_lock(&dev->struct_mutex);
idr_remove_all(&dev->ctx_idr);
-#ifdef __NetBSD__
idr_destroy(&dev->ctx_idr);
-#endif
mutex_unlock(&dev->struct_mutex);
}
@@ -267,10 +265,7 @@
struct drm_file *file_priv, int new)
{
dev->last_context = new; /* PRE/POST: This is the _only_ writer. */
-#ifndef __NetBSD__
- /* XXX Nobody seems to use last_switch. */
dev->last_switch = jiffies;
-#endif
if (!_DRM_LOCK_IS_HELD(file_priv->master->lock.hw_lock->lock)) {
DRM_ERROR("Lock isn't held after context switch\n");
diff -r 97448bdb1f44 -r da4db74b36a1 sys/external/bsd/drm2/dist/drm/drm_crtc.c
--- a/sys/external/bsd/drm2/dist/drm/drm_crtc.c Sun Sep 08 16:10:23 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_crtc.c Sun Sep 08 16:11:29 2013 +0000
@@ -41,8 +41,6 @@
#include <drm/drm_fourcc.h>
/* Avoid boilerplate. I'm tired of typing. */
-#ifdef __NetBSD__
-/* XXX Does nobody build this code with -Wwrite-strings? */
#define DRM_ENUM_NAME_FN(fnname, list) \
const char *fnname(int val) \
{ \
@@ -53,18 +51,6 @@
} \
return "(unknown)"; \
}
-#else
-#define DRM_ENUM_NAME_FN(fnname, list) \
- char *fnname(int val) \
- { \
- int i; \
- for (i = 0; i < ARRAY_SIZE(list); i++) { \
- if (list[i].type == val) \
- return list[i].name; \
- } \
- return "(unknown)"; \
- }
-#endif
/*
* Global properties
@@ -155,11 +141,7 @@
struct drm_conn_prop_enum_list {
int type;
-#ifdef __NetBSD__
const char *name;
-#else
- char *name;
-#endif
int count;
};
@@ -858,13 +840,8 @@
* responsible for allocating a list of format names and passing them to
* this routine.
*/
-#ifdef __NetBSD__ /* XXX const */
int drm_mode_create_tv_properties(struct drm_device *dev, int num_modes,
const char *modes[])
-#else
-int drm_mode_create_tv_properties(struct drm_device *dev, int num_modes,
- char *modes[])
-#endif
{
struct drm_property *tv_selector;
struct drm_property *tv_subconnector;
@@ -1047,10 +1024,8 @@
}
EXPORT_SYMBOL(drm_mode_config_init);
-#ifdef __NetBSD__
-static
-#endif
-int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
+static int drm_mode_group_init(struct drm_device *dev,
+ struct drm_mode_group *group)
{
uint32_t total_objects = 0;
@@ -2667,12 +2642,7 @@
if (!connector->encoder)
continue;
if (connector->encoder->crtc == crtc)
-#ifdef __NetBSD__
- list_move_tail(list_next(&list),
- &connector->user_modes);
-#else
list_move_tail(list.next, &connector->user_modes);
-#endif
}
WARN_ON(!list_empty(&list));
@@ -3531,21 +3501,13 @@
goto out;
}
-#ifdef __NetBSD__
g_base = (char *)r_base + size;
-#else
- g_base = r_base + size;
-#endif
if (copy_from_user(g_base, (void __user *)(unsigned long)crtc_lut->green, size)) {
ret = -EFAULT;
goto out;
}
-#ifdef __NetBSD__
b_base = (char *)g_base + size;
-#else
- b_base = g_base + size;
-#endif
if (copy_from_user(b_base, (void __user *)(unsigned long)crtc_lut->blue, size)) {
ret = -EFAULT;
goto out;
@@ -3593,21 +3555,13 @@
goto out;
}
-#ifdef __NetBSD__
g_base = (char *)r_base + size;
-#else
- g_base = r_base + size;
-#endif
if (copy_to_user((void __user *)(unsigned long)crtc_lut->green, g_base, size)) {
ret = -EFAULT;
goto out;
}
-#ifdef __NetBSD__
b_base = (char *)g_base + size;
-#else
- b_base = g_base + size;
-#endif
if (copy_to_user((void __user *)(unsigned long)crtc_lut->blue, b_base, size)) {
ret = -EFAULT;
goto out;
diff -r 97448bdb1f44 -r da4db74b36a1 sys/external/bsd/drm2/dist/drm/drm_edid.c
--- a/sys/external/bsd/drm2/dist/drm/drm_edid.c Sun Sep 08 16:10:23 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_edid.c Sun Sep 08 16:11:29 2013 +0000
@@ -440,16 +440,6 @@
*/
static bool edid_vendor(struct edid *edid, char *vendor)
{
-#ifdef __NetBSD__ /* XXX Avoid shadowing global definition. */
- char edidv[3];
-
- edidv[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
- edidv[1] = (((edid->mfg_id[0] & 0x3) << 3) |
- ((edid->mfg_id[1] & 0xe0) >> 5)) + '@';
- edidv[2] = (edid->mfg_id[1] & 0x1f) + '@';
-
- return !strncmp(edidv, vendor, 3);
-#else
char edid_vendor[3];
edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@';
@@ -458,7 +448,6 @@
edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@';
return !strncmp(edid_vendor, vendor, 3);
-#endif
}
/**
@@ -1536,19 +1525,11 @@
*/
u8 drm_match_cea_mode(struct drm_display_mode *to_match)
{
-#ifdef __NetBSD__
const struct drm_display_mode *cea_mode;
-#else
- struct drm_display_mode *cea_mode;
-#endif
u8 mode;
for (mode = 0; mode < drm_num_cea_modes; mode++) {
-#ifdef __NetBSD__
cea_mode = &edid_cea_modes[mode];
-#else
- cea_mode = (struct drm_display_mode *)&edid_cea_modes[mode];
-#endif
if (drm_mode_equal(to_match, cea_mode))
return mode + 1;
diff -r 97448bdb1f44 -r da4db74b36a1 sys/external/bsd/drm2/dist/drm/drm_gem.c
--- a/sys/external/bsd/drm2/dist/drm/drm_gem.c Sun Sep 08 16:10:23 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_gem.c Sun Sep 08 16:11:29 2013 +0000
@@ -131,8 +131,8 @@
kfree(mm);
dev->mm_private = NULL;
+ idr_destroy(&dev->object_name_idr);
#ifdef __NetBSD__
- idr_destroy(&dev->object_name_idr);
spin_lock_destroy(&dev->object_name_lock);
#endif
}
@@ -215,12 +215,7 @@
}
return obj;
fput:
-#ifdef __NetBSD__
drm_gem_object_release(obj);
-#else
- /* Object_init mangles the global counters - readjust them. */
- fput(obj->filp);
-#endif
free:
kfree(obj);
return NULL;
@@ -274,7 +269,7 @@
idr_remove(&filp->object_idr, handle);
spin_unlock(&filp->table_lock);
-#ifndef __NetBSD__
+#ifndef __NetBSD__ /* XXX drm prime */
drm_gem_remove_prime_handles(obj, filp);
#endif
diff -r 97448bdb1f44 -r da4db74b36a1 sys/external/bsd/drm2/dist/drm/drm_global.c
--- a/sys/external/bsd/drm2/dist/drm/drm_global.c Sun Sep 08 16:10:23 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_global.c Sun Sep 08 16:11:29 2013 +0000
@@ -65,9 +65,7 @@
int i;
for (i = 0; i < DRM_GLOBAL_NUM; ++i) {
struct drm_global_item *item = &glob[i];
-#ifdef __NetBSD__
(void)item; /* ignore */
-#endif
BUG_ON(item->object != NULL);
BUG_ON(item->refcount != 0);
}
diff -r 97448bdb1f44 -r da4db74b36a1 sys/external/bsd/drm2/dist/drm/drm_irq.c
--- a/sys/external/bsd/drm2/dist/drm/drm_irq.c Sun Sep 08 16:10:23 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_irq.c Sun Sep 08 16:11:29 2013 +0000
@@ -346,11 +346,7 @@
{
int ret;
unsigned long sh_flags = 0;
-#ifdef __NetBSD__
const char *irqname;
-#else
- char *irqname;
-#endif
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL;
diff -r 97448bdb1f44 -r da4db74b36a1 sys/external/bsd/drm2/dist/include/drm/drmP.h
--- a/sys/external/bsd/drm2/dist/include/drm/drmP.h Sun Sep 08 16:10:23 2013 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drmP.h Sun Sep 08 16:11:29 2013 +0000
@@ -1091,15 +1091,9 @@
int major;
int minor;
int patchlevel;
-#ifdef __NetBSD__
const char *name;
const char *desc;
const char *date;
-#else
- char *name;
- char *desc;
- char *date;
-#endif
u32 driver_features;
int dev_priv_size;
@@ -1111,11 +1105,7 @@
struct platform_device *platform_device;
struct usb_driver *usb;
} kdriver;
-#ifdef __NetBSD__ /* XXX const */
const struct drm_bus *bus;
-#else
- struct drm_bus *bus;
-#endif
/* List of devices hanging off this driver */
struct list_head device_list;
@@ -1292,10 +1282,7 @@
#endif
int last_checked; /**< Last context checked for DMA */
int last_context; /**< Last current context */
-#ifndef __NetBSD__
- /* XXX Nobody seems to use this. */
unsigned long last_switch; /**< jiffies at last context switch */
Home |
Main Index |
Thread Index |
Old Index