'\" t .\" Title: clamp_val .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: May 2018 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 3.16.56 .\" Language: English .\" .TH "CLAMP_VAL" "9" "May 2018" "Kernel Hackers Manual 3\&.16\&" "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clamp_val \- return a value clamped to a given range using val\*(Aqs type .SH "SYNOPSIS" .HP \w'clamp_val('u .BI "clamp_val(" "val" ", " "min" ", " "max" ");" .SH "ARGUMENTS" .PP \fIval\fR .RS 4 current value .RE .PP \fImin\fR .RS 4 minimum allowable value .RE .PP \fImax\fR .RS 4 maximum allowable value .RE .SH "DESCRIPTION" .PP This macro does no typechecking and uses temporary variables of whatever type the input argument \*(Aqval\*(Aq is\&. This is useful when val is an unsigned type and min and max are literals that will otherwise be assigned a signed integer type\&. .SH "COPYRIGHT" .br