From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755995Ab3LRTSH (ORCPT ); Wed, 18 Dec 2013 14:18:07 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34625 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755596Ab3LRTSF (ORCPT ); Wed, 18 Dec 2013 14:18:05 -0500 Date: Wed, 18 Dec 2013 11:18:06 -0800 From: Greg Kroah-Hartman To: josh@joshtriplett.org Cc: Rashika Kheria , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: base: Add prototype declaration in memory.c Message-ID: <20131218191806.GC28735@kroah.com> References: <20131218063953.GA3180@rashika> <20131218153451.GA22228@kroah.com> <20131218190108.GL24229@cloud> <20131218190344.GA28706@kroah.com> <20131218191024.GA24413@cloud> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20131218191024.GA24413@cloud> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 18, 2013 at 11:10:24AM -0800, josh@joshtriplett.org wrote: > On Wed, Dec 18, 2013 at 11:03:44AM -0800, Greg Kroah-Hartman wrote: > > On Wed, Dec 18, 2013 at 11:01:08AM -0800, josh@joshtriplett.org wrote: > > > On Wed, Dec 18, 2013 at 07:34:51AM -0800, Greg Kroah-Hartman wrote: > > > > On Wed, Dec 18, 2013 at 12:09:53PM +0530, Rashika Kheria wrote: > > > > > Add the prototype declaration of function memory_block_size_bytes() in > > > > > memory.c. > > > > > > > > > > This eliminates the following warning in memory.c: > > > > > drivers/base/memory.c:87:1: warning: no previous prototype for ‘memory_block_size_bytes’ [-Wmissing-prototypes] > > > > > > > > > > Signed-off-by: Rashika Kheria > > > > > Reviewed-by: Josh Triplett > > > > > --- > > > > > drivers/base/memory.c | 1 + > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > > > > > index bece691..cfa03de 100644 > > > > > --- a/drivers/base/memory.c > > > > > +++ b/drivers/base/memory.c > > > > > @@ -83,6 +83,7 @@ static void memory_block_release(struct device *dev) > > > > > kfree(mem); > > > > > } > > > > > > > > > > +unsigned long __weak memory_block_size_bytes(void); > > > > > unsigned long __weak memory_block_size_bytes(void) > > > > > > > > If this patch is the "solution" then something else is really wrong > > > > here, please use your judgement to realize this... > > > > > > It's a weak symbol provided and consumed within the same file, and then > > > overridden on a few random architectures. It isn't currently prototyped > > > in any header file. The other potential solution would be to add it to > > > an appropriate existing header or create a new one. Any suggestions for > > > an appropriate existing header to prototype it in instead? > > > > device.h? > > include/linux/device.h? That would work, though it seems slightly > out of place there. > > Would include/linux/memory.h work? Sure, that's fine, I don't really care...