'\" t .\" Title: clamp_t .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "CLAMP_T" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "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_t \- return a value clamped to a given range using a given type .SH "SYNOPSIS" .HP \w'clamp_t('u .BI "clamp_t(" "type" ", " "val" ", " "lo" ", " "hi" ");" .SH "ARGUMENTS" .PP \fItype\fR .RS 4 the type of variable to use .RE .PP \fIval\fR .RS 4 current value .RE .PP \fIlo\fR .RS 4 minimum allowable value .RE .PP \fIhi\fR .RS 4 maximum allowable value .RE .SH "DESCRIPTION" .PP This macro does no typechecking and uses temporary variables of type \*(Aqtype\*(Aq to make all the comparisons\&. .SH "COPYRIGHT" .br