Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\vsprintf.c Create Date:2022-07-28 06:12:15
Last Modify:2022-05-21 09:47:42 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:escaped_string

Proto:static __attribute__((__noinline__)) char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, const char *fmt)

Type:char

Parameter:

TypeParameterName
char *buf
char *end
u8 *addr
struct printf_specspec
const char *fmt
1588  bool found = true
1589  count = 1
1590  flags = 0
1593  If width of output field == 0 Then Return buf
1596  If check_pointer( & buf, end, addr, spec) Then Return buf
1599  Do
1601  Case fmt[count++] == 'a'
1602  flags |= ESCAPE_ANY
1603  Break
1604  Case fmt[count++] == 'c'
1605  flags |= ESCAPE_SPECIAL
1606  Break
1607  Case fmt[count++] == 'h'
1608  flags |= ESCAPE_HEX
1609  Break
1610  Case fmt[count++] == 'n'
1611  flags |= ESCAPE_NULL
1612  Break
1613  Case fmt[count++] == 'o'
1614  flags |= ESCAPE_OCTAL
1615  Break
1616  Case fmt[count++] == 'p'
1617  flags |= ESCAPE_NP
1618  Break
1619  Case fmt[count++] == 's'
1620  flags |= ESCAPE_SPACE
1621  Break
1622  Default
1623  found = false
1624  Break
1626  When found cycle
1628  If Not flags Then flags = ESCAPE_ANY_NP
1631  len = If width of output field < 0 Then 1 Else width of output field
1638  buf += string_escape_mem(addr, len, buf, buf < end ? end - buf : 0, flags, NULL)
1640  Return buf
Caller
NameDescribe
pointerShow a '%p' thing. A kernel extension is that the '%p' is followed* by an extra set of alphanumeric characters that are extended format* specifiers.* Please update scripts/checkpatch.pl when adding/removing conversion* characters