File tree 1 file changed +46
-45
lines changed
1 file changed +46
-45
lines changed Original file line number Diff line number Diff line change @@ -84,54 +84,55 @@ static inline void _vprintk(const char *fmt, va_list ap)
84
84
might_format = 1 ;
85
85
}
86
86
} else {
87
- if (* fmt == '%' ) {
88
- _char_out ((int )'%' );
89
- might_format = 0 ;
90
- } else {
91
- switch (* fmt ) {
92
- case 'd' :
93
- case 'i' : {
94
- long d = va_arg (ap , long );
95
- if (d < 0 ) {
96
- _char_out ((int )'-' );
97
- d = - d ;
98
- }
99
- _printk_dec_ulong (d );
100
- break ;
101
- }
102
- case 'u' : {
103
- unsigned long u = va_arg (
104
- ap , unsigned long );
105
- _printk_dec_ulong (u );
106
- break ;
107
- }
108
- case 'x' :
109
- case 'X' :
110
- case 'p' : {
111
- unsigned long x = va_arg (
112
- ap , unsigned long );
113
- _printk_hex_ulong (x );
114
- break ;
115
- }
116
- case 's' : {
117
- char * s = va_arg (ap , char * );
118
- while (* s )
119
- _char_out ((int )(* s ++ ));
120
- break ;
87
+ switch (* fmt ) {
88
+ case 'd' :
89
+ case 'i' : {
90
+ long d = va_arg (ap , long );
91
+
92
+ if (d < 0 ) {
93
+ _char_out ((int )'-' );
94
+ d = - d ;
121
95
}
122
- case 'c' : {
123
- int c = va_arg (ap , int );
96
+ _printk_dec_ulong (d );
97
+ break ;
98
+ }
99
+ case 'u' : {
100
+ unsigned long u = va_arg (
101
+ ap , unsigned long );
102
+ _printk_dec_ulong (u );
103
+ break ;
104
+ }
105
+ case 'x' :
106
+ case 'X' :
107
+ case 'p' : {
108
+ unsigned long x = va_arg (
109
+ ap , unsigned long );
110
+ _printk_hex_ulong (x );
111
+ break ;
112
+ }
113
+ case 's' : {
114
+ char * s = va_arg (ap , char * );
124
115
125
- _char_out (c );
126
- break ;
127
- }
128
- default :
129
- _char_out ((int )'%' );
130
- _char_out ((int )* fmt );
131
- break ;
132
- }
133
- might_format = 0 ;
116
+ while (* s )
117
+ _char_out ((int )(* s ++ ));
118
+ break ;
119
+ }
120
+ case 'c' : {
121
+ int c = va_arg (ap , int );
122
+
123
+ _char_out (c );
124
+ break ;
125
+ }
126
+ case '%' : {
127
+ _char_out ((int )'%' );
128
+ break ;
129
+ }
130
+ default :
131
+ _char_out ((int )'%' );
132
+ _char_out ((int )* fmt );
133
+ break ;
134
134
}
135
+ might_format = 0 ;
135
136
}
136
137
137
138
++ fmt ;
You can’t perform that action at this time.
0 commit comments