clamp_val 513 arch/x86/mm/init.c u64 start = clamp_val(PFN_PHYS(start_pfn), r_start, r_end); clamp_val 514 arch/x86/mm/init.c u64 end = clamp_val(PFN_PHYS(end_pfn), r_start, r_end); clamp_val 998 block/bfq-iosched.c return clamp_val(dur, msecs_to_jiffies(3000), msecs_to_jiffies(25000)); clamp_val 512 drivers/acpi/apei/erst.c new_size = clamp_val(new_size, ERST_RECORD_ID_CACHE_SIZE_MIN, clamp_val 181 drivers/ata/pata_ali.c t->setup = clamp_val(t->setup, 1, 8) & 7; clamp_val 182 drivers/ata/pata_ali.c t->act8b = clamp_val(t->act8b, 1, 8) & 7; clamp_val 183 drivers/ata/pata_ali.c t->rec8b = clamp_val(t->rec8b, 1, 16) & 15; clamp_val 184 drivers/ata/pata_ali.c t->active = clamp_val(t->active, 1, 8) & 7; clamp_val 185 drivers/ata/pata_ali.c t->recover = clamp_val(t->recover, 1, 16) & 15; clamp_val 86 drivers/ata/pata_amd.c t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(at.setup, 1, 4) - 1) << ((3 - dn) << 1)); clamp_val 91 drivers/ata/pata_amd.c ((clamp_val(at.act8b, 1, 16) - 1) << 4) | (clamp_val(at.rec8b, 1, 16) - 1)); clamp_val 95 drivers/ata/pata_amd.c ((clamp_val(at.active, 1, 16) - 1) << 4) | (clamp_val(at.recover, 1, 16) - 1)); clamp_val 99 drivers/ata/pata_amd.c t = at.udma ? (0xc0 | (clamp_val(at.udma, 2, 5) - 2)) : 0x03; clamp_val 103 drivers/ata/pata_amd.c t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 2, 10)]) : 0x03; clamp_val 107 drivers/ata/pata_amd.c t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 10)]) : 0x03; clamp_val 111 drivers/ata/pata_amd.c t = at.udma ? (0xc0 | amd_cyc2udma[clamp_val(at.udma, 1, 15)]) : 0x03; clamp_val 65 drivers/ata/pata_cypress.c time_16 = clamp_val(t.recover - 1, 0, 15) | clamp_val 66 drivers/ata/pata_cypress.c (clamp_val(t.active - 1, 0, 15) << 4); clamp_val 67 drivers/ata/pata_cypress.c time_8 = clamp_val(t.act8b - 1, 0, 15) | clamp_val 68 drivers/ata/pata_cypress.c (clamp_val(t.rec8b - 1, 0, 15) << 4); clamp_val 74 drivers/ata/pata_cypress.c addr |= clamp_val(t.setup - 1, 0, 15); clamp_val 84 drivers/ata/pata_cypress.c addr |= (clamp_val(t.setup - 1, 0, 15) << 4); clamp_val 356 drivers/ata/pata_legacy.c active = clamp_val(t.active, 2, 15); clamp_val 357 drivers/ata/pata_legacy.c recover = clamp_val(t.recover, 4, 15); clamp_val 390 drivers/ata/pata_legacy.c active = clamp_val(t.active, 2, 15); clamp_val 391 drivers/ata/pata_legacy.c recover = clamp_val(t.recover, 2, 16) & 0x0F; clamp_val 474 drivers/ata/pata_legacy.c active = clamp_val(t.active, 2, 17) - 2; clamp_val 475 drivers/ata/pata_legacy.c recover = clamp_val(t.recover, 1, 16) - 1; clamp_val 476 drivers/ata/pata_legacy.c setup = clamp_val(t.setup, 1, 4) - 1; clamp_val 553 drivers/ata/pata_legacy.c active = clamp_val(t.active, 2, 17) - 2; clamp_val 554 drivers/ata/pata_legacy.c recover = clamp_val(t.recover, 1, 16) - 1; clamp_val 555 drivers/ata/pata_legacy.c setup = clamp_val(t.setup, 1, 4) - 1; clamp_val 649 drivers/ata/pata_legacy.c active = 8 - clamp_val(t.active, 1, 8); clamp_val 650 drivers/ata/pata_legacy.c recovery = 18 - clamp_val(t.recover, 3, 18); clamp_val 652 drivers/ata/pata_legacy.c active = 9 - clamp_val(t.active, 2, 9); clamp_val 653 drivers/ata/pata_legacy.c recovery = 15 - clamp_val(t.recover, 0, 15); clamp_val 791 drivers/ata/pata_legacy.c active = (clamp_val(t.active, 3, 17) - 1) & 0x0F; clamp_val 792 drivers/ata/pata_legacy.c recovery = (clamp_val(t.recover, 1, 15) + 1) & 0x0F; clamp_val 803 drivers/ata/pata_legacy.c reg |= (clamp_val(t.setup, 0, 3) << 6); clamp_val 79 drivers/ata/pata_ns87410.c at.active = clamp_val(at.active, 2, 16) - 2; clamp_val 80 drivers/ata/pata_ns87410.c at.setup = clamp_val(at.setup, 1, 4) - 1; clamp_val 81 drivers/ata/pata_ns87410.c at.recover = clamp_val(at.recover, 1, 12) - 1; clamp_val 69 drivers/ata/pata_ns87415.c clocking = 17 - clamp_val(t.active, 2, 17); clamp_val 70 drivers/ata/pata_ns87415.c clocking |= (16 - clamp_val(t.recover, 1, 16)) << 4; clamp_val 284 drivers/ata/pata_via.c setup |= (clamp_val(t.setup, 1, 4) - 1) << shift; clamp_val 290 drivers/ata/pata_via.c ((clamp_val(t.act8b, 1, 16) - 1) << 4) | (clamp_val(t.rec8b, 1, 16) - 1)); clamp_val 292 drivers/ata/pata_via.c ((clamp_val(t.active, 1, 16) - 1) << 4) | (clamp_val(t.recover, 1, 16) - 1)); clamp_val 298 drivers/ata/pata_via.c ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 5) - 2)) : 0x03; clamp_val 301 drivers/ata/pata_via.c ut = t.udma ? (0xe8 | (clamp_val(t.udma, 2, 9) - 2)) : 0x0f; clamp_val 304 drivers/ata/pata_via.c ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; clamp_val 307 drivers/ata/pata_via.c ut = t.udma ? (0xe0 | (clamp_val(t.udma, 2, 9) - 2)) : 0x07; clamp_val 132 drivers/clk/microchip/clk-core.c div = clamp_val(div, divider_min, divider_max); clamp_val 133 drivers/clk/microchip/clk-core.c div_up = clamp_val(div + 1, divider_min, divider_max); clamp_val 591 drivers/clk/microchip/clk-core.c odiv = clamp_val(odiv, PLL_ODIV_MIN, PLL_ODIV_MAX); clamp_val 532 drivers/cpufreq/cpufreq.c target_freq = clamp_val(target_freq, policy->min, policy->max); clamp_val 2024 drivers/cpufreq/cpufreq.c target_freq = clamp_val(target_freq, policy->min, policy->max); clamp_val 2124 drivers/cpufreq/cpufreq.c target_freq = clamp_val(target_freq, policy->min, policy->max); clamp_val 1081 drivers/firewire/sbp2.c tgt->mgt_orb_timeout = clamp_val(timeout, 5000, 40000); clamp_val 131 drivers/gpu/drm/drm_color_mgmt.c return clamp_val(val, 0, max); clamp_val 55 drivers/gpu/drm/i915/display/intel_color.c (clamp_val(((coeff) >> (32 - (fbits) - 3)) + 4, 0, 0xfff) & 0xff8) clamp_val 121 drivers/gpu/drm/i915/display/intel_color.c u32 abs_coeff = clamp_val(CTM_COEFF_ABS(user_coeff), 0, clamp_val 227 drivers/gpu/drm/i915/display/intel_color.c abs_coeff = clamp_val(abs_coeff, 0, CTM_COEFF_4_0 - 1); clamp_val 341 drivers/gpu/drm/i915/display/intel_color.c abs_coeff = clamp_val(abs_coeff, 0, CTM_COEFF_8_0 - 1); clamp_val 287 drivers/gpu/drm/mediatek/mtk_mipi_tx.c return clamp_val(rate, 50000000, 1250000000); clamp_val 203 drivers/gpu/drm/sti/sti_cursor.c dst_w = clamp_val(state->crtc_w, 0, mode->crtc_hdisplay - dst_x); clamp_val 204 drivers/gpu/drm/sti/sti_cursor.c dst_h = clamp_val(state->crtc_h, 0, mode->crtc_vdisplay - dst_y); clamp_val 639 drivers/gpu/drm/sti/sti_gdp.c dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); clamp_val 640 drivers/gpu/drm/sti/sti_gdp.c dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); clamp_val 644 drivers/gpu/drm/sti/sti_gdp.c src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH); clamp_val 645 drivers/gpu/drm/sti/sti_gdp.c src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT); clamp_val 748 drivers/gpu/drm/sti/sti_gdp.c dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); clamp_val 749 drivers/gpu/drm/sti/sti_gdp.c dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); clamp_val 753 drivers/gpu/drm/sti/sti_gdp.c src_w = clamp_val(state->src_w >> 16, 0, GAM_GDP_SIZE_MAX_WIDTH); clamp_val 754 drivers/gpu/drm/sti/sti_gdp.c src_h = clamp_val(state->src_h >> 16, 0, GAM_GDP_SIZE_MAX_HEIGHT); clamp_val 1039 drivers/gpu/drm/sti/sti_hqvdp.c dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); clamp_val 1040 drivers/gpu/drm/sti/sti_hqvdp.c dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); clamp_val 1146 drivers/gpu/drm/sti/sti_hqvdp.c dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); clamp_val 1147 drivers/gpu/drm/sti/sti_hqvdp.c dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); clamp_val 146 drivers/gpu/drm/sti/sti_vid.c int dst_w = clamp_val(state->crtc_w, 0, mode->hdisplay - dst_x); clamp_val 147 drivers/gpu/drm/sti/sti_vid.c int dst_h = clamp_val(state->crtc_h, 0, mode->vdisplay - dst_y); clamp_val 374 drivers/hid/wacom_wac.c rw = clamp_val(rw, 0, 31); clamp_val 166 drivers/hwmon/abx500.c val = clamp_val(val, 0, DEFAULT_MAX_TEMP); clamp_val 186 drivers/hwmon/abx500.c val = clamp_val(val, 0, DEFAULT_MAX_TEMP); clamp_val 207 drivers/hwmon/abx500.c val = clamp_val(val, 0, DEFAULT_MAX_TEMP); clamp_val 136 drivers/hwmon/ad7414.c temp = clamp_val(temp, -40000, 85000); clamp_val 179 drivers/hwmon/adc128d818.c regval = clamp_val(DIV_ROUND_CLOSEST(val, 10), 0, 255); clamp_val 217 drivers/hwmon/adc128d818.c regval = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); clamp_val 205 drivers/hwmon/adm1021.c reg_val = clamp_val(temp, -128, 127); clamp_val 231 drivers/hwmon/adm1021.c reg_val = clamp_val(temp, -128, 127); clamp_val 188 drivers/hwmon/adm1026.c SCALE(clamp_val(val, 0, 255 * adm1026_scaling[n] / 192), \ clamp_val 198 drivers/hwmon/adm1026.c clamp_val(1350000 / ((val) * (div)), \ clamp_val 206 drivers/hwmon/adm1026.c #define TEMP_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val(val, -128000, 127000), \ clamp_val 209 drivers/hwmon/adm1026.c #define OFFSET_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val(val, -128000, 127000), \ clamp_val 213 drivers/hwmon/adm1026.c #define PWM_TO_REG(val) (clamp_val(val, 0, 255)) clamp_val 224 drivers/hwmon/adm1026.c #define DAC_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val(val, 0, 2500) * 255, \ clamp_val 610 drivers/hwmon/adm1026.c clamp_val(val, INT_MIN, clamp_val 639 drivers/hwmon/adm1026.c clamp_val(val, INT_MIN, clamp_val 724 drivers/hwmon/adm1026.c new_min = clamp_val(new_min, 1, 254); clamp_val 1314 drivers/hwmon/adm1026.c data->pwm1.auto_pwm_min = clamp_val(val, 0, 255); clamp_val 215 drivers/hwmon/adm1031.c tmp = FAN_FROM_REG(clamp_val(reg, 0, 65535), div); clamp_val 221 drivers/hwmon/adm1031.c #define PWM_TO_REG(val) (clamp_val((val), 0, 255) >> 4) clamp_val 416 drivers/hwmon/adm1031.c val = clamp_val(val, 0, 127000); clamp_val 446 drivers/hwmon/adm1031.c val = clamp_val(val, 0, 127000); clamp_val 720 drivers/hwmon/adm1031.c val = clamp_val(val, -15000, 15000); clamp_val 742 drivers/hwmon/adm1031.c val = clamp_val(val, -55000, 127000); clamp_val 764 drivers/hwmon/adm1031.c val = clamp_val(val, -55000, 127000); clamp_val 786 drivers/hwmon/adm1031.c val = clamp_val(val, -55000, 127000); clamp_val 88 drivers/hwmon/adm9240.c val = clamp_val(val, 0, nom_mv[n] * 255 / 192); clamp_val 95 drivers/hwmon/adm9240.c val = clamp_val(val, -40000, 127000); clamp_val 114 drivers/hwmon/adm9240.c val = clamp_val(val, 0, 1250); clamp_val 147 drivers/hwmon/ads7828.c vref_mv = clamp_val(vref_mv, ADS7828_EXT_VREF_MV_MIN, clamp_val 436 drivers/hwmon/adt7411.c val = clamp_val(val, 0, 255 * 7000 / 256); clamp_val 464 drivers/hwmon/adt7411.c val = clamp_val(val, 0, 255 * data->vref_cached / 256); clamp_val 501 drivers/hwmon/adt7411.c val = clamp_val(val, -128000, 127000); clamp_val 802 drivers/hwmon/adt7462.c temp = clamp_val(temp, -64000, 191000); clamp_val 838 drivers/hwmon/adt7462.c temp = clamp_val(temp, -64000, 191000); clamp_val 899 drivers/hwmon/adt7462.c temp = clamp_val(temp, 0, 255 * x / 1000); clamp_val 939 drivers/hwmon/adt7462.c temp = clamp_val(temp, 0, 255 * x / 1000); clamp_val 1027 drivers/hwmon/adt7462.c temp = clamp_val(temp, 1, 255); clamp_val 1103 drivers/hwmon/adt7462.c temp = clamp_val(temp, 0, 255); clamp_val 1131 drivers/hwmon/adt7462.c temp = clamp_val(temp, 0, 255); clamp_val 1161 drivers/hwmon/adt7462.c temp = clamp_val(temp, 0, 255); clamp_val 1193 drivers/hwmon/adt7462.c temp = clamp_val(temp, 0, 15000); clamp_val 1275 drivers/hwmon/adt7462.c temp = clamp_val(temp, -64000, 191000); clamp_val 411 drivers/hwmon/adt7470.c temp = clamp_val(temp, 0, 60000); clamp_val 438 drivers/hwmon/adt7470.c temp = clamp_val(temp, -1, 10); clamp_val 469 drivers/hwmon/adt7470.c temp = clamp_val(temp, -128000, 127000); clamp_val 501 drivers/hwmon/adt7470.c temp = clamp_val(temp, -128000, 127000); clamp_val 577 drivers/hwmon/adt7470.c temp = clamp_val(temp, 1, 65534); clamp_val 613 drivers/hwmon/adt7470.c temp = clamp_val(temp, 1, 65534); clamp_val 687 drivers/hwmon/adt7470.c temp = clamp_val(temp, 0, 255); clamp_val 781 drivers/hwmon/adt7470.c temp = clamp_val(temp, 0, 255); clamp_val 812 drivers/hwmon/adt7470.c temp = clamp_val(temp, 0, 255); clamp_val 852 drivers/hwmon/adt7470.c temp = clamp_val(temp, -128000, 127000); clamp_val 230 drivers/hwmon/adt7475.c val = clamp_val(val, -64000, 191000); clamp_val 233 drivers/hwmon/adt7475.c val = clamp_val(val, -128000, 127000); clamp_val 269 drivers/hwmon/adt7475.c return clamp_val((90000 * 60) / rpm, 1, 0xFFFF); clamp_val 301 drivers/hwmon/adt7475.c return clamp_val(reg, 0, 1023) & (0xff << 2); clamp_val 463 drivers/hwmon/adt7475.c val = clamp_val(val, -63000, 127000); clamp_val 466 drivers/hwmon/adt7475.c val = clamp_val(val, -63000, 64000); clamp_val 483 drivers/hwmon/adt7475.c val = clamp_val(val, temp - 15000, temp); clamp_val 674 drivers/hwmon/adt7475.c val = clamp_val(val, temp + autorange_table[0], clamp_val 810 drivers/hwmon/adt7475.c data->pwm[sattr->nr][sattr->index] = clamp_val(val, 0, 0xFF); clamp_val 975 drivers/hwmon/adt7475.c idx = clamp_val(data->range[sattr->index] & 0xf, 0, clamp_val 200 drivers/hwmon/adt7x10.c return DIV_ROUND_CLOSEST(clamp_val(temp, ADT7X10_TEMP_MIN, clamp_val 295 drivers/hwmon/adt7x10.c hyst = clamp_val(hyst, ADT7X10_TEMP_MIN, ADT7X10_TEMP_MAX); clamp_val 296 drivers/hwmon/adt7x10.c data->hyst = clamp_val(DIV_ROUND_CLOSEST(limit - hyst, 1000), clamp_val 287 drivers/hwmon/amc6821.c val = clamp_val(val / 1000, -128, 127); clamp_val 364 drivers/hwmon/amc6821.c data->pwm1 = clamp_val(val , 0, 255); clamp_val 518 drivers/hwmon/amc6821.c ptemp[0] = clamp_val(val / 1000, 0, clamp_val 520 drivers/hwmon/amc6821.c ptemp[0] = clamp_val(ptemp[0], 0, clamp_val 522 drivers/hwmon/amc6821.c ptemp[0] = clamp_val(ptemp[0], 0, 63); clamp_val 533 drivers/hwmon/amc6821.c ptemp[1] = clamp_val(val / 1000, (ptemp[0] & 0x7C) + 4, 124); clamp_val 535 drivers/hwmon/amc6821.c ptemp[2] = clamp_val(ptemp[2], ptemp[1] + 1, 255); clamp_val 538 drivers/hwmon/amc6821.c ptemp[2] = clamp_val(val / 1000, ptemp[1]+1, 255); clamp_val 567 drivers/hwmon/amc6821.c data->pwm1_auto_point_pwm[1] = clamp_val(val, 0, 254); clamp_val 625 drivers/hwmon/amc6821.c data->fan[ix] = (u16) clamp_val(val, 1, 0xFFFF); clamp_val 104 drivers/hwmon/asb100.c unsigned nval = clamp_val(val, ASB100_IN_MIN, ASB100_IN_MAX); clamp_val 119 drivers/hwmon/asb100.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 120 drivers/hwmon/asb100.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 138 drivers/hwmon/asb100.c int ntemp = clamp_val(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX); clamp_val 154 drivers/hwmon/asb100.c pwm = clamp_val(pwm, 0, 255); clamp_val 181 drivers/hwmon/asc7621.c reqval = clamp_val(reqval, 0, 255); clamp_val 214 drivers/hwmon/asc7621.c reqval = clamp_val(reqval, 0, param->mask[0]); clamp_val 264 drivers/hwmon/asc7621.c (reqval <= 0 ? 0xffff : clamp_val(5400000 / reqval, 0, 0xfffe)); clamp_val 333 drivers/hwmon/asc7621.c reqval = clamp_val(reqval, 0, 0xffff); clamp_val 337 drivers/hwmon/asc7621.c reqval = clamp_val(reqval, 0, 0xff); clamp_val 366 drivers/hwmon/asc7621.c reqval = clamp_val(reqval, -127000, 127000); clamp_val 422 drivers/hwmon/asc7621.c reqval = clamp_val(reqval, -32000, 31750); clamp_val 458 drivers/hwmon/asc7621.c temp = auto_point1 + asc7621_range_map[clamp_val(regval, 0, 15)]; clamp_val 479 drivers/hwmon/asc7621.c reqval = clamp_val(reqval, auto_point1 + 2000, auto_point1 + 80000); clamp_val 513 drivers/hwmon/asc7621.c return sprintf(buf, "%u\n", map[clamp_val(regval, 0, 15)]); clamp_val 652 drivers/hwmon/asc7621.c regval = clamp_val(regval, 0, 15); clamp_val 700 drivers/hwmon/asc7621.c regval = clamp_val(regval, 0, 7); clamp_val 748 drivers/hwmon/asc7621.c regval = clamp_val(regval, 0, 7); clamp_val 706 drivers/hwmon/dell-smm-hwmon.c return sprintf(buf, "%d\n", clamp_val(status * i8k_pwm_mult, 0, 255)); clamp_val 720 drivers/hwmon/dell-smm-hwmon.c val = clamp_val(DIV_ROUND_CLOSEST(val, i8k_pwm_mult), 0, i8k_fan_max); clamp_val 269 drivers/hwmon/dme1737.c val = clamp_val(val, 0, 255 * nominal / 192); clamp_val 286 drivers/hwmon/dme1737.c val = clamp_val(val, -128000, 127000); clamp_val 325 drivers/hwmon/dme1737.c hyst = clamp_val(hyst, temp - 15000, temp); clamp_val 343 drivers/hwmon/dme1737.c return clamp_val(val / tpc, 0, 0xffff); clamp_val 346 drivers/hwmon/dme1737.c clamp_val(90000 * 60 / val, 0, 0xfffe); clamp_val 1050 drivers/hwmon/dme1737.c val = clamp_val(val, temp, temp + 80000); clamp_val 1277 drivers/hwmon/dme1737.c data->pwm[ix] = clamp_val(val, 0, 255); clamp_val 1445 drivers/hwmon/dme1737.c data->pwm_min[ix] = clamp_val(val, 0, 255); clamp_val 136 drivers/hwmon/ds1621.c temp = clamp_val(temp, DS1621_TEMP_MIN, DS1621_TEMP_MAX); clamp_val 156 drivers/hwmon/ds620.c val = (clamp_val(val, -128000, 128000) * 10 / 625) * 8; clamp_val 152 drivers/hwmon/emc1403.c hyst = clamp_val(DIV_ROUND_CLOSEST(hyst, 1000), 0, 255); clamp_val 243 drivers/hwmon/emc2103.c val = DIV_ROUND_CLOSEST(clamp_val(val, -63000, 127000), 1000); clamp_val 265 drivers/hwmon/emc2103.c val = DIV_ROUND_CLOSEST(clamp_val(val, -63000, 127000), 1000); clamp_val 387 drivers/hwmon/emc2103.c rpm_target = clamp_val(rpm_target, 0, 16384); clamp_val 394 drivers/hwmon/emc2103.c data->fan_target = clamp_val( clamp_val 205 drivers/hwmon/emc6w201.c val = clamp_val(val, 0, 255 * nominal_mv[nr] / 192); clamp_val 244 drivers/hwmon/emc6w201.c val = clamp_val(val, -127000, 127000); clamp_val 291 drivers/hwmon/emc6w201.c val = clamp_val(val, 0, 0xFFFE); clamp_val 1405 drivers/hwmon/f71882fg.c val = clamp_val(val, 23, 1500000); clamp_val 1493 drivers/hwmon/f71882fg.c val = clamp_val(val, 0, 255); clamp_val 1607 drivers/hwmon/f71882fg.c val = clamp_val(val, 0, 255); clamp_val 1654 drivers/hwmon/f71882fg.c val = clamp_val(val, data->temp_high[nr] - 15, data->temp_high[nr]); clamp_val 1691 drivers/hwmon/f71882fg.c val = clamp_val(val, 0, 255); clamp_val 1818 drivers/hwmon/f71882fg.c val = clamp_val(val, 0, 255); clamp_val 1869 drivers/hwmon/f71882fg.c val = clamp_val(val, 0, 255); clamp_val 1996 drivers/hwmon/f71882fg.c val = clamp_val(val, 0, 255); clamp_val 2055 drivers/hwmon/f71882fg.c val = clamp_val(val, data->pwm_auto_point_temp[nr][point] - 15, clamp_val 2190 drivers/hwmon/f71882fg.c val = clamp_val(val, -128, 127); clamp_val 2192 drivers/hwmon/f71882fg.c val = clamp_val(val, 0, 127); clamp_val 348 drivers/hwmon/f75375s.c data->pwm[nr] = clamp_val(val, 0, 255); clamp_val 545 drivers/hwmon/f75375s.c val = clamp_val(VOLT_TO_REG(val), 0, 0xff); clamp_val 566 drivers/hwmon/f75375s.c val = clamp_val(VOLT_TO_REG(val), 0, 0xff); clamp_val 614 drivers/hwmon/f75375s.c val = clamp_val(TEMP_TO_REG(val), 0, 127); clamp_val 635 drivers/hwmon/f75375s.c val = clamp_val(TEMP_TO_REG(val), 0, 127); clamp_val 811 drivers/hwmon/f75375s.c data->pwm[nr] = clamp_val(f75375s_pdata->pwm[nr], 0, 255); clamp_val 370 drivers/hwmon/fschmd.c v = clamp_val(v / 1000, -128, 127) + 128; clamp_val 535 drivers/hwmon/fschmd.c v = clamp_val(v, 128, 255); clamp_val 149 drivers/hwmon/g760a.c data->set_cnt = PWM_TO_CNT(clamp_val(val, 0, 255)); clamp_val 191 drivers/hwmon/g762.c rpm = clamp_val(rpm, f1 / (255 * f2), ULONG_MAX / f2); clamp_val 76 drivers/hwmon/gl518sm.c #define TEMP_CLAMP(val) clamp_val(val, -119000, 136000) clamp_val 85 drivers/hwmon/gl518sm.c rpmdiv = clamp_val(rpm, 1, 960000) * div; clamp_val 86 drivers/hwmon/gl518sm.c return clamp_val((480000 + rpmdiv / 2) / rpmdiv, 1, 255); clamp_val 90 drivers/hwmon/gl518sm.c #define IN_CLAMP(val) clamp_val(val, 0, 255 * 19) clamp_val 94 drivers/hwmon/gl518sm.c #define VDD_CLAMP(val) clamp_val(val, 0, 255 * 95 / 4) clamp_val 198 drivers/hwmon/gl520sm.c #define VDD_CLAMP(val) clamp_val(val, 0, 255 * 95 / 4) clamp_val 202 drivers/hwmon/gl520sm.c #define IN_CLAMP(val) clamp_val(val, 0, 255 * 19) clamp_val 332 drivers/hwmon/gl520sm.c #define FAN_CLAMP(val, div) clamp_val(val, FAN_BASE(div) / 255, \ clamp_val 498 drivers/hwmon/gl520sm.c #define TEMP_CLAMP(val) clamp_val(val, -130000, 125000) clamp_val 164 drivers/hwmon/ina209.c return clamp_val(val, -320, 320) * 100; clamp_val 176 drivers/hwmon/ina209.c return (DIV_ROUND_CLOSEST(clamp_val(val, 0, 32000), 4) << 3) clamp_val 187 drivers/hwmon/ina209.c return (clamp_val(-val, 0, 255) << 8) | (old & 0xff); clamp_val 196 drivers/hwmon/ina209.c return (clamp_val(val, 0, 255) << 8) | (old & 0xff); clamp_val 526 drivers/hwmon/ina209.c clamp_val(40960000 / shunt, 1, 65535)); clamp_val 375 drivers/hwmon/ina3221.c current_ma = clamp_val(val, clamp_val 382 drivers/hwmon/ina3221.c voltage_uv = clamp_val(voltage_uv, -163800, 163800); clamp_val 623 drivers/hwmon/ina3221.c val = clamp_val(val, 1, INT_MAX); clamp_val 584 drivers/hwmon/it87.c return clamp_val(val, 0, 255); clamp_val 596 drivers/hwmon/it87.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 597 drivers/hwmon/it87.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 604 drivers/hwmon/it87.c return clamp_val((1350000 + rpm) / (rpm * 2), 1, 0xfffe); clamp_val 613 drivers/hwmon/it87.c #define TEMP_TO_REG(val) (clamp_val(((val) < 0 ? (((val) - 500) / 1000) : \ clamp_val 1420 drivers/hwmon/it87.c val = clamp_val(val, 0, 1000000); clamp_val 1610 drivers/hwmon/it87.c reg = clamp_val(reg, 0, 0x1f) | (data->auto_temp[nr][0] & 0xe0); clamp_val 225 drivers/hwmon/jc42.c int ntemp = clamp_val(temp, clamp_val 346 drivers/hwmon/jc42.c val = clamp_val(val, (data->extended ? JC42_TEMP_MIN_EXTENDED clamp_val 117 drivers/hwmon/lm63.c #define TEMP8_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), -128000, \ clamp_val 119 drivers/hwmon/lm63.c #define TEMP8U_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, \ clamp_val 122 drivers/hwmon/lm63.c #define TEMP11_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \ clamp_val 124 drivers/hwmon/lm63.c #define TEMP11U_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), 0, \ clamp_val 126 drivers/hwmon/lm63.c #define HYST_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 127000), \ clamp_val 194 drivers/hwmon/lm63.c return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127500), 500); clamp_val 196 drivers/hwmon/lm63.c return DIV_ROUND_CLOSEST(clamp_val(val, 0, 127000), 1000); clamp_val 398 drivers/hwmon/lm63.c val = clamp_val(val, 0, 255); clamp_val 682 drivers/hwmon/lm63.c lm63_set_convrate(data, clamp_val(val, 0, 100000)); clamp_val 76 drivers/hwmon/lm73.c value = clamp_val(temp / 250, LM73_TEMP_MIN, LM73_TEMP_MAX) << 5; clamp_val 392 drivers/hwmon/lm75.c temp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); clamp_val 27 drivers/hwmon/lm75.h int ntemp = clamp_val(temp, LM75_TEMP_MIN, LM75_TEMP_MAX); clamp_val 169 drivers/hwmon/lm77.c val = clamp_val(val, LM77_TEMP_MIN, LM77_TEMP_MAX); clamp_val 195 drivers/hwmon/lm77.c val = clamp_val(data->temp[t_crit] - val, LM77_TEMP_MIN, LM77_TEMP_MAX); clamp_val 74 drivers/hwmon/lm78.c unsigned long nval = clamp_val(val, 0, 4080); clamp_val 85 drivers/hwmon/lm78.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 99 drivers/hwmon/lm78.c int nval = clamp_val(val, -128000, 127000) ; clamp_val 62 drivers/hwmon/lm80.c #define IN_TO_REG(val) (clamp_val(((val) + 5) / 10, 0, 255)) clamp_val 69 drivers/hwmon/lm80.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 70 drivers/hwmon/lm80.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 77 drivers/hwmon/lm80.c #define TEMP_TO_REG(temp) (DIV_ROUND_CLOSEST(clamp_val((temp), \ clamp_val 127 drivers/hwmon/lm85.c SCALE(clamp_val(val, 0, 255 * lm85_scaling[n] / 192), \ clamp_val 140 drivers/hwmon/lm85.c return clamp_val(5400000 / val, 1, 0xfffe); clamp_val 147 drivers/hwmon/lm85.c DIV_ROUND_CLOSEST(clamp_val((val), -127000, 127000), 1000) clamp_val 152 drivers/hwmon/lm85.c #define PWM_TO_REG(val) clamp_val(val, 0, 255) clamp_val 239 drivers/hwmon/lm85.c #define HYST_TO_REG(val) clamp_val(((val) + 500) / 1000, 0, 15) clamp_val 1340 drivers/hwmon/lm90.c clamp_val(val, 0, 100000)); clamp_val 71 drivers/hwmon/lm92.c val = clamp_val(val, -60000, 160000); clamp_val 201 drivers/hwmon/lm92.c val = clamp_val(val, -120000, 220000); clamp_val 361 drivers/hwmon/lm93.c const long mv = clamp_val(val, clamp_val 375 drivers/hwmon/lm93.c result = clamp_val(result, clamp_val 401 drivers/hwmon/lm93.c uv_offset = clamp_val(uv_offset, 12500, 200000); clamp_val 404 drivers/hwmon/lm93.c uv_offset = clamp_val(uv_offset, -400000, -25000); clamp_val 427 drivers/hwmon/lm93.c int ntemp = clamp_val(temp, LM93_TEMP_MIN, LM93_TEMP_MAX); clamp_val 462 drivers/hwmon/lm93.c off = clamp_val(off, LM93_TEMP_OFFSET_MIN, clamp_val 610 drivers/hwmon/lm93.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 611 drivers/hwmon/lm93.c count = clamp_val((1350000 + rpm) / rpm, 1, 0x3ffe); clamp_val 682 drivers/hwmon/lm93.c ramp = clamp_val(ramp, LM93_RAMP_MIN, LM93_RAMP_MAX); clamp_val 692 drivers/hwmon/lm93.c prochot = clamp_val(prochot, 0, 255); clamp_val 1942 drivers/hwmon/lm93.c data->block9[nr][LM93_PWM_CTL1] = clamp_val(val, 0, 255); clamp_val 2269 drivers/hwmon/lm93.c clamp_val(val, 0, 15); clamp_val 304 drivers/hwmon/lm95234.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, index ? 255 : 127); clamp_val 353 drivers/hwmon/lm95234.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 255); clamp_val 395 drivers/hwmon/lm95234.c val = clamp_val((int)data->tcrit1[index] - val, 0, 31); clamp_val 434 drivers/hwmon/lm95234.c val = clamp_val(DIV_ROUND_CLOSEST(val, 500), -128, 127); clamp_val 286 drivers/hwmon/lm95245.c val = clamp_val(val / 1000, 0, 255); clamp_val 292 drivers/hwmon/lm95245.c val = clamp_val(val / 1000, 0, channel ? 255 : 127); clamp_val 304 drivers/hwmon/lm95245.c val = clamp_val(val, -1000000, 1000000); clamp_val 306 drivers/hwmon/lm95245.c val = clamp_val(val, 0, 31); clamp_val 312 drivers/hwmon/lm95245.c val = clamp_val(val, -128000, 127875); clamp_val 252 drivers/hwmon/ltc2945.c regval = clamp_val(regval, 0, 0xffffff); clamp_val 258 drivers/hwmon/ltc2945.c regval = clamp_val(regval, 0, 0xfff) << 4; clamp_val 119 drivers/hwmon/max16065.c return clamp_val(DIV_ROUND_CLOSEST(mv * 256, range), 0, 255); clamp_val 206 drivers/hwmon/max1668.c data->temp_max[index] = clamp_val(temp/1000, -128, 127); clamp_val 232 drivers/hwmon/max1668.c data->temp_min[index] = clamp_val(temp/1000, -128, 127); clamp_val 204 drivers/hwmon/max31790.c val = clamp_val(val, FAN_RPM_MIN, FAN_RPM_MAX); clamp_val 218 drivers/hwmon/max31790.c target_count = clamp_val(target_count, 0x1, 0x7FF); clamp_val 321 drivers/hwmon/max6621.c val = clamp_val(val, MAX6621_TEMP_INPUT_MIN, clamp_val 331 drivers/hwmon/max6621.c val = clamp_val(val, MAX6621_TEMP_INPUT_MIN, clamp_val 64 drivers/hwmon/max6639.c #define TEMP_LIMIT_TO_REG(val) clamp_val((val) / 1000, 0, 255) clamp_val 298 drivers/hwmon/max6639.c val = clamp_val(val, 0, 255); clamp_val 229 drivers/hwmon/max6642.c data->temp_high[attr2->nr] = clamp_val(temp_to_reg(val), 0, 255); clamp_val 146 drivers/hwmon/max6650.c return clamp_val(255 - (255 * dac) / DAC_LIMIT(v12), 0, 255); clamp_val 269 drivers/hwmon/max6650.c rpm = clamp_val(rpm, FAN_RPM_MIN, FAN_RPM_MAX); clamp_val 495 drivers/hwmon/max6650.c state = clamp_val(state, 0, 255); clamp_val 623 drivers/hwmon/max6650.c reg = pwm_to_dac(clamp_val(val, 0, 255), clamp_val 308 drivers/hwmon/max6697.c temp = clamp_val(temp, 0, data->type == max6581 ? 255 : 127); clamp_val 493 drivers/hwmon/nct6683.c return clamp_val(DIV_ROUND_CLOSEST(val, scale), 0, 127); clamp_val 991 drivers/hwmon/nct6775.c return clamp_val((mode ? (msec + 200) / 400 : clamp_val 1062 drivers/hwmon/nct6775.c return clamp_val(DIV_ROUND_CLOSEST(val * 100, scale_in[nr]), 0, 255); clamp_val 2377 drivers/hwmon/nct6775.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); clamp_val 2606 drivers/hwmon/nct6775.c val = clamp_val(val, minval[index], maxval[index]); clamp_val 2867 drivers/hwmon/nct6775.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, clamp_val 2904 drivers/hwmon/nct6775.c val = clamp_val(val, 0, 1350000U); clamp_val 2942 drivers/hwmon/nct6775.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, data->tolerance_mask); clamp_val 3019 drivers/hwmon/nct6775.c val = clamp_val(val, 0, data->speed_tolerance_limit); clamp_val 3070 drivers/hwmon/nct6775.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 255); clamp_val 271 drivers/hwmon/nct7802.c limit = clamp_val(limit, 0, 0x1fff); clamp_val 324 drivers/hwmon/nct7802.c voltage = clamp_val(voltage, 0, 0x3ff * nct7802_vmul[nr]); clamp_val 460 drivers/hwmon/nct7802.c val = DIV_ROUND_CLOSEST(clamp_val(val, -128000, 127000), 1000); clamp_val 537 drivers/hwmon/nct7904.c val = clamp_val(val / 1000, -128, 127); clamp_val 587 drivers/hwmon/nct7904.c val = clamp_val(DIV_ROUND_CLOSEST(1350000, val), 1, 0x1fff); clamp_val 615 drivers/hwmon/nct7904.c val = clamp_val(val, 0, 0x7ff); clamp_val 369 drivers/hwmon/pmbus/adm1275.c word = clamp_val(word, 1, ADM1275_SAMPLES_AVG_MAX); clamp_val 375 drivers/hwmon/pmbus/adm1275.c word = clamp_val(word, 1, ADM1275_SAMPLES_AVG_MAX); clamp_val 361 drivers/hwmon/pmbus/lm25066.c word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); clamp_val 366 drivers/hwmon/pmbus/lm25066.c word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); clamp_val 373 drivers/hwmon/pmbus/lm25066.c word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); clamp_val 382 drivers/hwmon/pmbus/lm25066.c word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); clamp_val 390 drivers/hwmon/pmbus/lm25066.c word = ((s16)word < 0) ? 0 : clamp_val(word, 0, data->rlimit); clamp_val 399 drivers/hwmon/pmbus/lm25066.c word = clamp_val(word, 1, LM25066_SAMPLES_FOR_AVG_MAX); clamp_val 686 drivers/hwmon/pmbus/pmbus_core.c return clamp_val(val, LONG_MIN, LONG_MAX); clamp_val 842 drivers/hwmon/pmbus/pmbus_core.c return (u16)clamp_val(val64, S16_MIN, S16_MAX); clamp_val 848 drivers/hwmon/pmbus/pmbus_core.c val = clamp_val(val, 500, 1600); clamp_val 400 drivers/hwmon/sht3x.c temperature = clamp_val(temperature, SHT3X_MIN_TEMPERATURE, clamp_val 424 drivers/hwmon/sht3x.c humidity = clamp_val(humidity, SHT3X_MIN_HUMIDITY, SHT3X_MAX_HUMIDITY); clamp_val 121 drivers/hwmon/sis5595.c unsigned long nval = clamp_val(val, 0, 4080); clamp_val 132 drivers/hwmon/sis5595.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 150 drivers/hwmon/sis5595.c int nval = clamp_val(val, -54120, 157530) ; clamp_val 361 drivers/hwmon/smsc47m1.c data->fan_preload[nr] = clamp_val(tmp, 0, 191); clamp_val 67 drivers/hwmon/smsc47m192.c val = clamp_val(val, 0, nom_mv[n] * 255 / 192); clamp_val 77 drivers/hwmon/smsc47m192.c return SCALE(clamp_val(val, -128000, 127000), 1, 1000); clamp_val 444 drivers/hwmon/stts751.c temp = clamp_val(temp, -64000, 127937); clamp_val 488 drivers/hwmon/stts751.c temp = clamp_val(temp, -64000, priv->therm); clamp_val 535 drivers/hwmon/stts751.c temp = clamp_val(temp, priv->event_min, 127937); clamp_val 569 drivers/hwmon/stts751.c temp = clamp_val(temp, -64000, priv->event_max); clamp_val 237 drivers/hwmon/tc654.c val = clamp_val(val, 0, 12750); clamp_val 140 drivers/hwmon/thmc50.c data->analog_out = clamp_val(tmp, 0, 255); clamp_val 194 drivers/hwmon/thmc50.c data->temp_min[nr] = clamp_val(val / 1000, -128, 127); clamp_val 224 drivers/hwmon/thmc50.c data->temp_max[nr] = clamp_val(val / 1000, -128, 127); clamp_val 123 drivers/hwmon/tmp102.c temp = clamp_val(temp, -256000, 255000); clamp_val 81 drivers/hwmon/tmp103.c val = clamp_val(val, -55000, 127000); clamp_val 218 drivers/hwmon/tmp108.c temp = clamp_val(temp, TMP108_TEMP_MIN_MC, TMP108_TEMP_MAX_MC); clamp_val 225 drivers/hwmon/tmp108.c temp = clamp_val(temp, TMP108_TEMP_MIN_MC, TMP108_TEMP_MAX_MC); clamp_val 169 drivers/hwmon/tmp401.c temp = clamp_val(temp, -64000, 191000); clamp_val 172 drivers/hwmon/tmp401.c temp = clamp_val(temp, 0, 127000); clamp_val 373 drivers/hwmon/tmp401.c val = clamp_val(val, -64000, 191000); clamp_val 375 drivers/hwmon/tmp401.c val = clamp_val(val, 0, 127000); clamp_val 379 drivers/hwmon/tmp401.c val = clamp_val(val, temp - 255000, temp); clamp_val 451 drivers/hwmon/tmp401.c val = clamp_val(val, 125, 16000); clamp_val 124 drivers/hwmon/via686a.c return (u8) clamp_val((val * 21024 - 1205000) / 250000, 0, 255); clamp_val 126 drivers/hwmon/via686a.c return (u8) clamp_val((val * 15737 - 1205000) / 250000, 0, 255); clamp_val 128 drivers/hwmon/via686a.c return (u8) clamp_val((val * 10108 - 1205000) / 250000, 0, 255); clamp_val 130 drivers/hwmon/via686a.c return (u8) clamp_val((val * 41714 - 12050000) / 2500000, 0, clamp_val 161 drivers/hwmon/via686a.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 162 drivers/hwmon/via686a.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 255); clamp_val 148 drivers/hwmon/vt1211.c #define IN_TO_REG(ix, val) (clamp_val((ix) == 5 ? \ clamp_val 163 drivers/hwmon/vt1211.c #define TEMP_TO_REG(ix, val) clamp_val( \ clamp_val 173 drivers/hwmon/vt1211.c clamp_val((1310720 / (val) / \ clamp_val 685 drivers/hwmon/vt1211.c val = 135000 / clamp_val(val, 135000 >> 7, 135000); clamp_val 844 drivers/hwmon/vt1211.c data->pwm_auto_pwm[ix][ap] = clamp_val(val, 0, 255); clamp_val 137 drivers/hwmon/vt8231.c return clamp_val(1310720 / (rpm * div), 1, 255); clamp_val 226 drivers/hwmon/vt8231.c data->in_min[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); clamp_val 246 drivers/hwmon/vt8231.c data->in_max[nr] = clamp_val(((val * 958) / 10000) + 3, 0, 255); clamp_val 293 drivers/hwmon/vt8231.c data->in_min[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, clamp_val 313 drivers/hwmon/vt8231.c data->in_max[5] = clamp_val(((val * 958 * 34) / (10000 * 54)) + 3, clamp_val 375 drivers/hwmon/vt8231.c data->temp_max[0] = clamp_val((val + 500) / 1000, 0, 255); clamp_val 393 drivers/hwmon/vt8231.c data->temp_min[0] = clamp_val((val + 500) / 1000, 0, 255); clamp_val 441 drivers/hwmon/vt8231.c data->temp_max[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); clamp_val 461 drivers/hwmon/vt8231.c data->temp_min[nr] = clamp_val(TEMP_MAXMIN_TO_REG(val), 0, 255); clamp_val 350 drivers/hwmon/w83627ehf.c return clamp_val((mode ? (msec + 50) / 100 : (msec + 200) / 400), clamp_val 410 drivers/hwmon/w83627ehf.c return clamp_val(DIV_ROUND_CLOSEST(val * 100, scale_in[nr]), 0, 255); clamp_val 1262 drivers/hwmon/w83627ehf.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), -128, 127); clamp_val 1430 drivers/hwmon/w83627ehf.c val = clamp_val(val, 0, 255); clamp_val 1509 drivers/hwmon/w83627ehf.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 127); clamp_val 1535 drivers/hwmon/w83627ehf.c val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 0, 15); clamp_val 1634 drivers/hwmon/w83627ehf.c val = clamp_val(val, 1, 255); \ clamp_val 250 drivers/hwmon/w83627hf.c #define IN_TO_REG(val) (clamp_val((((val) + 8) / 16), 0, 255)) clamp_val 257 drivers/hwmon/w83627hf.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 258 drivers/hwmon/w83627hf.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 270 drivers/hwmon/w83627hf.c int ntemp = clamp_val(temp, TEMP_MIN, TEMP_MAX); clamp_val 282 drivers/hwmon/w83627hf.c #define PWM_TO_REG(val) (clamp_val((val), 0, 255)) clamp_val 337 drivers/hwmon/w83627hf.c val = clamp_val(val, 1, 128) >> 1; clamp_val 620 drivers/hwmon/w83627hf.c clamp_val(((val * 100) - 70000 + 244) / 488, 0, 255); clamp_val 650 drivers/hwmon/w83627hf.c clamp_val(((val * 100) - 70000 + 244) / 488, 0, 255); clamp_val 129 drivers/hwmon/w83773g.c val = clamp_val(val, -127825, 127825); clamp_val 167 drivers/hwmon/w83773g.c val = clamp_val(val, 62, 16000) * 10; clamp_val 149 drivers/hwmon/w83781d.c #define IN_TO_REG(val) clamp_val(((val) + 8) / 16, 0, 255) clamp_val 157 drivers/hwmon/w83781d.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 158 drivers/hwmon/w83781d.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 171 drivers/hwmon/w83781d.c #define TEMP_TO_REG(val) clamp_val((val) / 1000, -127, 128) clamp_val 185 drivers/hwmon/w83781d.c val = clamp_val(val, 1, clamp_val 432 drivers/hwmon/w83781d.c data->vrm = clamp_val(val, 0, 255); clamp_val 718 drivers/hwmon/w83781d.c data->pwm[nr] = clamp_val(val, 0, 255); clamp_val 210 drivers/hwmon/w83791d.c #define IN_TO_REG(val) (clamp_val((((val) + 8) / 16), 0, 255)) clamp_val 217 drivers/hwmon/w83791d.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 218 drivers/hwmon/w83791d.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 239 drivers/hwmon/w83791d.c #define TEMP23_TO_REG(val) (DIV_ROUND_CLOSEST(clamp_val((val), -128000, \ clamp_val 243 drivers/hwmon/w83791d.c #define TARGET_TEMP_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 127000), \ clamp_val 247 drivers/hwmon/w83791d.c #define TOL_TEMP_TO_REG(val) DIV_ROUND_CLOSEST(clamp_val((val), 0, 15000), \ clamp_val 260 drivers/hwmon/w83791d.c val = clamp_val(val, 1, 128) >> 1; clamp_val 734 drivers/hwmon/w83791d.c data->pwm[nr] = clamp_val(val, 0, 255); clamp_val 225 drivers/hwmon/w83792d.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 226 drivers/hwmon/w83792d.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 234 drivers/hwmon/w83792d.c #define TEMP1_TO_REG(val) (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 \ clamp_val 242 drivers/hwmon/w83792d.c (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 : (val)) / 1000, 0, 0xff)) clamp_val 251 drivers/hwmon/w83792d.c val = clamp_val(val, 1, 128) >> 1; clamp_val 383 drivers/hwmon/w83792d.c data->in_##reg[nr] = clamp_val(IN_TO_REG(nr, val) / 4, 0, 255); \ clamp_val 631 drivers/hwmon/w83792d.c val = clamp_val(val, 0, 255) >> 4; clamp_val 785 drivers/hwmon/w83792d.c data->thermal_cruise[nr] = clamp_val(target_tmp, 0, 255); clamp_val 823 drivers/hwmon/w83792d.c tol_tmp = clamp_val(val, 0, 15); clamp_val 867 drivers/hwmon/w83792d.c data->sf2_points[index][nr] = clamp_val(val, 0, 127); clamp_val 909 drivers/hwmon/w83792d.c data->sf2_levels[index][nr] = clamp_val((val * 15) / 100, 0, 15); clamp_val 181 drivers/hwmon/w83793.c return clamp_val((1350000 + (rpm >> 1)) / rpm, 1, 0xffe); clamp_val 191 drivers/hwmon/w83793.c return clamp_val((val + 50) / 100, 0, 0xff); clamp_val 201 drivers/hwmon/w83793.c return clamp_val((val + (val < 0 ? -500 : 500)) / 1000, min, max); clamp_val 551 drivers/hwmon/w83793.c val = clamp_val(val, 0, 0xff) >> 2; clamp_val 732 drivers/hwmon/w83793.c data->pwm_default |= clamp_val(val, 0, 0xff) >> 2; clamp_val 831 drivers/hwmon/w83793.c val = clamp_val(val, 0, 255); clamp_val 900 drivers/hwmon/w83793.c val = clamp_val(val, 0, 0xff) >> 2; clamp_val 996 drivers/hwmon/w83793.c val = clamp_val(val, 0, 255); clamp_val 998 drivers/hwmon/w83793.c val = clamp_val(val, 0, 0x3FF); clamp_val 253 drivers/hwmon/w83795.c return clamp_val((1350000 + (rpm >> 1)) / rpm, 1, 0xffe); clamp_val 263 drivers/hwmon/w83795.c return clamp_val((val + 50) / 100, 0, 0xff); clamp_val 273 drivers/hwmon/w83795.c return clamp_val(val / 1000, min, max); clamp_val 307 drivers/hwmon/w83795.c reg1 = clamp_val(DIV_ROUND_CLOSEST(base_clock, val), 1, 128); clamp_val 877 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0xff); clamp_val 1114 drivers/hwmon/w83795.c tmp = clamp_val(tmp, 0, 0xff); clamp_val 1165 drivers/hwmon/w83795.c val = fan_to_reg(clamp_val(val, 0, 0xfff)); clamp_val 1171 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0x3f); clamp_val 1215 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0x7f); clamp_val 1219 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0x7f); clamp_val 1223 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0x0f); clamp_val 1230 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0x0f); clamp_val 1529 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0x3FF); clamp_val 1584 drivers/hwmon/w83795.c val = clamp_val(val, 0, 0xff); clamp_val 76 drivers/hwmon/w83l786ng.c rpm = clamp_val(rpm, 1, 1000000); clamp_val 77 drivers/hwmon/w83l786ng.c return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); clamp_val 85 drivers/hwmon/w83l786ng.c #define TEMP_TO_REG(val) (clamp_val(((val) < 0 ? (val) + 0x100 * 1000 \ clamp_val 95 drivers/hwmon/w83l786ng.c #define IN_TO_REG(val) (clamp_val((((val) + 4) / 8), 0, 255)) clamp_val 104 drivers/hwmon/w83l786ng.c val = clamp_val(val, 1, 128) >> 1; clamp_val 515 drivers/hwmon/w83l786ng.c val = clamp_val(val, 0, 255); clamp_val 600 drivers/hwmon/w83l786ng.c tol_tmp = clamp_val(val, 0, 15); clamp_val 82 drivers/ide/alim15x3.c t->setup = clamp_val(t->setup, 1, 8) & 7; clamp_val 83 drivers/ide/alim15x3.c t->act8b = clamp_val(t->act8b, 1, 8) & 7; clamp_val 84 drivers/ide/alim15x3.c t->rec8b = clamp_val(t->rec8b, 1, 16) & 15; clamp_val 85 drivers/ide/alim15x3.c t->active = clamp_val(t->active, 1, 8) & 7; clamp_val 86 drivers/ide/alim15x3.c t->recover = clamp_val(t->recover, 1, 16) & 15; clamp_val 52 drivers/ide/amd74xx.c t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); clamp_val 56 drivers/ide/amd74xx.c ((clamp_val(timing->act8b, 1, 16) - 1) << 4) | (clamp_val(timing->rec8b, 1, 16) - 1)); clamp_val 59 drivers/ide/amd74xx.c ((clamp_val(timing->active, 1, 16) - 1) << 4) | (clamp_val(timing->recover, 1, 16) - 1)); clamp_val 62 drivers/ide/amd74xx.c case ATA_UDMA2: t = timing->udma ? (0xc0 | (clamp_val(timing->udma, 2, 5) - 2)) : 0x03; break; clamp_val 63 drivers/ide/amd74xx.c case ATA_UDMA4: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 2, 10)]) : 0x03; break; clamp_val 64 drivers/ide/amd74xx.c case ATA_UDMA5: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 1, 10)]) : 0x03; break; clamp_val 65 drivers/ide/amd74xx.c case ATA_UDMA6: t = timing->udma ? (0xc0 | amd_cyc2udma[clamp_val(timing->udma, 1, 15)]) : 0x03; break; clamp_val 106 drivers/ide/cy82c693.c time_16 = clamp_val(t.recover - 1, 0, 15) | clamp_val 107 drivers/ide/cy82c693.c (clamp_val(t.active - 1, 0, 15) << 4); clamp_val 108 drivers/ide/cy82c693.c time_8 = clamp_val(t.act8b - 1, 0, 15) | clamp_val 109 drivers/ide/cy82c693.c (clamp_val(t.rec8b - 1, 0, 15) << 4); clamp_val 121 drivers/ide/cy82c693.c addrCtrl |= clamp_val(t.setup - 1, 0, 15); clamp_val 137 drivers/ide/cy82c693.c addrCtrl |= (clamp_val(t.setup - 1, 0, 15) << 4); clamp_val 130 drivers/ide/via82cxxx.c t = (t & ~(3 << ((3 - dn) << 1))) | ((clamp_val(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); clamp_val 135 drivers/ide/via82cxxx.c ((clamp_val(timing->act8b, 1, 16) - 1) << 4) | (clamp_val(timing->rec8b, 1, 16) - 1)); clamp_val 138 drivers/ide/via82cxxx.c ((clamp_val(timing->active, 1, 16) - 1) << 4) | (clamp_val(timing->recover, 1, 16) - 1)); clamp_val 141 drivers/ide/via82cxxx.c case ATA_UDMA2: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 5) - 2)) : 0x03; break; clamp_val 142 drivers/ide/via82cxxx.c case ATA_UDMA4: t = timing->udma ? (0xe8 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x0f; break; clamp_val 143 drivers/ide/via82cxxx.c case ATA_UDMA5: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break; clamp_val 144 drivers/ide/via82cxxx.c case ATA_UDMA6: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break; clamp_val 170 drivers/iio/accel/adxl345_core.c clamp_val(ilog2(n), 0, clamp_val 102 drivers/iio/chemical/pms7003.c return clamp_val(get_unaligned_be16(data), clamp_val 57 drivers/iio/humidity/si7020.c *val = clamp_val(*val, 786, 13893); clamp_val 1690 drivers/infiniband/hw/hfi1/init.c clamp_val(eager_buffer_size, clamp_val 1702 drivers/infiniband/hw/hfi1/init.c hfi1_rcvarr_split = clamp_val(hfi1_rcvarr_split, 0, 100); clamp_val 266 drivers/input/ff-memless.c clamp_val(effect->u.ramp.start_level + x, -0x80, 0x7f); clamp_val 268 drivers/input/ff-memless.c clamp_val(effect->u.ramp.end_level + y, -0x80, 0x7f); clamp_val 595 drivers/input/mouse/bcm5974.c abs_p = clamp_val(256 * p / cfg->p.max, 0, 255); clamp_val 596 drivers/input/mouse/bcm5974.c abs_w = clamp_val(16 * w / cfg->w.max, 0, 15); clamp_val 576 drivers/input/mouse/cyapa.c sleep_time = clamp_val(sleep_time, 20, 1000); clamp_val 993 drivers/input/mouse/synaptics.c nsemi = clamp_val(num_fingers, 0, 2); clamp_val 292 drivers/input/mousedev.c client->pos_x = clamp_val(client->pos_x, 0, xres); clamp_val 295 drivers/input/mousedev.c client->pos_y = clamp_val(client->pos_y, 0, yres); clamp_val 576 drivers/input/mousedev.c dx = clamp_val(p->dx, -127, 127); clamp_val 579 drivers/input/mousedev.c dy = clamp_val(p->dy, -127, 127); clamp_val 590 drivers/input/mousedev.c dz = clamp_val(p->dz, -7, 7); clamp_val 598 drivers/input/mousedev.c dz = clamp_val(p->dz, -127, 127); clamp_val 700 drivers/leds/leds-max77693.c *v = clamp_val(*v, min, max); clamp_val 739 drivers/leds/leds-max77693.c cfg->boost_mode = clamp_val(cfg->boost_mode, MAX77693_LED_BOOST_NONE, clamp_val 419 drivers/media/dvb-frontends/rtl2830.c utmp = clamp_val(-4 * stmp + 32767, 0x0000, 0xffff); clamp_val 2123 drivers/media/i2c/ov5640.c fps = clamp_val(DIV_ROUND_CLOSEST(fi->denominator, fi->numerator), clamp_val 823 drivers/media/pci/intel/ipu3/ipu3-cio2.c *num_buffers = clamp_val(*num_buffers, 1, CIO2_MAX_BUFFERS); clamp_val 754 drivers/media/pci/pt3/pt3.c pt3->num_bufs = clamp_val(num_bufs, MIN_DATA_BUFS, MAX_DATA_BUFS); clamp_val 1715 drivers/media/platform/s5p-jpeg/jpeg-core.c scale_factor = clamp_val(scale_factor, 1, 8); clamp_val 766 drivers/media/platform/sti/hva/hva-h264.c td->qp_min = clamp_val(ctrls->qpmin, 0, 51); clamp_val 767 drivers/media/platform/sti/hva/hva-h264.c td->qp_max = clamp_val(ctrls->qpmax, 0, 51); clamp_val 380 drivers/media/tuners/m88rs6000t.c f3dB = clamp_val(f3dB, 6000U, 43000U); clamp_val 553 drivers/media/tuners/m88rs6000t.c gain = clamp_val(gain, 1000U, 10500U); clamp_val 1487 drivers/mtd/nand/raw/stm32_fmc2_nand.c tims->twait = clamp_val(timing, 1, FMC2_PMEM_PATT_TIMING_MASK); clamp_val 1503 drivers/mtd/nand/raw/stm32_fmc2_nand.c tims->tset_mem = clamp_val(timing, 1, FMC2_PMEM_PATT_TIMING_MASK); clamp_val 1521 drivers/mtd/nand/raw/stm32_fmc2_nand.c tims->thold_mem = clamp_val(timing, 1, FMC2_PMEM_PATT_TIMING_MASK); clamp_val 1544 drivers/mtd/nand/raw/stm32_fmc2_nand.c tims->tset_att = clamp_val(timing, 1, FMC2_PMEM_PATT_TIMING_MASK); clamp_val 1583 drivers/mtd/nand/raw/stm32_fmc2_nand.c tims->thold_att = clamp_val(timing, 1, FMC2_PMEM_PATT_TIMING_MASK); clamp_val 3406 drivers/net/ethernet/amazon/ena/ena_netdev.c tx_queue_size = clamp_val(tx_queue_size, ENA_MIN_RING_SIZE, clamp_val 3408 drivers/net/ethernet/amazon/ena/ena_netdev.c rx_queue_size = clamp_val(rx_queue_size, ENA_MIN_RING_SIZE, clamp_val 301 drivers/net/ethernet/amd/xgbe/xgbe-drv.c rx_buf_size = clamp_val(rx_buf_size, XGBE_RX_MIN_BUF_SIZE, PAGE_SIZE); clamp_val 326 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c clamp_val(ring->rx_pending, PCH_GBE_MIN_RXD, PCH_GBE_MAX_RXD); clamp_val 330 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_ethtool.c clamp_val(ring->tx_pending, PCH_GBE_MIN_RXD, PCH_GBE_MAX_RXD); clamp_val 158 drivers/net/ethernet/qualcomm/emac/emac-ethtool.c clamp_val(ring->tx_pending, EMAC_MIN_TX_DESCS, EMAC_MAX_TX_DESCS); clamp_val 161 drivers/net/ethernet/qualcomm/emac/emac-ethtool.c clamp_val(ring->rx_pending, EMAC_MIN_RX_DESCS, EMAC_MAX_RX_DESCS); clamp_val 199 drivers/net/ethernet/synopsys/dwc-xlgmac-net.c rx_buf_size = clamp_val(rx_buf_size, XLGMAC_RX_MIN_BUF_SIZE, PAGE_SIZE); clamp_val 1789 drivers/net/phy/marvell.c temp = clamp_val(DIV_ROUND_CLOSEST(temp, 5) + 5, 0, 0x1f); clamp_val 191 drivers/net/wireless/broadcom/b43/lo.c pga = clamp_val(pga, 0, 15); clamp_val 306 drivers/net/wireless/broadcom/b43/lo.c trsw_rx_gain = clamp_val(trsw_rx_gain, 0, 0x2D); clamp_val 1448 drivers/net/wireless/broadcom/b43/main.c noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 1449 drivers/net/wireless/broadcom/b43/main.c noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 1450 drivers/net/wireless/broadcom/b43/main.c noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 1451 drivers/net/wireless/broadcom/b43/main.c noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 387 drivers/net/wireless/broadcom/b43/phy_g.c tmp = clamp_val(tmp, -32, 31); clamp_val 404 drivers/net/wireless/broadcom/b43/phy_g.c tmp = clamp_val(tmp, 0, 0x3F); clamp_val 737 drivers/net/wireless/broadcom/b43/phy_g.c a = clamp_val(a, -31, 31); clamp_val 746 drivers/net/wireless/broadcom/b43/phy_g.c b = clamp_val(b, -31, 31); clamp_val 2350 drivers/net/wireless/broadcom/b43/phy_g.c entry[index] = clamp_val(b43_tssi2dbm_ad(m1 * f, 8192), -127, 128); clamp_val 2759 drivers/net/wireless/broadcom/b43/phy_g.c tmp = clamp_val(tmp, 0x00, 0x3F); clamp_val 2814 drivers/net/wireless/broadcom/b43/phy_g.c *_rfatt = clamp_val(rfatt, rf_min, rf_max); clamp_val 2815 drivers/net/wireless/broadcom/b43/phy_g.c *_bbatt = clamp_val(bbatt, bb_min, bb_max); clamp_val 2933 drivers/net/wireless/broadcom/b43/phy_g.c desired_pwr = clamp_val(desired_pwr, 0, max_pwr); clamp_val 1663 drivers/net/wireless/broadcom/b43/phy_n.c offset = clamp_val(offset, -32, 31); clamp_val 2911 drivers/net/wireless/broadcom/b43/phy_n.c bcap_val_11b[core] = clamp_val(bcap_val_11b[core], 0, 0x1f); clamp_val 2912 drivers/net/wireless/broadcom/b43/phy_n.c scap_val_11b[core] = clamp_val(scap_val_11b[core], 0, 0x1f); clamp_val 2913 drivers/net/wireless/broadcom/b43/phy_n.c bcap_val_11n_20[core] = clamp_val(bcap_val_11n_20[core], 0, 0x1f); clamp_val 2914 drivers/net/wireless/broadcom/b43/phy_n.c scap_val_11n_20[core] = clamp_val(scap_val_11n_20[core], 0, 0x1f); clamp_val 2915 drivers/net/wireless/broadcom/b43/phy_n.c bcap_val_11n_40[core] = clamp_val(bcap_val_11n_40[core], 0, 0x1f); clamp_val 2916 drivers/net/wireless/broadcom/b43/phy_n.c scap_val_11n_40[core] = clamp_val(scap_val_11n_40[core], 0, 0x1f); clamp_val 5751 drivers/net/wireless/broadcom/b43/phy_n.c cur_hpf = clamp_val(cur_hpf, 0, 10); clamp_val 31 drivers/net/wireless/broadcom/b43/ppr.c *rate = clamp_val(*rate + diff, 0, 127); clamp_val 814 drivers/net/wireless/broadcom/b43legacy/main.c noise[0] = clamp_val(noise[0], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 815 drivers/net/wireless/broadcom/b43legacy/main.c noise[1] = clamp_val(noise[1], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 816 drivers/net/wireless/broadcom/b43legacy/main.c noise[2] = clamp_val(noise[2], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 817 drivers/net/wireless/broadcom/b43legacy/main.c noise[3] = clamp_val(noise[3], 0, ARRAY_SIZE(phy->nrssi_lt) - 1); clamp_val 1740 drivers/net/wireless/broadcom/b43legacy/phy.c tmp = clamp_val(tmp, 0x00, 0x3F); clamp_val 1843 drivers/net/wireless/broadcom/b43legacy/phy.c desired_pwr = clamp_val(phy->power_level << 2, 0, max_pwr); clamp_val 1889 drivers/net/wireless/broadcom/b43legacy/phy.c baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); clamp_val 1917 drivers/net/wireless/broadcom/b43legacy/phy.c baseband_attenuation = clamp_val(baseband_attenuation, 0, 11); clamp_val 1918 drivers/net/wireless/broadcom/b43legacy/phy.c radio_attenuation = clamp_val(radio_attenuation, 0, 9); clamp_val 1963 drivers/net/wireless/broadcom/b43legacy/phy.c entry[index] = clamp_val(b43legacy_tssi2dbm_ad(m1 * f, 8192), clamp_val 343 drivers/net/wireless/broadcom/b43legacy/radio.c tmp = clamp_val(tmp, -32, 31); clamp_val 361 drivers/net/wireless/broadcom/b43legacy/radio.c tmp = clamp_val(tmp, 0, 0x3F); clamp_val 825 drivers/net/wireless/broadcom/b43legacy/radio.c threshold = clamp_val(threshold, 0, 0x3E); clamp_val 878 drivers/net/wireless/broadcom/b43legacy/radio.c a = clamp_val(a, -31, 31); clamp_val 887 drivers/net/wireless/broadcom/b43legacy/radio.c b = clamp_val(b, -31, 31); clamp_val 1872 drivers/net/wireless/broadcom/b43legacy/radio.c txpower = clamp_val(txpower, 0, 63); clamp_val 2011 drivers/ntb/hw/idt/ntb_hw_idt.c mdeg = clamp_val(mdeg, IDT_TEMP_MIN_OFFSET, clamp_val 2014 drivers/ntb/hw/idt/ntb_hw_idt.c mdeg = clamp_val(mdeg, IDT_TEMP_MIN_MDEG, IDT_TEMP_MAX_MDEG); clamp_val 446 drivers/platform/x86/asus-laptop.c return clamp_val((short)val, -PEGA_ACC_CLAMP, PEGA_ACC_CLAMP); clamp_val 557 drivers/platform/x86/asus-wmi.c asus->kbd_led_wk = clamp_val(value, 0, max_level); clamp_val 963 drivers/platform/x86/eeepc-laptop.c value = clamp_val(value, 0, 255); clamp_val 437 drivers/power/supply/smb347-charger.c ret = clamp_val(ret, 2400000, 3000000) - 2400000; clamp_val 451 drivers/power/supply/smb347-charger.c ret = clamp_val(ret, 3500000, 4500000) - 3500000; clamp_val 473 drivers/power/supply/smb347-charger.c val = clamp_val(val, 100, 130) - 100; clamp_val 486 drivers/power/supply/smb347-charger.c val = clamp_val(val, 0, 15); clamp_val 503 drivers/power/supply/smb347-charger.c val = clamp_val(val, 40, 55) - 40; clamp_val 518 drivers/power/supply/smb347-charger.c val = clamp_val(val, -5, 10) + 5; clamp_val 535 drivers/power/supply/smb347-charger.c val = clamp_val(val, 50, 65) - 50; clamp_val 534 drivers/spi/spi-bcm-qspi.c spcr = clamp_val(spbr, QSPI_SPBR_MIN, QSPI_SPBR_MAX); clamp_val 389 drivers/staging/media/ipu3/ipu3-v4l2.c *num_buffers = clamp_val(*num_buffers, 1, VB2_MAX_FRAME); clamp_val 444 drivers/target/sbp/sbp_target.c login_response_len = clamp_val( clamp_val 344 drivers/thermal/intel/x86_pkg_temp_thermal.c thres_count = clamp_val(thres_count, 0, MAX_NUMBER_OF_TRIPS); clamp_val 213 drivers/thermal/rcar_gen3_thermal.c low = clamp_val(low, -40000, 120000); clamp_val 214 drivers/thermal/rcar_gen3_thermal.c high = clamp_val(high, -40000, 120000); clamp_val 450 drivers/thermal/tegra/soctherm.c temp = clamp_val(trip_temp, min_low_temp, max_high_temp); clamp_val 153 drivers/usb/gadget/udc/bdc/bdc_cmd.c si = clamp_val(si, 1, 16) - 1; clamp_val 1225 drivers/usb/host/xhci-mem.c interval = clamp_val(ep->desc.bInterval, 1, 16) - 1; clamp_val 1256 drivers/usb/host/xhci-mem.c interval = clamp_val(interval, min_exponent, max_exponent); clamp_val 1484 drivers/usb/host/xhci-mem.c max_packet = clamp_val(max_packet, 8, 64); clamp_val 90 drivers/usb/mtu3/mtu3_gadget.c interval = clamp_val(interval, 1, 16) - 1; clamp_val 102 drivers/usb/mtu3/mtu3_gadget.c interval = clamp_val(interval, 1, 16) - 1; clamp_val 421 drivers/video/fbdev/pxafb.c clamp_val(var->hsync_len, 1, 64); clamp_val 422 drivers/video/fbdev/pxafb.c clamp_val(var->vsync_len, 1, 64); clamp_val 423 drivers/video/fbdev/pxafb.c clamp_val(var->left_margin, 1, 255); clamp_val 424 drivers/video/fbdev/pxafb.c clamp_val(var->right_margin, 1, 255); clamp_val 425 drivers/video/fbdev/pxafb.c clamp_val(var->upper_margin, 1, 255); clamp_val 426 drivers/video/fbdev/pxafb.c clamp_val(var->lower_margin, 1, 255); clamp_val 209 fs/btrfs/async-thread.c new_current_active = clamp_val(new_current_active, 1, wq->limit_active); clamp_val 343 fs/ext4/super.c now = clamp_val(now, 0, (1ull << 40) - 1); clamp_val 107 fs/fscache/main.c clamp_val(nr_cpus, clamp_val 117 fs/fscache/main.c clamp_val(fscache_object_max_active / 2, clamp_val 774 include/linux/cpufreq.h target_freq = clamp_val(target_freq, policy->min, policy->max); clamp_val 837 include/linux/cpufreq.h target_freq = clamp_val(target_freq, policy->min, policy->max); clamp_val 917 include/linux/cpufreq.h target_freq = clamp_val(target_freq, policy->min, policy->max); clamp_val 690 kernel/power/swap.c nr_threads = clamp_val(nr_threads, 1, LZO_THREADS); clamp_val 1181 kernel/power/swap.c nr_threads = clamp_val(nr_threads, 1, LZO_THREADS); clamp_val 1257 kernel/power/swap.c read_pages = clamp_val(read_pages, LZO_MIN_RD_PAGES, LZO_MAX_RD_PAGES); clamp_val 4583 kernel/sched/core.c nice = clamp_val(nice, MIN_NICE, MAX_NICE); clamp_val 4194 kernel/workqueue.c return clamp_val(max_active, 1, lim); clamp_val 113 net/dccp/ccids/ccid2.c clamp_val(val, DCCPF_SEQ_WMIN,