@@ -168,28 +168,29 @@ static bool prz_ok(struct persistent_ram_zone *prz)
168
168
persistent_ram_ecc_string (prz , NULL , 0 ));
169
169
}
170
170
171
- static ssize_t ftrace_log_combine (struct persistent_ram_zone * dest ,
172
- struct persistent_ram_zone * src )
171
+ static
172
+ ssize_t ftrace_log_combine (char * * dest_log , size_t * dest_log_size ,
173
+ const char * src_log , size_t src_log_size )
173
174
{
174
175
size_t dest_size , src_size , total , dest_off , src_off ;
175
176
size_t dest_idx = 0 , src_idx = 0 , merged_idx = 0 ;
176
177
void * merged_buf ;
177
178
struct pstore_ftrace_record * drec , * srec , * mrec ;
178
179
size_t record_size = sizeof (struct pstore_ftrace_record );
179
180
180
- dest_off = dest -> old_log_size % record_size ;
181
- dest_size = dest -> old_log_size - dest_off ;
181
+ dest_off = * dest_log_size % record_size ;
182
+ dest_size = * dest_log_size - dest_off ;
182
183
183
- src_off = src -> old_log_size % record_size ;
184
- src_size = src -> old_log_size - src_off ;
184
+ src_off = src_log_size % record_size ;
185
+ src_size = src_log_size - src_off ;
185
186
186
187
total = dest_size + src_size ;
187
188
merged_buf = kmalloc (total , GFP_KERNEL );
188
189
if (!merged_buf )
189
190
return - ENOMEM ;
190
191
191
- drec = (struct pstore_ftrace_record * )(dest -> old_log + dest_off );
192
- srec = (struct pstore_ftrace_record * )(src -> old_log + src_off );
192
+ drec = (struct pstore_ftrace_record * )(* dest_log + dest_off );
193
+ srec = (struct pstore_ftrace_record * )(src_log + src_off );
193
194
mrec = (struct pstore_ftrace_record * )(merged_buf );
194
195
195
196
while (dest_size > 0 && src_size > 0 ) {
@@ -213,9 +214,9 @@ static ssize_t ftrace_log_combine(struct persistent_ram_zone *dest,
213
214
src_size -= record_size ;
214
215
}
215
216
216
- kfree (dest -> old_log );
217
- dest -> old_log = merged_buf ;
218
- dest -> old_log_size = total ;
217
+ kfree (* dest_log );
218
+ * dest_log = merged_buf ;
219
+ * dest_log_size = total ;
219
220
220
221
return 0 ;
221
222
}
@@ -291,7 +292,11 @@ static ssize_t ramoops_pstore_read(struct pstore_record *record)
291
292
tmp_prz -> corrected_bytes +=
292
293
prz_next -> corrected_bytes ;
293
294
tmp_prz -> bad_blocks += prz_next -> bad_blocks ;
294
- size = ftrace_log_combine (tmp_prz , prz_next );
295
+
296
+ size = ftrace_log_combine (& tmp_prz -> old_log ,
297
+ & tmp_prz -> old_log_size ,
298
+ prz_next -> old_log ,
299
+ prz_next -> old_log_size );
295
300
if (size )
296
301
goto out ;
297
302
}
0 commit comments