Loading drivers/media/platform/msm/camera/cam_sync/cam_sync.c +10 −14 Original line number Original line Diff line number Diff line Loading @@ -312,30 +312,26 @@ int cam_sync_merge(int32_t *sync_obj, uint32_t num_objs, int32_t *merged_obj) return -EINVAL; return -EINVAL; } } rc = cam_sync_util_find_and_set_empty_row(sync_dev, &idx); do { if (rc < 0) { idx = find_first_zero_bit(sync_dev->bitmap, CAM_SYNC_MAX_OBJS); CAM_ERR(CAM_SYNC, if (idx >= CAM_SYNC_MAX_OBJS) "Error: Unable to find empty row, table full"); return -ENOMEM; return -EINVAL; } while (!spin_trylock_bh(&sync_dev->row_spinlocks[idx])); } if (idx <= 0 || idx >= CAM_SYNC_MAX_OBJS) { set_bit(idx, sync_dev->bitmap); CAM_ERR(CAM_SYNC, "Error: Invalid empty row index returned = %ld", idx); return -EINVAL; } rc = cam_sync_init_group_object(sync_dev->sync_table, rc = cam_sync_init_group_object(sync_dev->sync_table, idx, sync_obj, idx, sync_obj, num_objs); num_objs); if (rc < 0) { if (rc < 0) { CAM_ERR(CAM_SYNC, "Error: Unable to init row at idx = %ld", CAM_ERR(CAM_SYNC, "Error: Unable to init row at idx = %ld", idx); idx); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -EINVAL; return -EINVAL; } } *merged_obj = idx; *merged_obj = idx; spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return 0; return 0; } } Loading drivers/media/platform/msm/camera/cam_sync/cam_sync_util.c +0 −5 Original line number Original line Diff line number Diff line Loading @@ -131,7 +131,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, struct sync_table_row *row = table + idx; struct sync_table_row *row = table + idx; struct sync_table_row *child_row = NULL; struct sync_table_row *child_row = NULL; spin_lock_bh(&sync_dev->row_spinlocks[idx]); INIT_LIST_HEAD(&row->parents_list); INIT_LIST_HEAD(&row->parents_list); INIT_LIST_HEAD(&row->children_list); INIT_LIST_HEAD(&row->children_list); Loading @@ -147,7 +146,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, if (!child_info) { if (!child_info) { cam_sync_util_cleanup_children_list( cam_sync_util_cleanup_children_list( &row->children_list); &row->children_list); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -ENOMEM; return -ENOMEM; } } Loading @@ -166,7 +164,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, cam_sync_util_cleanup_children_list( cam_sync_util_cleanup_children_list( &row->children_list); &row->children_list); spin_unlock_bh(&sync_dev->row_spinlocks[sync_objs[i]]); spin_unlock_bh(&sync_dev->row_spinlocks[sync_objs[i]]); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -ENOMEM; return -ENOMEM; } } parent_info->sync_id = idx; parent_info->sync_id = idx; Loading @@ -182,7 +179,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, sync_objs, num_objs); sync_objs, num_objs); if (remaining < 0) { if (remaining < 0) { CAM_ERR(CAM_SYNC, "Failed getting remaining count"); CAM_ERR(CAM_SYNC, "Failed getting remaining count"); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -ENODEV; return -ENODEV; } } Loading @@ -195,7 +191,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, if (row->state != CAM_SYNC_STATE_ACTIVE) if (row->state != CAM_SYNC_STATE_ACTIVE) complete_all(&row->signaled); complete_all(&row->signaled); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return 0; return 0; } } Loading Loading
drivers/media/platform/msm/camera/cam_sync/cam_sync.c +10 −14 Original line number Original line Diff line number Diff line Loading @@ -312,30 +312,26 @@ int cam_sync_merge(int32_t *sync_obj, uint32_t num_objs, int32_t *merged_obj) return -EINVAL; return -EINVAL; } } rc = cam_sync_util_find_and_set_empty_row(sync_dev, &idx); do { if (rc < 0) { idx = find_first_zero_bit(sync_dev->bitmap, CAM_SYNC_MAX_OBJS); CAM_ERR(CAM_SYNC, if (idx >= CAM_SYNC_MAX_OBJS) "Error: Unable to find empty row, table full"); return -ENOMEM; return -EINVAL; } while (!spin_trylock_bh(&sync_dev->row_spinlocks[idx])); } if (idx <= 0 || idx >= CAM_SYNC_MAX_OBJS) { set_bit(idx, sync_dev->bitmap); CAM_ERR(CAM_SYNC, "Error: Invalid empty row index returned = %ld", idx); return -EINVAL; } rc = cam_sync_init_group_object(sync_dev->sync_table, rc = cam_sync_init_group_object(sync_dev->sync_table, idx, sync_obj, idx, sync_obj, num_objs); num_objs); if (rc < 0) { if (rc < 0) { CAM_ERR(CAM_SYNC, "Error: Unable to init row at idx = %ld", CAM_ERR(CAM_SYNC, "Error: Unable to init row at idx = %ld", idx); idx); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -EINVAL; return -EINVAL; } } *merged_obj = idx; *merged_obj = idx; spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return 0; return 0; } } Loading
drivers/media/platform/msm/camera/cam_sync/cam_sync_util.c +0 −5 Original line number Original line Diff line number Diff line Loading @@ -131,7 +131,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, struct sync_table_row *row = table + idx; struct sync_table_row *row = table + idx; struct sync_table_row *child_row = NULL; struct sync_table_row *child_row = NULL; spin_lock_bh(&sync_dev->row_spinlocks[idx]); INIT_LIST_HEAD(&row->parents_list); INIT_LIST_HEAD(&row->parents_list); INIT_LIST_HEAD(&row->children_list); INIT_LIST_HEAD(&row->children_list); Loading @@ -147,7 +146,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, if (!child_info) { if (!child_info) { cam_sync_util_cleanup_children_list( cam_sync_util_cleanup_children_list( &row->children_list); &row->children_list); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -ENOMEM; return -ENOMEM; } } Loading @@ -166,7 +164,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, cam_sync_util_cleanup_children_list( cam_sync_util_cleanup_children_list( &row->children_list); &row->children_list); spin_unlock_bh(&sync_dev->row_spinlocks[sync_objs[i]]); spin_unlock_bh(&sync_dev->row_spinlocks[sync_objs[i]]); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -ENOMEM; return -ENOMEM; } } parent_info->sync_id = idx; parent_info->sync_id = idx; Loading @@ -182,7 +179,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, sync_objs, num_objs); sync_objs, num_objs); if (remaining < 0) { if (remaining < 0) { CAM_ERR(CAM_SYNC, "Failed getting remaining count"); CAM_ERR(CAM_SYNC, "Failed getting remaining count"); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return -ENODEV; return -ENODEV; } } Loading @@ -195,7 +191,6 @@ int cam_sync_init_group_object(struct sync_table_row *table, if (row->state != CAM_SYNC_STATE_ACTIVE) if (row->state != CAM_SYNC_STATE_ACTIVE) complete_all(&row->signaled); complete_all(&row->signaled); spin_unlock_bh(&sync_dev->row_spinlocks[idx]); return 0; return 0; } } Loading