@@ -141,29 +141,29 @@ static ssize_t dbgfs_state(struct file *file, char __user *user_buf,
141
141
return 0 ;
142
142
143
143
/* Print out debug information. */
144
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
145
- "CAIF SPI debug information:\n" );
146
-
147
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ), FLAVOR );
148
-
149
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
150
- "STATE: %d\n" , cfspi -> dbg_state );
151
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
152
- "Previous CMD: 0x%x\n" , cfspi -> pcmd );
153
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
154
- "Current CMD: 0x%x\n" , cfspi -> cmd );
155
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
156
- "Previous TX len: %d\n" , cfspi -> tx_ppck_len );
157
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
158
- "Previous RX len: %d\n" , cfspi -> rx_ppck_len );
159
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
160
- "Current TX len: %d\n" , cfspi -> tx_cpck_len );
161
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
162
- "Current RX len: %d\n" , cfspi -> rx_cpck_len );
163
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
164
- "Next TX len: %d\n" , cfspi -> tx_npck_len );
165
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
166
- "Next RX len: %d\n" , cfspi -> rx_npck_len );
144
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
145
+ "CAIF SPI debug information:\n" );
146
+
147
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ), FLAVOR );
148
+
149
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
150
+ "STATE: %d\n" , cfspi -> dbg_state );
151
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
152
+ "Previous CMD: 0x%x\n" , cfspi -> pcmd );
153
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
154
+ "Current CMD: 0x%x\n" , cfspi -> cmd );
155
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
156
+ "Previous TX len: %d\n" , cfspi -> tx_ppck_len );
157
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
158
+ "Previous RX len: %d\n" , cfspi -> rx_ppck_len );
159
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
160
+ "Current TX len: %d\n" , cfspi -> tx_cpck_len );
161
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
162
+ "Current RX len: %d\n" , cfspi -> rx_cpck_len );
163
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
164
+ "Next TX len: %d\n" , cfspi -> tx_npck_len );
165
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
166
+ "Next RX len: %d\n" , cfspi -> rx_npck_len );
167
167
168
168
if (len > DEBUGFS_BUF_SIZE )
169
169
len = DEBUGFS_BUF_SIZE ;
@@ -180,23 +180,23 @@ static ssize_t print_frame(char *buf, size_t size, char *frm,
180
180
int len = 0 ;
181
181
int i ;
182
182
for (i = 0 ; i < count ; i ++ ) {
183
- len += snprintf ((buf + len ), (size - len ),
183
+ len += scnprintf ((buf + len ), (size - len ),
184
184
"[0x" BYTE_HEX_FMT "]" ,
185
185
frm [i ]);
186
186
if ((i == cut ) && (count > (cut * 2 ))) {
187
187
/* Fast forward. */
188
188
i = count - cut ;
189
- len += snprintf ((buf + len ), (size - len ),
190
- "--- %zu bytes skipped ---\n" ,
191
- count - (cut * 2 ));
189
+ len += scnprintf ((buf + len ), (size - len ),
190
+ "--- %zu bytes skipped ---\n" ,
191
+ count - (cut * 2 ));
192
192
}
193
193
194
194
if ((!(i % 10 )) && i ) {
195
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
196
- "\n" );
195
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
196
+ "\n" );
197
197
}
198
198
}
199
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ), "\n" );
199
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ), "\n" );
200
200
return len ;
201
201
}
202
202
@@ -214,18 +214,18 @@ static ssize_t dbgfs_frame(struct file *file, char __user *user_buf,
214
214
return 0 ;
215
215
216
216
/* Print out debug information. */
217
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
218
- "Current frame:\n" );
217
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
218
+ "Current frame:\n" );
219
219
220
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
221
- "Tx data (Len: %d):\n" , cfspi -> tx_cpck_len );
220
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
221
+ "Tx data (Len: %d):\n" , cfspi -> tx_cpck_len );
222
222
223
223
len += print_frame ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
224
224
cfspi -> xfer .va_tx [0 ],
225
225
(cfspi -> tx_cpck_len + SPI_CMD_SZ ), 100 );
226
226
227
- len += snprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
228
- "Rx data (Len: %d):\n" , cfspi -> rx_cpck_len );
227
+ len += scnprintf ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
228
+ "Rx data (Len: %d):\n" , cfspi -> rx_cpck_len );
229
229
230
230
len += print_frame ((buf + len ), (DEBUGFS_BUF_SIZE - len ),
231
231
cfspi -> xfer .va_rx ,
0 commit comments