Lines Matching refs:max_size

124 	u32 size, max_size = args->return_size;  in hw_events_info()  local
128 if ((!max_size) || (!out)) in hw_events_info()
137 return copy_to_user(out, arr, min(max_size, size)) ? -EFAULT : 0; in hw_events_info()
142 u32 max_size = args->return_size; in events_info() local
146 if ((max_size < sizeof(u64)) || (!out)) in events_info()
161 u32 max_size = args->return_size; in dram_usage_info() local
166 if ((!max_size) || (!out)) in dram_usage_info()
178 min((size_t) max_size, sizeof(dram_usage))) ? -EFAULT : 0; in dram_usage_info()
184 u32 max_size = args->return_size; in hw_idle() local
187 if ((!max_size) || (!out)) in hw_idle()
197 min((size_t) max_size, sizeof(hw_idle))) ? -EFAULT : 0; in hw_idle()
268 u32 max_size = args->return_size; in device_utilization() local
272 if ((!max_size) || (!out)) in device_utilization()
280 min((size_t) max_size, sizeof(device_util))) ? -EFAULT : 0; in device_utilization()
286 u32 max_size = args->return_size; in get_clk_rate() local
290 if ((!max_size) || (!out)) in get_clk_rate()
297 return copy_to_user(out, &clk_rate, min_t(size_t, max_size, sizeof(clk_rate))) in get_clk_rate()
304 u32 max_size = args->return_size; in get_reset_count() local
307 if ((!max_size) || (!out)) in get_reset_count()
314 min((size_t) max_size, sizeof(reset_count))) ? -EFAULT : 0; in get_reset_count()
320 u32 max_size = args->return_size; in time_sync_info() local
323 if ((!max_size) || (!out)) in time_sync_info()
331 min((size_t) max_size, sizeof(time_sync))) ? -EFAULT : 0; in time_sync_info()
338 u32 max_size = args->return_size; in pci_counters_info() local
342 if ((!max_size) || (!out)) in pci_counters_info()
350 min((size_t) max_size, sizeof(pci_counters))) ? -EFAULT : 0; in pci_counters_info()
359 u32 max_size = args->return_size; in clk_throttle_info() local
362 if ((!max_size) || (!out)) in clk_throttle_info()
389 min((size_t) max_size, sizeof(clk_throttle))) ? -EFAULT : 0; in clk_throttle_info()
398 u32 max_size = args->return_size; in cs_counters_info() local
402 if ((!max_size) || (!out)) in cs_counters_info()
440 min((size_t) max_size, sizeof(cs_counters))) ? -EFAULT : 0; in cs_counters_info()
448 u32 max_size = args->return_size; in sync_manager_info() local
451 if ((!max_size) || (!out)) in sync_manager_info()
464 return copy_to_user(out, &sm_info, min_t(size_t, (size_t) max_size, in sync_manager_info()
473 u32 max_size = args->return_size; in total_energy_consumption_info() local
477 if ((!max_size) || (!out)) in total_energy_consumption_info()
486 min((size_t) max_size, sizeof(total_energy))) ? -EFAULT : 0; in total_energy_consumption_info()
493 u32 max_size = args->return_size; in pll_frequency_info() local
497 if ((!max_size) || (!out)) in pll_frequency_info()
505 min((size_t) max_size, sizeof(freq_info))) ? -EFAULT : 0; in pll_frequency_info()
511 u32 max_size = args->return_size; in power_info() local
516 if ((!max_size) || (!out)) in power_info()
524 min((size_t) max_size, sizeof(power_info))) ? -EFAULT : 0; in power_info()
530 u32 max_size = args->return_size; in open_stats_info() local
534 if ((!max_size) || (!out)) in open_stats_info()
544 min((size_t) max_size, sizeof(open_stats_info))) ? -EFAULT : 0; in open_stats_info()
550 u32 max_size = args->return_size; in dram_pending_rows_info() local
555 if ((!max_size) || (!out)) in dram_pending_rows_info()
563 min_t(size_t, max_size, sizeof(pend_rows_num))) ? -EFAULT : 0; in dram_pending_rows_info()
569 u32 max_size = args->return_size; in dram_replaced_rows_info() local
574 if ((!max_size) || (!out)) in dram_replaced_rows_info()
581 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in dram_replaced_rows_info()
588 u32 max_size = args->return_size; in last_err_open_dev_info() local
591 if ((!max_size) || (!out)) in last_err_open_dev_info()
596 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in last_err_open_dev_info()
603 u32 max_size = args->return_size; in cs_timeout_info() local
606 if ((!max_size) || (!out)) in cs_timeout_info()
612 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in cs_timeout_info()
619 u32 max_size = args->return_size; in razwi_info() local
622 if ((!max_size) || (!out)) in razwi_info()
630 min_t(size_t, max_size, sizeof(struct hl_info_razwi_event))) ? -EFAULT : 0; in razwi_info()
636 u32 max_size = args->return_size; in undefined_opcode_info() local
640 if ((!max_size) || (!out)) in undefined_opcode_info()
652 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in undefined_opcode_info()
660 u32 max_size = args->return_size; in dev_mem_alloc_page_sizes_info() local
662 if ((!max_size) || (!out)) in dev_mem_alloc_page_sizes_info()
673 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in dev_mem_alloc_page_sizes_info()
681 u32 max_size = args->return_size; in sec_attest_info() local
684 if ((!max_size) || (!out)) in sec_attest_info()
715 min_t(size_t, max_size, sizeof(*info))) ? -EFAULT : 0; in sec_attest_info()
730 u32 max_size = args->return_size; in dev_info_signed() local
733 if ((!max_size) || (!out)) in dev_info_signed()
761 rc = copy_to_user(out, info, min_t(size_t, max_size, sizeof(*info))) ? -EFAULT : 0; in dev_info_signed()
849 u32 max_size = args->return_size; in page_fault_info() local
852 if ((!max_size) || (!out)) in page_fault_info()
860 min_t(size_t, max_size, sizeof(struct hl_page_fault_info))) ? -EFAULT : 0; in page_fault_info()