From 1c504ea4a7299fb56ca5ec0ad39bc8b1acf01c47 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Mon, 5 May 2008 01:22:59 -0700 Subject: [PATCH] --- yaml --- r: 102431 b: refs/heads/master c: 7d3aa71239f588215b5a7c359f05155b192d8081 h: refs/heads/master i: 102429: 5fe9e26746352be8b8a2d4477d721fc9fd75b114 102427: a6128bbfb31de7fc4cde63daa630b104a9304a13 102423: 8f5ae128d9134e4aafbe213894b2f9b138a4643c 102415: e079e5872abc18f3de861068c3f361bb3737a2cb 102399: 63fdcdaf4356b95cb44246c04a5df2626bacf212 v: v3 --- [refs] | 2 +- trunk/net/tipc/core.h | 6 ++++-- trunk/net/tipc/dbg.c | 14 +++++++------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index fed988ccba88..ff5ac0fa1d8b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c89039850bdf8047472b4ee6132048dacef2cf5a +refs/heads/master: 7d3aa71239f588215b5a7c359f05155b192d8081 diff --git a/trunk/net/tipc/core.h b/trunk/net/tipc/core.h index 7042ef377262..bc633552e9ff 100644 --- a/trunk/net/tipc/core.h +++ b/trunk/net/tipc/core.h @@ -2,7 +2,7 @@ * net/tipc/core.h: Include file for TIPC global declarations * * Copyright (c) 2005-2006, Ericsson AB - * Copyright (c) 2005-2006, Wind River Systems + * Copyright (c) 2005-2007, Wind River Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,7 +65,9 @@ #define assert(i) BUG_ON(!(i)) struct tipc_msg; -extern struct print_buf *TIPC_NULL, *TIPC_CONS, *TIPC_LOG; +extern struct print_buf *const TIPC_NULL; +extern struct print_buf *const TIPC_CONS; +extern struct print_buf *const TIPC_LOG; void tipc_msg_print(struct print_buf*,struct tipc_msg *,const char*); void tipc_printf(struct print_buf *, const char *fmt, ...); void tipc_dump(struct print_buf*,const char *fmt, ...); diff --git a/trunk/net/tipc/dbg.c b/trunk/net/tipc/dbg.c index 8ca9457250be..cda496815a05 100644 --- a/trunk/net/tipc/dbg.c +++ b/trunk/net/tipc/dbg.c @@ -49,13 +49,13 @@ */ static struct print_buf null_buf = { NULL, 0, NULL, 0 }; -struct print_buf *TIPC_NULL = &null_buf; +struct print_buf *const TIPC_NULL = &null_buf; static struct print_buf cons_buf = { NULL, 0, NULL, 1 }; -struct print_buf *TIPC_CONS = &cons_buf; +struct print_buf *const TIPC_CONS = &cons_buf; static struct print_buf log_buf = { NULL, 0, NULL, 1 }; -struct print_buf *TIPC_LOG = &log_buf; +struct print_buf *const TIPC_LOG = &log_buf; /* * Locking policy when using print buffers. @@ -107,7 +107,7 @@ void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size) pb->buf = NULL; } else if (raw) { pb->buf[0] = 0; - pb->buf[size-1] = ~0; + pb->buf[size - 1] = ~0; } } @@ -118,7 +118,7 @@ void tipc_printbuf_init(struct print_buf *pb, char *raw, u32 size) void tipc_printbuf_reset(struct print_buf *pb) { - if (pb->buf != NULL) { + if (pb->buf) { pb->crs = pb->buf; pb->buf[0] = 0; pb->buf[pb->size - 1] = ~0; @@ -158,7 +158,7 @@ int tipc_printbuf_validate(struct print_buf *pb) if (pb->buf[pb->size - 1] == 0) { cp_buf = kmalloc(pb->size, GFP_ATOMIC); - if (cp_buf != NULL){ + if (cp_buf) { tipc_printbuf_init(&cb, cp_buf, pb->size); tipc_printbuf_move(&cb, pb); tipc_printbuf_move(pb, &cb); @@ -205,7 +205,7 @@ void tipc_printbuf_move(struct print_buf *pb_to, struct print_buf *pb_from) /* Copy data from char after cursor to end (if used) */ len = pb_from->buf + pb_from->size - pb_from->crs - 2; - if ((pb_from->buf[pb_from->size-1] == 0) && (len > 0)) { + if ((pb_from->buf[pb_from->size - 1] == 0) && (len > 0)) { strcpy(pb_to->buf, pb_from->crs + 1); pb_to->crs = pb_to->buf + len; } else