Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753756AbcDVIe5 (ORCPT ); Fri, 22 Apr 2016 04:34:57 -0400 Received: from www.linutronix.de ([62.245.132.108]:52279 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbcDVIez (ORCPT ); Fri, 22 Apr 2016 04:34:55 -0400 Date: Fri, 22 Apr 2016 10:33:02 +0200 (CEST) From: Thomas Gleixner To: "Du, Changbin" cc: Andrew Morton , Jonathan Corbet , "Paul E. McKenney" , josh@joshtriplett.org, Steven Rostedt , Mathieu Desnoyers , jiangshanlai@gmail.com, John Stultz , Tejun Heo , borntraeger@de.ibm.com, dchinner@redhat.com, linux-doc@vger.kernel.org, LKML Subject: Re: [PATCH 1/7] debugobjects: make fixup functions return bool instead of int In-Reply-To: <1461312468-14335-2-git-send-email-changbin.du@intel.com> Message-ID: References: <1461312468-14335-1-git-send-email-changbin.du@intel.com> <1461312468-14335-2-git-send-email-changbin.du@intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1390 Lines: 33 On Fri, 22 Apr 2016, changbin.du@intel.com wrote: > From: "Du, Changbin" > > The object debugging infrastructure core provides some fixup callbacks > for the subsystem who use it. These callbacks are called from the debug > code whenever a problem in debug_object_init is detected. And > debugobjects core suppose them returns 1 when the fixup was successful, > otherwise 0. So the return type is boolean. > > A bad thing is that debug_object_fixup use the return value for > arithmetic operation. It confused me that what is the reall return What's bad about that? The fact that it's used for arithmethic operation or that it confused you? > Reading over the whole code, I found some place do use the return value > incorrectly(see next patch). So why use bool type instead? Patches which fix a problem need to come first not in the middle of a revamp series. > + bool (*fixup_init)(void *addr, enum debug_obj_state state); > + bool (*fixup_activate)(void *addr, enum debug_obj_state state); > + bool (*fixup_destroy)(void *addr, enum debug_obj_state state); > + bool (*fixup_free)(void *addr, enum debug_obj_state state); > + bool (*fixup_assert_init)(void *addr, enum debug_obj_state state); So this change will introduce a gazillion of compile warnings because the callbacks in the various usage sites are still having 'int' return type. Thanks, tglx