diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-05-17 07:27:21 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-22 05:32:58 -0400 |
commit | 4a1b0714275796fdbc35427cf361eb4123e5e9f6 (patch) | |
tree | 1897d2d9cbec66d84d69ace29ddedfc1778f2f4e | |
parent | 7eb3b2c83dccddec34787adf67c10c82331d262e (diff) |
drm: Don't initialize local ret variable when not needed
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_edid_load.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_lock.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_sysfs.c | 2 |
9 files changed, 24 insertions, 32 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index a177d0abb8bb..da737ef7759e 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -1829,7 +1829,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, | |||
1829 | struct drm_display_mode *mode = NULL; | 1829 | struct drm_display_mode *mode = NULL; |
1830 | struct drm_mode_set set; | 1830 | struct drm_mode_set set; |
1831 | uint32_t __user *set_connectors_ptr; | 1831 | uint32_t __user *set_connectors_ptr; |
1832 | int ret = 0; | 1832 | int ret; |
1833 | int i; | 1833 | int i; |
1834 | 1834 | ||
1835 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 1835 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
@@ -2248,7 +2248,7 @@ int drm_mode_addfb2(struct drm_device *dev, | |||
2248 | struct drm_mode_fb_cmd2 *r = data; | 2248 | struct drm_mode_fb_cmd2 *r = data; |
2249 | struct drm_mode_config *config = &dev->mode_config; | 2249 | struct drm_mode_config *config = &dev->mode_config; |
2250 | struct drm_framebuffer *fb; | 2250 | struct drm_framebuffer *fb; |
2251 | int ret = 0; | 2251 | int ret; |
2252 | 2252 | ||
2253 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 2253 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
2254 | return -EINVAL; | 2254 | return -EINVAL; |
@@ -2403,7 +2403,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, | |||
2403 | struct drm_framebuffer *fb; | 2403 | struct drm_framebuffer *fb; |
2404 | unsigned flags; | 2404 | unsigned flags; |
2405 | int num_clips; | 2405 | int num_clips; |
2406 | int ret = 0; | 2406 | int ret; |
2407 | 2407 | ||
2408 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 2408 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
2409 | return -EINVAL; | 2409 | return -EINVAL; |
@@ -2602,7 +2602,7 @@ int drm_mode_attachmode_ioctl(struct drm_device *dev, | |||
2602 | struct drm_display_mode *mode; | 2602 | struct drm_display_mode *mode; |
2603 | struct drm_mode_object *obj; | 2603 | struct drm_mode_object *obj; |
2604 | struct drm_mode_modeinfo *umode = &mode_cmd->mode; | 2604 | struct drm_mode_modeinfo *umode = &mode_cmd->mode; |
2605 | int ret = 0; | 2605 | int ret; |
2606 | 2606 | ||
2607 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 2607 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
2608 | return -EINVAL; | 2608 | return -EINVAL; |
@@ -2656,7 +2656,7 @@ int drm_mode_detachmode_ioctl(struct drm_device *dev, | |||
2656 | struct drm_connector *connector; | 2656 | struct drm_connector *connector; |
2657 | struct drm_display_mode mode; | 2657 | struct drm_display_mode mode; |
2658 | struct drm_mode_modeinfo *umode = &mode_cmd->mode; | 2658 | struct drm_mode_modeinfo *umode = &mode_cmd->mode; |
2659 | int ret = 0; | 2659 | int ret; |
2660 | 2660 | ||
2661 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) | 2661 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
2662 | return -EINVAL; | 2662 | return -EINVAL; |
@@ -3065,7 +3065,7 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector, | |||
3065 | struct edid *edid) | 3065 | struct edid *edid) |
3066 | { | 3066 | { |
3067 | struct drm_device *dev = connector->dev; | 3067 | struct drm_device *dev = connector->dev; |
3068 | int ret = 0, size; | 3068 | int ret, size; |
3069 | 3069 | ||
3070 | if (connector->edid_blob_ptr) | 3070 | if (connector->edid_blob_ptr) |
3071 | drm_property_destroy_blob(dev, connector->edid_blob_ptr); | 3071 | drm_property_destroy_blob(dev, connector->edid_blob_ptr); |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 974196ab7b22..3252e7067d8b 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -518,7 +518,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
518 | int count = 0, ro, fail = 0; | 518 | int count = 0, ro, fail = 0; |
519 | struct drm_crtc_helper_funcs *crtc_funcs; | 519 | struct drm_crtc_helper_funcs *crtc_funcs; |
520 | struct drm_mode_set save_set; | 520 | struct drm_mode_set save_set; |
521 | int ret = 0; | 521 | int ret; |
522 | int i; | 522 | int i; |
523 | 523 | ||
524 | DRM_DEBUG_KMS("\n"); | 524 | DRM_DEBUG_KMS("\n"); |
diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 48c927c37041..66d4a28ad5a2 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c | |||
@@ -220,18 +220,18 @@ int drm_load_edid_firmware(struct drm_connector *connector) | |||
220 | { | 220 | { |
221 | char *connector_name = drm_get_connector_name(connector); | 221 | char *connector_name = drm_get_connector_name(connector); |
222 | char *edidname = edid_firmware, *last, *colon; | 222 | char *edidname = edid_firmware, *last, *colon; |
223 | int ret = 0; | 223 | int ret; |
224 | 224 | ||
225 | if (*edidname == '\0') | 225 | if (*edidname == '\0') |
226 | return ret; | 226 | return 0; |
227 | 227 | ||
228 | colon = strchr(edidname, ':'); | 228 | colon = strchr(edidname, ':'); |
229 | if (colon != NULL) { | 229 | if (colon != NULL) { |
230 | if (strncmp(connector_name, edidname, colon - edidname)) | 230 | if (strncmp(connector_name, edidname, colon - edidname)) |
231 | return ret; | 231 | return 0; |
232 | edidname = colon + 1; | 232 | edidname = colon + 1; |
233 | if (*edidname == '\0') | 233 | if (*edidname == '\0') |
234 | return ret; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | last = edidname + strlen(edidname) - 1; | 237 | last = edidname + strlen(edidname) - 1; |
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 6e19dd156be0..9b773d51cff5 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -383,7 +383,6 @@ int drm_fb_helper_init(struct drm_device *dev, | |||
383 | int crtc_count, int max_conn_count) | 383 | int crtc_count, int max_conn_count) |
384 | { | 384 | { |
385 | struct drm_crtc *crtc; | 385 | struct drm_crtc *crtc; |
386 | int ret = 0; | ||
387 | int i; | 386 | int i; |
388 | 387 | ||
389 | fb_helper->dev = dev; | 388 | fb_helper->dev = dev; |
@@ -408,10 +407,8 @@ int drm_fb_helper_init(struct drm_device *dev, | |||
408 | sizeof(struct drm_connector *), | 407 | sizeof(struct drm_connector *), |
409 | GFP_KERNEL); | 408 | GFP_KERNEL); |
410 | 409 | ||
411 | if (!fb_helper->crtc_info[i].mode_set.connectors) { | 410 | if (!fb_helper->crtc_info[i].mode_set.connectors) |
412 | ret = -ENOMEM; | ||
413 | goto out_free; | 411 | goto out_free; |
414 | } | ||
415 | fb_helper->crtc_info[i].mode_set.num_connectors = 0; | 412 | fb_helper->crtc_info[i].mode_set.num_connectors = 0; |
416 | } | 413 | } |
417 | 414 | ||
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 1ab29a7345c5..72ba0757feaa 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c | |||
@@ -328,7 +328,7 @@ drm_gem_create_mmap_offset(struct drm_gem_object *obj) | |||
328 | struct drm_gem_mm *mm = dev->mm_private; | 328 | struct drm_gem_mm *mm = dev->mm_private; |
329 | struct drm_map_list *list; | 329 | struct drm_map_list *list; |
330 | struct drm_local_map *map; | 330 | struct drm_local_map *map; |
331 | int ret = 0; | 331 | int ret; |
332 | 332 | ||
333 | /* Set the object up for mmap'ing */ | 333 | /* Set the object up for mmap'ing */ |
334 | list = &obj->map_list; | 334 | list = &obj->map_list; |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index acd2cb45a513..c798eeae0a03 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -310,7 +310,7 @@ static void drm_irq_vgaarb_nokms(void *cookie, bool state) | |||
310 | */ | 310 | */ |
311 | int drm_irq_install(struct drm_device *dev) | 311 | int drm_irq_install(struct drm_device *dev) |
312 | { | 312 | { |
313 | int ret = 0; | 313 | int ret; |
314 | unsigned long sh_flags = 0; | 314 | unsigned long sh_flags = 0; |
315 | char *irqname; | 315 | char *irqname; |
316 | 316 | ||
@@ -731,7 +731,7 @@ EXPORT_SYMBOL(drm_calc_vbltimestamp_from_scanoutpos); | |||
731 | u32 drm_get_last_vbltimestamp(struct drm_device *dev, int crtc, | 731 | u32 drm_get_last_vbltimestamp(struct drm_device *dev, int crtc, |
732 | struct timeval *tvblank, unsigned flags) | 732 | struct timeval *tvblank, unsigned flags) |
733 | { | 733 | { |
734 | int ret = 0; | 734 | int ret; |
735 | 735 | ||
736 | /* Define requested maximum error on timestamps (nanoseconds). */ | 736 | /* Define requested maximum error on timestamps (nanoseconds). */ |
737 | int max_error = (int) drm_timestamp_precision * 1000; | 737 | int max_error = (int) drm_timestamp_precision * 1000; |
@@ -1031,18 +1031,15 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, | |||
1031 | struct drm_file *file_priv) | 1031 | struct drm_file *file_priv) |
1032 | { | 1032 | { |
1033 | struct drm_modeset_ctl *modeset = data; | 1033 | struct drm_modeset_ctl *modeset = data; |
1034 | int ret = 0; | ||
1035 | unsigned int crtc; | 1034 | unsigned int crtc; |
1036 | 1035 | ||
1037 | /* If drm_vblank_init() hasn't been called yet, just no-op */ | 1036 | /* If drm_vblank_init() hasn't been called yet, just no-op */ |
1038 | if (!dev->num_crtcs) | 1037 | if (!dev->num_crtcs) |
1039 | goto out; | 1038 | return 0; |
1040 | 1039 | ||
1041 | crtc = modeset->crtc; | 1040 | crtc = modeset->crtc; |
1042 | if (crtc >= dev->num_crtcs) { | 1041 | if (crtc >= dev->num_crtcs) |
1043 | ret = -EINVAL; | 1042 | return -EINVAL; |
1044 | goto out; | ||
1045 | } | ||
1046 | 1043 | ||
1047 | switch (modeset->cmd) { | 1044 | switch (modeset->cmd) { |
1048 | case _DRM_PRE_MODESET: | 1045 | case _DRM_PRE_MODESET: |
@@ -1052,12 +1049,10 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, | |||
1052 | drm_vblank_post_modeset(dev, crtc); | 1049 | drm_vblank_post_modeset(dev, crtc); |
1053 | break; | 1050 | break; |
1054 | default: | 1051 | default: |
1055 | ret = -EINVAL; | 1052 | return -EINVAL; |
1056 | break; | ||
1057 | } | 1053 | } |
1058 | 1054 | ||
1059 | out: | 1055 | return 0; |
1060 | return ret; | ||
1061 | } | 1056 | } |
1062 | 1057 | ||
1063 | static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | 1058 | static int drm_queue_vblank_event(struct drm_device *dev, int pipe, |
@@ -1154,7 +1149,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data, | |||
1154 | struct drm_file *file_priv) | 1149 | struct drm_file *file_priv) |
1155 | { | 1150 | { |
1156 | union drm_wait_vblank *vblwait = data; | 1151 | union drm_wait_vblank *vblwait = data; |
1157 | int ret = 0; | 1152 | int ret; |
1158 | unsigned int flags, seq, crtc, high_crtc; | 1153 | unsigned int flags, seq, crtc, high_crtc; |
1159 | 1154 | ||
1160 | if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled)) | 1155 | if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled)) |
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index c79c713eeba0..521152041691 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c | |||
@@ -331,7 +331,7 @@ static int drm_notifier(void *priv) | |||
331 | 331 | ||
332 | void drm_idlelock_take(struct drm_lock_data *lock_data) | 332 | void drm_idlelock_take(struct drm_lock_data *lock_data) |
333 | { | 333 | { |
334 | int ret = 0; | 334 | int ret; |
335 | 335 | ||
336 | spin_lock_bh(&lock_data->spinlock); | 336 | spin_lock_bh(&lock_data->spinlock); |
337 | lock_data->kernel_waiters++; | 337 | lock_data->kernel_waiters++; |
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index ae1ccf1d5d96..21bcd4a555d8 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -210,7 +210,7 @@ EXPORT_SYMBOL(drm_master_put); | |||
210 | int drm_setmaster_ioctl(struct drm_device *dev, void *data, | 210 | int drm_setmaster_ioctl(struct drm_device *dev, void *data, |
211 | struct drm_file *file_priv) | 211 | struct drm_file *file_priv) |
212 | { | 212 | { |
213 | int ret = 0; | 213 | int ret; |
214 | 214 | ||
215 | if (file_priv->is_master) | 215 | if (file_priv->is_master) |
216 | return 0; | 216 | return 0; |
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 5a7bd51fc3d8..c29fa9c968ae 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
@@ -366,7 +366,7 @@ int drm_sysfs_connector_add(struct drm_connector *connector) | |||
366 | int attr_cnt = 0; | 366 | int attr_cnt = 0; |
367 | int opt_cnt = 0; | 367 | int opt_cnt = 0; |
368 | int i; | 368 | int i; |
369 | int ret = 0; | 369 | int ret; |
370 | 370 | ||
371 | /* We shouldn't get called more than once for the same connector */ | 371 | /* We shouldn't get called more than once for the same connector */ |
372 | BUG_ON(device_is_registered(&connector->kdev)); | 372 | BUG_ON(device_is_registered(&connector->kdev)); |