xref: /dflybsd-src/sys/dev/drm/linux_printf.c (revision 297046af58915b8720f732ae17789e12c21a1b77)
1*297046afSFrançois Tigeot /*
2*297046afSFrançois Tigeot  * Copyright (c) 2020 François Tigeot <ftigeot@wolfpond.org>
3*297046afSFrançois Tigeot  * All rights reserved.
4*297046afSFrançois Tigeot  *
5*297046afSFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
6*297046afSFrançois Tigeot  * modification, are permitted provided that the following conditions
7*297046afSFrançois Tigeot  * are met:
8*297046afSFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
9*297046afSFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
10*297046afSFrançois Tigeot  *    disclaimer.
11*297046afSFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
12*297046afSFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
13*297046afSFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
14*297046afSFrançois Tigeot  *
15*297046afSFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*297046afSFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*297046afSFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*297046afSFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*297046afSFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*297046afSFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*297046afSFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*297046afSFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*297046afSFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*297046afSFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*297046afSFrançois Tigeot  */
26*297046afSFrançois Tigeot 
27*297046afSFrançois Tigeot #include <linux/seq_file.h>
28*297046afSFrançois Tigeot 
29*297046afSFrançois Tigeot #include <sys/sbuf.h>
30*297046afSFrançois Tigeot 
31*297046afSFrançois Tigeot void
seq_printf(struct seq_file * m,const char * f,...)32*297046afSFrançois Tigeot seq_printf(struct seq_file *m, const char *f, ...)
33*297046afSFrançois Tigeot {
34*297046afSFrançois Tigeot 	__va_list ap;
35*297046afSFrançois Tigeot 
36*297046afSFrançois Tigeot 	__va_start(ap, f);
37*297046afSFrançois Tigeot 	ksnprintf(m->buf, m->size, f, ap);
38*297046afSFrançois Tigeot 	__va_end(ap);
39*297046afSFrançois Tigeot }
40