Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205145
b: refs/heads/master
c: 2991196
h: refs/heads/master
i:
  205143: 0ea21ac
v: v3
  • Loading branch information
Dan Carpenter authored and Eric Anholt committed Aug 2, 2010
1 parent 8b191e7 commit cef12f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cbb465e72ae2cf37d252284c28a0d89ddfaaa240
refs/heads/master: 2991196fbc19f68206eb81694e9ef338366ebc53
10 changes: 4 additions & 6 deletions trunk/drivers/gpu/drm/i915/intel_tv.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,6 @@ static const struct tv_mode tv_modes[] = {
},
};

#define NUM_TV_MODES sizeof(tv_modes) / sizeof (tv_modes[0])

static void
intel_tv_dpms(struct drm_encoder *encoder, int mode)
{
Expand Down Expand Up @@ -1512,7 +1510,7 @@ intel_tv_set_property(struct drm_connector *connector, struct drm_property *prop
tv_priv->margin[TV_MARGIN_BOTTOM] = val;
changed = true;
} else if (property == dev->mode_config.tv_mode_property) {
if (val >= NUM_TV_MODES) {
if (val >= ARRAY_SIZE(tv_modes)) {
ret = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -1693,13 +1691,13 @@ intel_tv_init(struct drm_device *dev)
connector->doublescan_allowed = false;

/* Create TV properties then attach current values */
tv_format_names = kmalloc(sizeof(char *) * NUM_TV_MODES,
tv_format_names = kmalloc(sizeof(char *) * ARRAY_SIZE(tv_modes),
GFP_KERNEL);
if (!tv_format_names)
goto out;
for (i = 0; i < NUM_TV_MODES; i++)
for (i = 0; i < ARRAY_SIZE(tv_modes); i++)
tv_format_names[i] = tv_modes[i].name;
drm_mode_create_tv_properties(dev, NUM_TV_MODES, tv_format_names);
drm_mode_create_tv_properties(dev, ARRAY_SIZE(tv_modes), tv_format_names);

drm_connector_attach_property(connector, dev->mode_config.tv_mode_property,
initial_mode);
Expand Down

0 comments on commit cef12f0

Please sign in to comment.