public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] lib/debugobjects.c: code clean-up
@ 2014-05-24 13:08 Fabian Frederick
  2014-05-24 22:00 ` Josh Triplett
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-05-24 13:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fabian Frederick, Josh Triplett, Andrew Morton

Fix some checkpatch warnings.

Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 lib/debugobjects.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 437a6b4..69f25bf 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -271,7 +271,7 @@ static void debug_print_object(struct debug_obj *obj, char *msg)
  */
 static int
 debug_object_fixup(int (*fixup)(void *addr, enum debug_obj_state state),
-		   void * addr, enum debug_obj_state state)
+		   void *addr, enum debug_obj_state state)
 {
 	int fixed = 0;
 
@@ -415,7 +415,8 @@ int debug_object_activate(void *addr, struct debug_obj_descr *descr)
 			debug_print_object(obj, "activate");
 			state = obj->state;
 			raw_spin_unlock_irqrestore(&db->lock, flags);
-			ret = debug_object_fixup(descr->fixup_activate, addr, state);
+			ret = debug_object_fixup(descr->fixup_activate,
+						 addr, state);
 			return ret ? -EINVAL : 0;
 
 		case ODEBUG_STATE_DESTROYED:
@@ -680,7 +681,7 @@ static void __debug_check_no_obj_freed(const void *address, unsigned long size)
 	chunks = ((eaddr - paddr) + (ODEBUG_CHUNK_SIZE - 1));
 	chunks >>= ODEBUG_CHUNK_SHIFT;
 
-	for (;chunks > 0; chunks--, paddr += ODEBUG_CHUNK_SIZE) {
+	for (; chunks > 0; chunks--, paddr += ODEBUG_CHUNK_SIZE) {
 		db = get_bucket(paddr);
 
 repeat:
@@ -1084,7 +1085,7 @@ void __init debug_objects_mem_init(void)
 		return;
 
 	obj_cache = kmem_cache_create("debug_objects_cache",
-				      sizeof (struct debug_obj), 0,
+				      sizeof(struct debug_obj), 0,
 				      SLAB_DEBUG_OBJECTS, NULL);
 
 	if (!obj_cache || debug_objects_replace_static_objects()) {
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/4] lib/debugobjects.c: code clean-up
  2014-05-24 13:08 [PATCH 4/4] lib/debugobjects.c: code clean-up Fabian Frederick
@ 2014-05-24 22:00 ` Josh Triplett
  2014-05-25  3:17   ` Fabian Frederick
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Triplett @ 2014-05-24 22:00 UTC (permalink / raw)
  To: Fabian Frederick; +Cc: linux-kernel, Andrew Morton

On Sat, May 24, 2014 at 03:08:06PM +0200, Fabian Frederick wrote:
> Fix some checkpatch warnings.
> 
> Cc: Josh Triplett <josh@joshtriplett.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>

Some of these make sense, one of them does not.  Comments below.

Also, please explicitly note the checkpatch warnings you fixed, not just
"Fix some checkpatch warnings.".

> --- a/lib/debugobjects.c
> +++ b/lib/debugobjects.c
[...]
> @@ -415,7 +415,8 @@ int debug_object_activate(void *addr, struct debug_obj_descr *descr)
>  			debug_print_object(obj, "activate");
>  			state = obj->state;
>  			raw_spin_unlock_irqrestore(&db->lock, flags);
> -			ret = debug_object_fixup(descr->fixup_activate, addr, state);
> +			ret = debug_object_fixup(descr->fixup_activate,
> +						 addr, state);

This does not seem like a worthwhile improvement.  Please don't blindly
listen to checkpatch, especially regarding line lengths.

- Josh Triplett

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 4/4] lib/debugobjects.c: code clean-up
  2014-05-24 22:00 ` Josh Triplett
@ 2014-05-25  3:17   ` Fabian Frederick
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Frederick @ 2014-05-25  3:17 UTC (permalink / raw)
  To: Josh Triplett; +Cc: linux-kernel, Andrew Morton

On Sat, 24 May 2014 15:00:09 -0700
Josh Triplett <josh@joshtriplett.org> wrote:

> On Sat, May 24, 2014 at 03:08:06PM +0200, Fabian Frederick wrote:
> > Fix some checkpatch warnings.
> > 
> > Cc: Josh Triplett <josh@joshtriplett.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Fabian Frederick <fabf@skynet.be>
> 
> Some of these make sense, one of them does not.  Comments below.
> 
> Also, please explicitly note the checkpatch warnings you fixed, not just
> "Fix some checkpatch warnings.".
ok

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-05-25  3:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-24 13:08 [PATCH 4/4] lib/debugobjects.c: code clean-up Fabian Frederick
2014-05-24 22:00 ` Josh Triplett
2014-05-25  3:17   ` Fabian Frederick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox