habanalabs: eliminate aggregate use warning
When doing sizeof() and giving as argument a dereference of a pointer-to-a-pointer object, clang will issue a warning. Eliminate the warning by passing struct <name>* Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
This commit is contained in:
parent
e403856468
commit
259cee1c24
@ -2571,7 +2571,7 @@ static int hl_cs_poll_fences(struct multi_cs_data *mcs_data, struct multi_cs_com
|
|||||||
ktime_t max_ktime, first_cs_time;
|
ktime_t max_ktime, first_cs_time;
|
||||||
enum hl_cs_wait_status status;
|
enum hl_cs_wait_status status;
|
||||||
|
|
||||||
memset(fence_ptr, 0, arr_len * sizeof(*fence_ptr));
|
memset(fence_ptr, 0, arr_len * sizeof(struct hl_fence *));
|
||||||
|
|
||||||
/* get all fences under the same lock */
|
/* get all fences under the same lock */
|
||||||
rc = hl_ctx_get_fences(mcs_data->ctx, seq_arr, fence_ptr, arr_len);
|
rc = hl_ctx_get_fences(mcs_data->ctx, seq_arr, fence_ptr, arr_len);
|
||||||
@ -2873,7 +2873,7 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* allocate array for the fences */
|
/* allocate array for the fences */
|
||||||
fence_arr = kmalloc_array(seq_arr_len, sizeof(*fence_arr), GFP_KERNEL);
|
fence_arr = kmalloc_array(seq_arr_len, sizeof(struct hl_fence *), GFP_KERNEL);
|
||||||
if (!fence_arr) {
|
if (!fence_arr) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto free_seq_arr;
|
goto free_seq_arr;
|
||||||
|
@ -719,7 +719,7 @@ static int device_early_init(struct hl_device *hdev)
|
|||||||
|
|
||||||
if (hdev->asic_prop.completion_queues_count) {
|
if (hdev->asic_prop.completion_queues_count) {
|
||||||
hdev->cq_wq = kcalloc(hdev->asic_prop.completion_queues_count,
|
hdev->cq_wq = kcalloc(hdev->asic_prop.completion_queues_count,
|
||||||
sizeof(*hdev->cq_wq),
|
sizeof(struct workqueue_struct *),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!hdev->cq_wq) {
|
if (!hdev->cq_wq) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
@ -1863,7 +1863,7 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass)
|
|||||||
}
|
}
|
||||||
|
|
||||||
hdev->shadow_cs_queue = kcalloc(hdev->asic_prop.max_pending_cs,
|
hdev->shadow_cs_queue = kcalloc(hdev->asic_prop.max_pending_cs,
|
||||||
sizeof(*hdev->shadow_cs_queue), GFP_KERNEL);
|
sizeof(struct hl_cs *), GFP_KERNEL);
|
||||||
if (!hdev->shadow_cs_queue) {
|
if (!hdev->shadow_cs_queue) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto cq_fini;
|
goto cq_fini;
|
||||||
|
@ -826,9 +826,7 @@ static int ext_and_cpu_queue_init(struct hl_device *hdev, struct hl_hw_queue *q,
|
|||||||
|
|
||||||
q->kernel_address = p;
|
q->kernel_address = p;
|
||||||
|
|
||||||
q->shadow_queue = kmalloc_array(HL_QUEUE_LENGTH,
|
q->shadow_queue = kmalloc_array(HL_QUEUE_LENGTH, sizeof(struct hl_cs_job *), GFP_KERNEL);
|
||||||
sizeof(*q->shadow_queue),
|
|
||||||
GFP_KERNEL);
|
|
||||||
if (!q->shadow_queue) {
|
if (!q->shadow_queue) {
|
||||||
dev_err(hdev->dev,
|
dev_err(hdev->dev,
|
||||||
"Failed to allocate shadow queue for H/W queue %d\n",
|
"Failed to allocate shadow queue for H/W queue %d\n",
|
||||||
|
@ -194,7 +194,8 @@ int hl_build_hwmon_channel_info(struct hl_device *hdev, struct cpucp_sensor *sen
|
|||||||
curr_arr[sensors_by_type_next_index[type]++] = flags;
|
curr_arr[sensors_by_type_next_index[type]++] = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
channels_info = kcalloc(num_active_sensor_types + 1, sizeof(*channels_info), GFP_KERNEL);
|
channels_info = kcalloc(num_active_sensor_types + 1, sizeof(struct hwmon_channel_info *),
|
||||||
|
GFP_KERNEL);
|
||||||
if (!channels_info) {
|
if (!channels_info) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto channels_info_array_err;
|
goto channels_info_array_err;
|
||||||
|
@ -2308,8 +2308,7 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size,
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
userptr->pages = kvmalloc_array(npages, sizeof(*userptr->pages),
|
userptr->pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
|
||||||
GFP_KERNEL);
|
|
||||||
if (!userptr->pages)
|
if (!userptr->pages)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user