Lines Matching refs:val
90 long long val;
100 val = (buf[0] << 16) + (buf[1] << 8) + buf[2];
103 val = (buf[0] << 4) + (buf[1] >> 4);
122 val *= 625LL;
125 val = (val * 25LL) >> 1;
127 val *= 1000;
128 /* Overflow check: Assuming max 24-bit power, val is at most 53 bits right now. */
129 val = DIV_ROUND_CLOSEST_ULL(val, shunt_resistor);
132 * val can still be > 32 bits so returning long long makes sense
142 val *= 25;
150 val = val >> 1;
158 val *= 25 * 1000;
159 /* Overflow check: Assuming max 12-bit sense, val is at most 27 bits right now */
160 val = DIV_ROUND_CLOSEST_ULL(val, shunt_resistor);
166 return val;
170 unsigned long long val)
179 val = clamp_val(val, 0, U32_MAX);
197 val *= shunt_resistor;
198 /* Overflow check: Assuming 32-bit val and shunt resistor, val <= 64bits */
199 val = DIV_ROUND_CLOSEST_ULL(val, 625 * 1000);
200 /* Overflow check: val is now <= 44 bits */
203 val *= shunt_resistor;
204 /* Overflow check: Assuming 32-bit val and shunt resistor, val <= 64bits */
205 val = DIV_ROUND_CLOSEST_ULL(val, 25 * 1000) * 2;
206 /* Overflow check: val is now <= 51 bits */
215 val = DIV_ROUND_CLOSEST_ULL(val, 25);
223 val *= 2;
231 val *= shunt_resistor;
232 /* Overflow check: Assuming 32-bit val and 32-bit shunt resistor, val is 64bits */
233 val = DIV_ROUND_CLOSEST_ULL(val, 25 * 1000);
234 /* Overflow check: val is now <= 50 bits */
239 return val;
262 unsigned int val;
268 ret = kstrtouint(buf, 10, &val);
273 regval = ltc2945_val_to_reg(dev, reg, val);
303 unsigned long val;
306 ret = kstrtoul(buf, 10, &val);
309 if (val != 1)