提交 4dfd909f 编写于 作者: T Thierry Reding 提交者: Daniel Vetter

drm: Miscellaneous checkpatch whitespace cleanups

A couple of whitespace changes required to silent various errors and
warnings flagged by checkpatch.

checkpatch requires that the opening brace be on the same line as a
variable declaration. Furthermore an empty line is required after a
block of variable declarations. Trailing whitespace as well as using
spaces before tabs is considered an error or warning, respectively.
Finally, the closing parenthesis of an if condition and the opening
brace of the conditional block should be separated by a space.
Signed-off-by: NThierry Reding <treding@nvidia.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 c422f31d
...@@ -61,8 +61,8 @@ static struct drm_framebuffer *add_framebuffer_internal(struct drm_device *dev, ...@@ -61,8 +61,8 @@ static struct drm_framebuffer *add_framebuffer_internal(struct drm_device *dev,
/* /*
* Global properties * Global properties
*/ */
static const struct drm_prop_enum_list drm_dpms_enum_list[] = static const struct drm_prop_enum_list drm_dpms_enum_list[] = {
{ { DRM_MODE_DPMS_ON, "On" }, { DRM_MODE_DPMS_ON, "On" },
{ DRM_MODE_DPMS_STANDBY, "Standby" }, { DRM_MODE_DPMS_STANDBY, "Standby" },
{ DRM_MODE_DPMS_SUSPEND, "Suspend" }, { DRM_MODE_DPMS_SUSPEND, "Suspend" },
{ DRM_MODE_DPMS_OFF, "Off" } { DRM_MODE_DPMS_OFF, "Off" }
...@@ -70,8 +70,7 @@ static const struct drm_prop_enum_list drm_dpms_enum_list[] = ...@@ -70,8 +70,7 @@ static const struct drm_prop_enum_list drm_dpms_enum_list[] =
DRM_ENUM_NAME_FN(drm_get_dpms_name, drm_dpms_enum_list) DRM_ENUM_NAME_FN(drm_get_dpms_name, drm_dpms_enum_list)
static const struct drm_prop_enum_list drm_plane_type_enum_list[] = static const struct drm_prop_enum_list drm_plane_type_enum_list[] = {
{
{ DRM_PLANE_TYPE_OVERLAY, "Overlay" }, { DRM_PLANE_TYPE_OVERLAY, "Overlay" },
{ DRM_PLANE_TYPE_PRIMARY, "Primary" }, { DRM_PLANE_TYPE_PRIMARY, "Primary" },
{ DRM_PLANE_TYPE_CURSOR, "Cursor" }, { DRM_PLANE_TYPE_CURSOR, "Cursor" },
...@@ -80,8 +79,7 @@ static const struct drm_prop_enum_list drm_plane_type_enum_list[] = ...@@ -80,8 +79,7 @@ static const struct drm_prop_enum_list drm_plane_type_enum_list[] =
/* /*
* Optional properties * Optional properties
*/ */
static const struct drm_prop_enum_list drm_scaling_mode_enum_list[] = static const struct drm_prop_enum_list drm_scaling_mode_enum_list[] = {
{
{ DRM_MODE_SCALE_NONE, "None" }, { DRM_MODE_SCALE_NONE, "None" },
{ DRM_MODE_SCALE_FULLSCREEN, "Full" }, { DRM_MODE_SCALE_FULLSCREEN, "Full" },
{ DRM_MODE_SCALE_CENTER, "Center" }, { DRM_MODE_SCALE_CENTER, "Center" },
...@@ -97,8 +95,7 @@ static const struct drm_prop_enum_list drm_aspect_ratio_enum_list[] = { ...@@ -97,8 +95,7 @@ static const struct drm_prop_enum_list drm_aspect_ratio_enum_list[] = {
/* /*
* Non-global properties, but "required" for certain connectors. * Non-global properties, but "required" for certain connectors.
*/ */
static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] = static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] = {
{
{ DRM_MODE_SUBCONNECTOR_Automatic, "Automatic" }, /* DVI-I and TV-out */ { DRM_MODE_SUBCONNECTOR_Automatic, "Automatic" }, /* DVI-I and TV-out */
{ DRM_MODE_SUBCONNECTOR_DVID, "DVI-D" }, /* DVI-I */ { DRM_MODE_SUBCONNECTOR_DVID, "DVI-D" }, /* DVI-I */
{ DRM_MODE_SUBCONNECTOR_DVIA, "DVI-A" }, /* DVI-I */ { DRM_MODE_SUBCONNECTOR_DVIA, "DVI-A" }, /* DVI-I */
...@@ -106,8 +103,7 @@ static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] = ...@@ -106,8 +103,7 @@ static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] =
DRM_ENUM_NAME_FN(drm_get_dvi_i_select_name, drm_dvi_i_select_enum_list) DRM_ENUM_NAME_FN(drm_get_dvi_i_select_name, drm_dvi_i_select_enum_list)
static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] = static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] = {
{
{ DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I and TV-out */ { DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I and TV-out */
{ DRM_MODE_SUBCONNECTOR_DVID, "DVI-D" }, /* DVI-I */ { DRM_MODE_SUBCONNECTOR_DVID, "DVI-D" }, /* DVI-I */
{ DRM_MODE_SUBCONNECTOR_DVIA, "DVI-A" }, /* DVI-I */ { DRM_MODE_SUBCONNECTOR_DVIA, "DVI-A" }, /* DVI-I */
...@@ -116,8 +112,7 @@ static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] = ...@@ -116,8 +112,7 @@ static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] =
DRM_ENUM_NAME_FN(drm_get_dvi_i_subconnector_name, DRM_ENUM_NAME_FN(drm_get_dvi_i_subconnector_name,
drm_dvi_i_subconnector_enum_list) drm_dvi_i_subconnector_enum_list)
static const struct drm_prop_enum_list drm_tv_select_enum_list[] = static const struct drm_prop_enum_list drm_tv_select_enum_list[] = {
{
{ DRM_MODE_SUBCONNECTOR_Automatic, "Automatic" }, /* DVI-I and TV-out */ { DRM_MODE_SUBCONNECTOR_Automatic, "Automatic" }, /* DVI-I and TV-out */
{ DRM_MODE_SUBCONNECTOR_Composite, "Composite" }, /* TV-out */ { DRM_MODE_SUBCONNECTOR_Composite, "Composite" }, /* TV-out */
{ DRM_MODE_SUBCONNECTOR_SVIDEO, "SVIDEO" }, /* TV-out */ { DRM_MODE_SUBCONNECTOR_SVIDEO, "SVIDEO" }, /* TV-out */
...@@ -127,8 +122,7 @@ static const struct drm_prop_enum_list drm_tv_select_enum_list[] = ...@@ -127,8 +122,7 @@ static const struct drm_prop_enum_list drm_tv_select_enum_list[] =
DRM_ENUM_NAME_FN(drm_get_tv_select_name, drm_tv_select_enum_list) DRM_ENUM_NAME_FN(drm_get_tv_select_name, drm_tv_select_enum_list)
static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = {
{
{ DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I and TV-out */ { DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I and TV-out */
{ DRM_MODE_SUBCONNECTOR_Composite, "Composite" }, /* TV-out */ { DRM_MODE_SUBCONNECTOR_Composite, "Composite" }, /* TV-out */
{ DRM_MODE_SUBCONNECTOR_SVIDEO, "SVIDEO" }, /* TV-out */ { DRM_MODE_SUBCONNECTOR_SVIDEO, "SVIDEO" }, /* TV-out */
...@@ -154,8 +148,8 @@ struct drm_conn_prop_enum_list { ...@@ -154,8 +148,8 @@ struct drm_conn_prop_enum_list {
/* /*
* Connector and encoder types. * Connector and encoder types.
*/ */
static struct drm_conn_prop_enum_list drm_connector_enum_list[] = static struct drm_conn_prop_enum_list drm_connector_enum_list[] = {
{ { DRM_MODE_CONNECTOR_Unknown, "Unknown" }, { DRM_MODE_CONNECTOR_Unknown, "Unknown" },
{ DRM_MODE_CONNECTOR_VGA, "VGA" }, { DRM_MODE_CONNECTOR_VGA, "VGA" },
{ DRM_MODE_CONNECTOR_DVII, "DVI-I" }, { DRM_MODE_CONNECTOR_DVII, "DVI-I" },
{ DRM_MODE_CONNECTOR_DVID, "DVI-D" }, { DRM_MODE_CONNECTOR_DVID, "DVI-D" },
...@@ -174,8 +168,8 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] = ...@@ -174,8 +168,8 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
{ DRM_MODE_CONNECTOR_DSI, "DSI" }, { DRM_MODE_CONNECTOR_DSI, "DSI" },
}; };
static const struct drm_prop_enum_list drm_encoder_enum_list[] = static const struct drm_prop_enum_list drm_encoder_enum_list[] = {
{ { DRM_MODE_ENCODER_NONE, "None" }, { DRM_MODE_ENCODER_NONE, "None" },
{ DRM_MODE_ENCODER_DAC, "DAC" }, { DRM_MODE_ENCODER_DAC, "DAC" },
{ DRM_MODE_ENCODER_TMDS, "TMDS" }, { DRM_MODE_ENCODER_TMDS, "TMDS" },
{ DRM_MODE_ENCODER_LVDS, "LVDS" }, { DRM_MODE_ENCODER_LVDS, "LVDS" },
...@@ -185,8 +179,7 @@ static const struct drm_prop_enum_list drm_encoder_enum_list[] = ...@@ -185,8 +179,7 @@ static const struct drm_prop_enum_list drm_encoder_enum_list[] =
{ DRM_MODE_ENCODER_DPMST, "DP MST" }, { DRM_MODE_ENCODER_DPMST, "DP MST" },
}; };
static const struct drm_prop_enum_list drm_subpixel_enum_list[] = static const struct drm_prop_enum_list drm_subpixel_enum_list[] = {
{
{ SubPixelUnknown, "Unknown" }, { SubPixelUnknown, "Unknown" },
{ SubPixelHorizontalRGB, "Horizontal RGB" }, { SubPixelHorizontalRGB, "Horizontal RGB" },
{ SubPixelHorizontalBGR, "Horizontal BGR" }, { SubPixelHorizontalBGR, "Horizontal BGR" },
...@@ -1137,6 +1130,7 @@ EXPORT_SYMBOL(drm_encoder_init); ...@@ -1137,6 +1130,7 @@ EXPORT_SYMBOL(drm_encoder_init);
void drm_encoder_cleanup(struct drm_encoder *encoder) void drm_encoder_cleanup(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
drm_modeset_lock_all(dev); drm_modeset_lock_all(dev);
drm_mode_object_put(dev, &encoder->base); drm_mode_object_put(dev, &encoder->base);
kfree(encoder->name); kfree(encoder->name);
...@@ -2519,7 +2513,7 @@ int drm_mode_setplane(struct drm_device *dev, void *data, ...@@ -2519,7 +2513,7 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
* *
* This is a little helper to wrap internal calls to the ->set_config driver * This is a little helper to wrap internal calls to the ->set_config driver
* interface. The only thing it adds is correct refcounting dance. * interface. The only thing it adds is correct refcounting dance.
* *
* Returns: * Returns:
* Zero on success, negative errno on failure. * Zero on success, negative errno on failure.
*/ */
...@@ -2958,6 +2952,7 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev, ...@@ -2958,6 +2952,7 @@ int drm_mode_cursor2_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv) void *data, struct drm_file *file_priv)
{ {
struct drm_mode_cursor2 *req = data; struct drm_mode_cursor2 *req = data;
return drm_mode_cursor_common(dev, req, file_priv); return drm_mode_cursor_common(dev, req, file_priv);
} }
...@@ -4047,7 +4042,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev, ...@@ -4047,7 +4042,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
if (out_resp->length == blob->length) { if (out_resp->length == blob->length) {
blob_ptr = (void __user *)(unsigned long)out_resp->data; blob_ptr = (void __user *)(unsigned long)out_resp->data;
if (copy_to_user(blob_ptr, blob->data, blob->length)){ if (copy_to_user(blob_ptr, blob->data, blob->length)) {
ret = -EFAULT; ret = -EFAULT;
goto done; goto done;
} }
...@@ -4149,6 +4144,7 @@ static bool drm_property_change_is_valid(struct drm_property *property, ...@@ -4149,6 +4144,7 @@ static bool drm_property_change_is_valid(struct drm_property *property,
return true; return true;
} else if (drm_property_type_is(property, DRM_MODE_PROP_SIGNED_RANGE)) { } else if (drm_property_type_is(property, DRM_MODE_PROP_SIGNED_RANGE)) {
int64_t svalue = U642I64(value); int64_t svalue = U642I64(value);
if (svalue < U642I64(property->values[0]) || if (svalue < U642I64(property->values[0]) ||
svalue > U642I64(property->values[1])) svalue > U642I64(property->values[1]))
return false; return false;
...@@ -4156,6 +4152,7 @@ static bool drm_property_change_is_valid(struct drm_property *property, ...@@ -4156,6 +4152,7 @@ static bool drm_property_change_is_valid(struct drm_property *property,
} else if (drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) { } else if (drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) {
int i; int i;
uint64_t valid_mask = 0; uint64_t valid_mask = 0;
for (i = 0; i < property->num_values; i++) for (i = 0; i < property->num_values; i++)
valid_mask |= (1ULL << property->values[i]); valid_mask |= (1ULL << property->values[i]);
return !(value & ~valid_mask); return !(value & ~valid_mask);
...@@ -4164,6 +4161,7 @@ static bool drm_property_change_is_valid(struct drm_property *property, ...@@ -4164,6 +4161,7 @@ static bool drm_property_change_is_valid(struct drm_property *property,
return true; return true;
} else if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) { } else if (drm_property_type_is(property, DRM_MODE_PROP_OBJECT)) {
struct drm_mode_object *obj; struct drm_mode_object *obj;
/* a zero value for an object property translates to null: */ /* a zero value for an object property translates to null: */
if (value == 0) if (value == 0)
return true; return true;
......
...@@ -778,7 +778,7 @@ static struct timeval get_drm_timestamp(void) ...@@ -778,7 +778,7 @@ static struct timeval get_drm_timestamp(void)
/** /**
* drm_get_last_vbltimestamp - retrieve raw timestamp for the most recent * drm_get_last_vbltimestamp - retrieve raw timestamp for the most recent
* vblank interval * vblank interval
* @dev: DRM device * @dev: DRM device
* @crtc: which CRTC's vblank timestamp to retrieve * @crtc: which CRTC's vblank timestamp to retrieve
* @tvblank: Pointer to target struct timeval which should receive the timestamp * @tvblank: Pointer to target struct timeval which should receive the timestamp
...@@ -910,6 +910,7 @@ void drm_send_vblank_event(struct drm_device *dev, int crtc, ...@@ -910,6 +910,7 @@ void drm_send_vblank_event(struct drm_device *dev, int crtc,
{ {
struct timeval now; struct timeval now;
unsigned int seq; unsigned int seq;
if (crtc >= 0) { if (crtc >= 0) {
seq = drm_vblank_count_and_time(dev, crtc, &now); seq = drm_vblank_count_and_time(dev, crtc, &now);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册