aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pstore
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-06 17:37:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:13 -0400
commitef74885353e0ee4d884604148628df3369c76719 (patch)
tree504568bb692e56cbac76d4d57e268c56cbff0991 /fs/pstore
parentf3da64d1ea12ed6cfe18e6dedbc9739743e0b884 (diff)
fs/pstore: logging clean-up
- Define pr_fmt in plateform.c and ram_core.c for global prefix. - Coalesce format fragments. - Separate format/arguments on lines > 80 characters. Note: Some pr_foo() were initially declared without prefix and therefore this could break existing log analyzer. [akpm@linux-foundation.org: missed a couple of prefix removals] Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Joe Perches <joe@perches.com> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/pstore')
-rw-r--r--fs/pstore/platform.c19
-rw-r--r--fs/pstore/ram_core.c36
2 files changed, 26 insertions, 29 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 46d269e38706..0a9b72cdfeca 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -18,6 +18,8 @@
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */ 19 */
20 20
21#define pr_fmt(fmt) "pstore: " fmt
22
21#include <linux/atomic.h> 23#include <linux/atomic.h>
22#include <linux/types.h> 24#include <linux/types.h>
23#include <linux/errno.h> 25#include <linux/errno.h>
@@ -224,14 +226,12 @@ static void allocate_buf_for_compression(void)
224 zlib_inflate_workspacesize()); 226 zlib_inflate_workspacesize());
225 stream.workspace = kmalloc(size, GFP_KERNEL); 227 stream.workspace = kmalloc(size, GFP_KERNEL);
226 if (!stream.workspace) { 228 if (!stream.workspace) {
227 pr_err("pstore: No memory for compression workspace; " 229 pr_err("No memory for compression workspace; skipping compression\n");
228 "skipping compression\n");
229 kfree(big_oops_buf); 230 kfree(big_oops_buf);
230 big_oops_buf = NULL; 231 big_oops_buf = NULL;
231 } 232 }
232 } else { 233 } else {
233 pr_err("No memory for uncompressed data; " 234 pr_err("No memory for uncompressed data; skipping compression\n");
234 "skipping compression\n");
235 stream.workspace = NULL; 235 stream.workspace = NULL;
236 } 236 }
237 237
@@ -455,8 +455,7 @@ int pstore_register(struct pstore_info *psi)
455 add_timer(&pstore_timer); 455 add_timer(&pstore_timer);
456 } 456 }
457 457
458 pr_info("pstore: Registered %s as persistent store backend\n", 458 pr_info("Registered %s as persistent store backend\n", psi->name);
459 psi->name);
460 459
461 return 0; 460 return 0;
462} 461}
@@ -502,8 +501,8 @@ void pstore_get_records(int quiet)
502 size = unzipped_len; 501 size = unzipped_len;
503 compressed = false; 502 compressed = false;
504 } else { 503 } else {
505 pr_err("pstore: decompression failed;" 504 pr_err("decompression failed;returned %d\n",
506 "returned %d\n", unzipped_len); 505 unzipped_len);
507 compressed = true; 506 compressed = true;
508 } 507 }
509 } 508 }
@@ -524,8 +523,8 @@ out:
524 mutex_unlock(&psi->read_mutex); 523 mutex_unlock(&psi->read_mutex);
525 524
526 if (failed) 525 if (failed)
527 printk(KERN_WARNING "pstore: failed to load %d record(s) from '%s'\n", 526 pr_warn("failed to load %d record(s) from '%s'\n",
528 failed, psi->name); 527 failed, psi->name);
529} 528}
530 529
531static void pstore_dowork(struct work_struct *work) 530static void pstore_dowork(struct work_struct *work)
diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index ff7e3d4df5a1..34a1e5aa848c 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -12,6 +12,8 @@
12 * 12 *
13 */ 13 */
14 14
15#define pr_fmt(fmt) "persistent_ram: " fmt
16
15#include <linux/device.h> 17#include <linux/device.h>
16#include <linux/err.h> 18#include <linux/err.h>
17#include <linux/errno.h> 19#include <linux/errno.h>
@@ -205,12 +207,10 @@ static void persistent_ram_ecc_old(struct persistent_ram_zone *prz)
205 size = buffer->data + prz->buffer_size - block; 207 size = buffer->data + prz->buffer_size - block;
206 numerr = persistent_ram_decode_rs8(prz, block, size, par); 208 numerr = persistent_ram_decode_rs8(prz, block, size, par);
207 if (numerr > 0) { 209 if (numerr > 0) {
208 pr_devel("persistent_ram: error in block %p, %d\n", 210 pr_devel("error in block %p, %d\n", block, numerr);
209 block, numerr);
210 prz->corrected_bytes += numerr; 211 prz->corrected_bytes += numerr;
211 } else if (numerr < 0) { 212 } else if (numerr < 0) {
212 pr_devel("persistent_ram: uncorrectable error in block %p\n", 213 pr_devel("uncorrectable error in block %p\n", block);
213 block);
214 prz->bad_blocks++; 214 prz->bad_blocks++;
215 } 215 }
216 block += prz->ecc_info.block_size; 216 block += prz->ecc_info.block_size;
@@ -257,7 +257,7 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
257 prz->rs_decoder = init_rs(prz->ecc_info.symsize, prz->ecc_info.poly, 257 prz->rs_decoder = init_rs(prz->ecc_info.symsize, prz->ecc_info.poly,
258 0, 1, prz->ecc_info.ecc_size); 258 0, 1, prz->ecc_info.ecc_size);
259 if (prz->rs_decoder == NULL) { 259 if (prz->rs_decoder == NULL) {
260 pr_info("persistent_ram: init_rs failed\n"); 260 pr_info("init_rs failed\n");
261 return -EINVAL; 261 return -EINVAL;
262 } 262 }
263 263
@@ -267,10 +267,10 @@ static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
267 numerr = persistent_ram_decode_rs8(prz, buffer, sizeof(*buffer), 267 numerr = persistent_ram_decode_rs8(prz, buffer, sizeof(*buffer),
268 prz->par_header); 268 prz->par_header);
269 if (numerr > 0) { 269 if (numerr > 0) {
270 pr_info("persistent_ram: error in header, %d\n", numerr); 270 pr_info("error in header, %d\n", numerr);
271 prz->corrected_bytes += numerr; 271 prz->corrected_bytes += numerr;
272 } else if (numerr < 0) { 272 } else if (numerr < 0) {
273 pr_info("persistent_ram: uncorrectable error in header\n"); 273 pr_info("uncorrectable error in header\n");
274 prz->bad_blocks++; 274 prz->bad_blocks++;
275 } 275 }
276 276
@@ -317,7 +317,7 @@ void persistent_ram_save_old(struct persistent_ram_zone *prz)
317 prz->old_log = kmalloc(size, GFP_KERNEL); 317 prz->old_log = kmalloc(size, GFP_KERNEL);
318 } 318 }
319 if (!prz->old_log) { 319 if (!prz->old_log) {
320 pr_err("persistent_ram: failed to allocate buffer\n"); 320 pr_err("failed to allocate buffer\n");
321 return; 321 return;
322 } 322 }
323 323
@@ -396,8 +396,8 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size)
396 396
397 pages = kmalloc(sizeof(struct page *) * page_count, GFP_KERNEL); 397 pages = kmalloc(sizeof(struct page *) * page_count, GFP_KERNEL);
398 if (!pages) { 398 if (!pages) {
399 pr_err("%s: Failed to allocate array for %u pages\n", __func__, 399 pr_err("%s: Failed to allocate array for %u pages\n",
400 page_count); 400 __func__, page_count);
401 return NULL; 401 return NULL;
402 } 402 }
403 403
@@ -462,19 +462,17 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
462 if (prz->buffer->sig == sig) { 462 if (prz->buffer->sig == sig) {
463 if (buffer_size(prz) > prz->buffer_size || 463 if (buffer_size(prz) > prz->buffer_size ||
464 buffer_start(prz) > buffer_size(prz)) 464 buffer_start(prz) > buffer_size(prz))
465 pr_info("persistent_ram: found existing invalid buffer," 465 pr_info("found existing invalid buffer, size %zu, start %zu\n",
466 " size %zu, start %zu\n", 466 buffer_size(prz), buffer_start(prz));
467 buffer_size(prz), buffer_start(prz));
468 else { 467 else {
469 pr_debug("persistent_ram: found existing buffer," 468 pr_debug("found existing buffer, size %zu, start %zu\n",
470 " size %zu, start %zu\n", 469 buffer_size(prz), buffer_start(prz));
471 buffer_size(prz), buffer_start(prz));
472 persistent_ram_save_old(prz); 470 persistent_ram_save_old(prz);
473 return 0; 471 return 0;
474 } 472 }
475 } else { 473 } else {
476 pr_debug("persistent_ram: no valid data in buffer" 474 pr_debug("no valid data in buffer (sig = 0x%08x)\n",
477 " (sig = 0x%08x)\n", prz->buffer->sig); 475 prz->buffer->sig);
478 } 476 }
479 477
480 prz->buffer->sig = sig; 478 prz->buffer->sig = sig;
@@ -509,7 +507,7 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
509 507
510 prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL); 508 prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL);
511 if (!prz) { 509 if (!prz) {
512 pr_err("persistent_ram: failed to allocate persistent ram zone\n"); 510 pr_err("failed to allocate persistent ram zone\n");
513 goto err; 511 goto err;
514 } 512 }
515 513