Merge tag 'drm-amdkfd-next-2016-05-04' of git://people.freedesktop.org/~gabbayo/linux into drm-next

Here are a few amdkfd patches for 4.7, all of them fixes according to
the Coccinelle tool.

* tag 'drm-amdkfd-next-2016-05-04' of git://people.freedesktop.org/~gabbayo/linux:
  amdkfd: Trim unnescessary intermediate err var in kfd_chardev.c
  amdkfd: Trim off unnescessary semicolon from kfd_packet_manager.c
  amdkfd: Use the canonical form in branch predicates
This commit is contained in:
Dave Airlie 2016-05-04 17:43:23 +10:00
commit 090e1a7f5c
5 changed files with 16 additions and 17 deletions

View File

@ -109,7 +109,7 @@ static int kfd_open(struct inode *inode, struct file *filep)
is_32bit_user_mode = in_compat_syscall(); is_32bit_user_mode = in_compat_syscall();
if (is_32bit_user_mode == true) { if (is_32bit_user_mode) {
dev_warn(kfd_device, dev_warn(kfd_device,
"Process %d (32-bit) failed to open /dev/kfd\n" "Process %d (32-bit) failed to open /dev/kfd\n"
"32-bit processes are not supported by amdkfd\n", "32-bit processes are not supported by amdkfd\n",
@ -131,12 +131,11 @@ static int kfd_ioctl_get_version(struct file *filep, struct kfd_process *p,
void *data) void *data)
{ {
struct kfd_ioctl_get_version_args *args = data; struct kfd_ioctl_get_version_args *args = data;
int err = 0;
args->major_version = KFD_IOCTL_MAJOR_VERSION; args->major_version = KFD_IOCTL_MAJOR_VERSION;
args->minor_version = KFD_IOCTL_MINOR_VERSION; args->minor_version = KFD_IOCTL_MINOR_VERSION;
return err; return 0;
} }
static int set_queue_properties_from_user(struct queue_properties *q_properties, static int set_queue_properties_from_user(struct queue_properties *q_properties,

View File

@ -216,7 +216,7 @@ static int allocate_hqd(struct device_queue_manager *dqm, struct queue *q)
} }
} }
if (set == false) if (!set)
return -EBUSY; return -EBUSY;
pr_debug("kfd: DQM %s hqd slot - pipe (%d) queue(%d)\n", pr_debug("kfd: DQM %s hqd slot - pipe (%d) queue(%d)\n",
@ -354,7 +354,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
return -ENOMEM; return -ENOMEM;
} }
if (q->properties.is_active == true) if (q->properties.is_active)
prev_active = true; prev_active = true;
/* /*
@ -363,9 +363,9 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
* and modify counter accordingly * and modify counter accordingly
*/ */
retval = mqd->update_mqd(mqd, q->mqd, &q->properties); retval = mqd->update_mqd(mqd, q->mqd, &q->properties);
if ((q->properties.is_active == true) && (prev_active == false)) if ((q->properties.is_active) && (!prev_active))
dqm->queue_count++; dqm->queue_count++;
else if ((q->properties.is_active == false) && (prev_active == true)) else if ((!q->properties.is_active) && (prev_active))
dqm->queue_count--; dqm->queue_count--;
if (sched_policy != KFD_SCHED_POLICY_NO_HWS) if (sched_policy != KFD_SCHED_POLICY_NO_HWS)
@ -954,7 +954,7 @@ static int destroy_queues_cpsch(struct device_queue_manager *dqm,
if (lock) if (lock)
mutex_lock(&dqm->lock); mutex_lock(&dqm->lock);
if (dqm->active_runlist == false) if (!dqm->active_runlist)
goto out; goto out;
pr_debug("kfd: Before destroying queues, sdma queue count is : %u\n", pr_debug("kfd: Before destroying queues, sdma queue count is : %u\n",

View File

@ -177,9 +177,9 @@ static bool allocate_event_notification_slot(struct file *devkfd,
bool ret; bool ret;
ret = allocate_free_slot(p, page, signal_slot_index); ret = allocate_free_slot(p, page, signal_slot_index);
if (ret == false) { if (!ret) {
ret = allocate_signal_page(devkfd, p); ret = allocate_signal_page(devkfd, p);
if (ret == true) if (ret)
ret = allocate_free_slot(p, page, signal_slot_index); ret = allocate_free_slot(p, page, signal_slot_index);
} }

View File

@ -300,7 +300,7 @@ struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,
break; break;
} }
if (kq->ops.initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE) == false) { if (!kq->ops.initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE)) {
pr_err("amdkfd: failed to init kernel queue\n"); pr_err("amdkfd: failed to init kernel queue\n");
kfree(kq); kfree(kq);
return NULL; return NULL;

View File

@ -98,7 +98,7 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm,
int retval; int retval;
BUG_ON(!pm); BUG_ON(!pm);
BUG_ON(pm->allocated == true); BUG_ON(pm->allocated);
BUG_ON(is_over_subscription == NULL); BUG_ON(is_over_subscription == NULL);
pm_calc_rlib_size(pm, rl_buffer_size, is_over_subscription); pm_calc_rlib_size(pm, rl_buffer_size, is_over_subscription);
@ -292,7 +292,7 @@ static int pm_create_map_queue(struct packet_manager *pm, uint32_t *buffer,
q->properties.doorbell_off; q->properties.doorbell_off;
packet->mes_map_queues_ordinals[0].bitfields3.is_static = packet->mes_map_queues_ordinals[0].bitfields3.is_static =
(use_static == true) ? 1 : 0; (use_static) ? 1 : 0;
packet->mes_map_queues_ordinals[0].mqd_addr_lo = packet->mes_map_queues_ordinals[0].mqd_addr_lo =
lower_32_bits(q->gart_mqd_addr); lower_32_bits(q->gart_mqd_addr);
@ -357,7 +357,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
alloc_size_bytes); alloc_size_bytes);
list_for_each_entry(kq, &qpd->priv_queue_list, list) { list_for_each_entry(kq, &qpd->priv_queue_list, list) {
if (kq->queue->properties.is_active != true) if (!kq->queue->properties.is_active)
continue; continue;
pr_debug("kfd: static_queue, mapping kernel q %d, is debug status %d\n", pr_debug("kfd: static_queue, mapping kernel q %d, is debug status %d\n",
@ -383,7 +383,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm,
} }
list_for_each_entry(q, &qpd->queues_list, list) { list_for_each_entry(q, &qpd->queues_list, list) {
if (q->properties.is_active != true) if (!q->properties.is_active)
continue; continue;
pr_debug("kfd: static_queue, mapping user queue %d, is debug status %d\n", pr_debug("kfd: static_queue, mapping user queue %d, is debug status %d\n",
@ -531,7 +531,7 @@ fail_create_runlist:
fail_acquire_packet_buffer: fail_acquire_packet_buffer:
mutex_unlock(&pm->lock); mutex_unlock(&pm->lock);
fail_create_runlist_ib: fail_create_runlist_ib:
if (pm->allocated == true) if (pm->allocated)
pm_release_ib(pm); pm_release_ib(pm);
return retval; return retval;
} }
@ -647,7 +647,7 @@ int pm_send_unmap_queue(struct packet_manager *pm, enum kfd_queue_type type,
default: default:
BUG(); BUG();
break; break;
}; }
pm->priv_queue->ops.submit_packet(pm->priv_queue); pm->priv_queue->ops.submit_packet(pm->priv_queue);