Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist Sprinkle const into drm_...
details: https://anonhg.NetBSD.org/src/rev/3c0bd4849f80
branches: riastradh-drm2
changeset: 788096:3c0bd4849f80
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 02:13:22 2013 +0000
description:
Sprinkle const into drm_crtc.c where string literals are involved.
Omit unused drm_get_connector_status_name (was used only by sysfs)
and drm_get_dirty_info_name (seems to have been completely unused).
diffstat:
sys/external/bsd/drm2/dist/drm/drm_crtc.c | 23 +++++++++++++++++++++++
sys/external/bsd/drm2/dist/include/drm/drmP.h | 2 ++
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h | 12 ++++++++++++
3 files changed, 37 insertions(+), 0 deletions(-)
diffs (115 lines):
diff -r 0af31ef4bffc -r 3c0bd4849f80 sys/external/bsd/drm2/dist/drm/drm_crtc.c
--- a/sys/external/bsd/drm2/dist/drm/drm_crtc.c Wed Jul 24 02:13:02 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_crtc.c Wed Jul 24 02:13:22 2013 +0000
@@ -40,6 +40,19 @@
#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) \
+ { \
+ int i; \
+ for (i = 0; i < ARRAY_SIZE(list); i++) { \
+ if (list[i].type == val) \
+ return list[i].name; \
+ } \
+ return "(unknown)"; \
+ }
+#else
#define DRM_ENUM_NAME_FN(fnname, list) \
char *fnname(int val) \
{ \
@@ -50,6 +63,7 @@
} \
return "(unknown)"; \
}
+#endif
/*
* Global properties
@@ -132,12 +146,19 @@
{ DRM_MODE_DIRTY_ANNOTATE, "Annotate" },
};
+#ifndef __NetBSD__
+/* XXX Doesn't seem to be used... */
DRM_ENUM_NAME_FN(drm_get_dirty_info_name,
drm_dirty_info_enum_list)
+#endif
struct drm_conn_prop_enum_list {
int type;
+#ifdef __NetBSD__
+ const char *name;
+#else
char *name;
+#endif
int count;
};
@@ -194,6 +215,7 @@
}
EXPORT_SYMBOL(drm_get_connector_name);
+#ifndef __NetBSD__
char *drm_get_connector_status_name(enum drm_connector_status status)
{
if (status == connector_status_connected)
@@ -203,6 +225,7 @@
else
return "unknown";
}
+#endif
/**
* drm_mode_object_get - allocate a new identifier
diff -r 0af31ef4bffc -r 3c0bd4849f80 sys/external/bsd/drm2/dist/include/drm/drmP.h
--- a/sys/external/bsd/drm2/dist/include/drm/drmP.h Wed Jul 24 02:13:02 2013 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drmP.h Wed Jul 24 02:13:22 2013 +0000
@@ -1677,7 +1677,9 @@
extern int drm_sysfs_device_add(struct drm_minor *minor);
extern void drm_sysfs_hotplug_event(struct drm_device *dev);
extern void drm_sysfs_device_remove(struct drm_minor *minor);
+#ifndef __NetBSD__
extern char *drm_get_connector_status_name(enum drm_connector_status status);
+#endif
extern int drm_sysfs_connector_add(struct drm_connector *connector);
extern void drm_sysfs_connector_remove(struct drm_connector *connector);
diff -r 0af31ef4bffc -r 3c0bd4849f80 sys/external/bsd/drm2/dist/include/drm/drm_crtc.h
--- a/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h Wed Jul 24 02:13:02 2013 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drm_crtc.h Wed Jul 24 02:13:22 2013 +0000
@@ -839,7 +839,11 @@
struct drm_prop_enum_list {
int type;
+#ifdef __NetBSD__
+ const char *name;
+#else
char *name;
+#endif
};
extern int drm_crtc_init(struct drm_device *dev,
@@ -872,11 +876,19 @@
extern void drm_encoder_cleanup(struct drm_encoder *encoder);
extern char *drm_get_connector_name(struct drm_connector *connector);
+#ifdef __NetBSD__
+extern const char *drm_get_dpms_name(int val);
+extern const char *drm_get_dvi_i_subconnector_name(int val);
+extern const char *drm_get_dvi_i_select_name(int val);
+extern const char *drm_get_tv_subconnector_name(int val);
+extern const char *drm_get_tv_select_name(int val);
+#else
extern char *drm_get_dpms_name(int val);
extern char *drm_get_dvi_i_subconnector_name(int val);
extern char *drm_get_dvi_i_select_name(int val);
extern char *drm_get_tv_subconnector_name(int val);
extern char *drm_get_tv_select_name(int val);
+#endif
extern void drm_fb_release(struct drm_file *file_priv);
extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
extern bool drm_probe_ddc(struct i2c_adapter *adapter);
Home |
Main Index |
Thread Index |
Old Index