Lines Matching refs:max_size
119 u32 size, max_size = args->return_size; in hw_events_info() local
123 if ((!max_size) || (!out)) in hw_events_info()
132 return copy_to_user(out, arr, min(max_size, size)) ? -EFAULT : 0; in hw_events_info()
137 u32 max_size = args->return_size; in events_info() local
141 if ((max_size < sizeof(u64)) || (!out)) in events_info()
156 u32 max_size = args->return_size; in dram_usage_info() local
161 if ((!max_size) || (!out)) in dram_usage_info()
173 min((size_t) max_size, sizeof(dram_usage))) ? -EFAULT : 0; in dram_usage_info()
179 u32 max_size = args->return_size; in hw_idle() local
182 if ((!max_size) || (!out)) in hw_idle()
192 min((size_t) max_size, sizeof(hw_idle))) ? -EFAULT : 0; in hw_idle()
263 u32 max_size = args->return_size; in device_utilization() local
267 if ((!max_size) || (!out)) in device_utilization()
275 min((size_t) max_size, sizeof(device_util))) ? -EFAULT : 0; in device_utilization()
281 u32 max_size = args->return_size; in get_clk_rate() local
285 if ((!max_size) || (!out)) in get_clk_rate()
292 return copy_to_user(out, &clk_rate, min_t(size_t, max_size, sizeof(clk_rate))) in get_clk_rate()
299 u32 max_size = args->return_size; in get_reset_count() local
302 if ((!max_size) || (!out)) in get_reset_count()
309 min((size_t) max_size, sizeof(reset_count))) ? -EFAULT : 0; in get_reset_count()
315 u32 max_size = args->return_size; in time_sync_info() local
318 if ((!max_size) || (!out)) in time_sync_info()
325 min((size_t) max_size, sizeof(time_sync))) ? -EFAULT : 0; in time_sync_info()
332 u32 max_size = args->return_size; in pci_counters_info() local
336 if ((!max_size) || (!out)) in pci_counters_info()
344 min((size_t) max_size, sizeof(pci_counters))) ? -EFAULT : 0; in pci_counters_info()
353 u32 max_size = args->return_size; in clk_throttle_info() local
356 if ((!max_size) || (!out)) in clk_throttle_info()
383 min((size_t) max_size, sizeof(clk_throttle))) ? -EFAULT : 0; in clk_throttle_info()
392 u32 max_size = args->return_size; in cs_counters_info() local
396 if ((!max_size) || (!out)) in cs_counters_info()
434 min((size_t) max_size, sizeof(cs_counters))) ? -EFAULT : 0; in cs_counters_info()
442 u32 max_size = args->return_size; in sync_manager_info() local
445 if ((!max_size) || (!out)) in sync_manager_info()
458 return copy_to_user(out, &sm_info, min_t(size_t, (size_t) max_size, in sync_manager_info()
467 u32 max_size = args->return_size; in total_energy_consumption_info() local
471 if ((!max_size) || (!out)) in total_energy_consumption_info()
480 min((size_t) max_size, sizeof(total_energy))) ? -EFAULT : 0; in total_energy_consumption_info()
487 u32 max_size = args->return_size; in pll_frequency_info() local
491 if ((!max_size) || (!out)) in pll_frequency_info()
499 min((size_t) max_size, sizeof(freq_info))) ? -EFAULT : 0; in pll_frequency_info()
505 u32 max_size = args->return_size; in power_info() local
510 if ((!max_size) || (!out)) in power_info()
518 min((size_t) max_size, sizeof(power_info))) ? -EFAULT : 0; in power_info()
524 u32 max_size = args->return_size; in open_stats_info() local
528 if ((!max_size) || (!out)) in open_stats_info()
538 min((size_t) max_size, sizeof(open_stats_info))) ? -EFAULT : 0; in open_stats_info()
544 u32 max_size = args->return_size; in dram_pending_rows_info() local
549 if ((!max_size) || (!out)) in dram_pending_rows_info()
557 min_t(size_t, max_size, sizeof(pend_rows_num))) ? -EFAULT : 0; in dram_pending_rows_info()
563 u32 max_size = args->return_size; in dram_replaced_rows_info() local
568 if ((!max_size) || (!out)) in dram_replaced_rows_info()
575 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in dram_replaced_rows_info()
582 u32 max_size = args->return_size; in last_err_open_dev_info() local
585 if ((!max_size) || (!out)) in last_err_open_dev_info()
590 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in last_err_open_dev_info()
597 u32 max_size = args->return_size; in cs_timeout_info() local
600 if ((!max_size) || (!out)) in cs_timeout_info()
606 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in cs_timeout_info()
613 u32 max_size = args->return_size; in razwi_info() local
616 if ((!max_size) || (!out)) in razwi_info()
624 min_t(size_t, max_size, sizeof(struct hl_info_razwi_event))) ? -EFAULT : 0; in razwi_info()
630 u32 max_size = args->return_size; in undefined_opcode_info() local
634 if ((!max_size) || (!out)) in undefined_opcode_info()
646 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in undefined_opcode_info()
654 u32 max_size = args->return_size; in dev_mem_alloc_page_sizes_info() local
656 if ((!max_size) || (!out)) in dev_mem_alloc_page_sizes_info()
667 return copy_to_user(out, &info, min_t(size_t, max_size, sizeof(info))) ? -EFAULT : 0; in dev_mem_alloc_page_sizes_info()
675 u32 max_size = args->return_size; in sec_attest_info() local
678 if ((!max_size) || (!out)) in sec_attest_info()
709 min_t(size_t, max_size, sizeof(*info))) ? -EFAULT : 0; in sec_attest_info()
796 u32 max_size = args->return_size; in page_fault_info() local
799 if ((!max_size) || (!out)) in page_fault_info()
807 min_t(size_t, max_size, sizeof(struct hl_page_fault_info))) ? -EFAULT : 0; in page_fault_info()