From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C61B9C11D04 for ; Thu, 20 Feb 2020 11:27:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A86F2465D for ; Thu, 20 Feb 2020 11:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582198023; bh=CEk8idDaWnhSZHqSnOYyFDbQj7mAiD4KIa+YtxoO+74=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=aNyUx325Xe+YI/zJZf+yTtjh0qo0Ips5dft6Ty1LcPRd1BmXp0DW8ShfoqOiMmn4s gQpf5Ss5+7bbXVlohQgbFFUi9/WyJ1+LzoYKFLK/7Motuer8+d/ZOwk3tMtvf1qxUr 0nnMwLsSNSijRYFkpOPvfR7Ppy9qWHgiVSpWcSDw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbgBTL1D (ORCPT ); Thu, 20 Feb 2020 06:27:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:53340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbgBTL1D (ORCPT ); Thu, 20 Feb 2020 06:27:03 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 562672071E; Thu, 20 Feb 2020 11:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582198022; bh=CEk8idDaWnhSZHqSnOYyFDbQj7mAiD4KIa+YtxoO+74=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oE+5vMySvi9PlHim4VNQTDn1Xdu7+jIng8by5DrKHwUmBtzXw/q+D0OuuFw31GjU4 yHpVgEeeT6CivTYmiMgnaDHlu3RUlPRKIhCtsoiuGP3u+Ue25jjAbYnbS4K/6wxndy y8gXHMTIT/7Tpmh5Whdg6Z7BHDpWfN4N9ktjeA3g= Date: Thu, 20 Feb 2020 12:27:00 +0100 From: Greg Kroah-Hartman To: Marc Gonzalez Cc: Stephen Boyd , Michael Turquette , Kuninori Morimoto , Russell King , Sudip Mukherjee , Dmitry Torokhov , Guenter Roeck , Bjorn Andersson , Robin Murphy , Geert Uytterhoeven , Arnd Bergmann , Ard Biesheuvel , Rafael Wysocki , Suzuki Poulose , Mark Rutland , linux-clk , Linux ARM , LKML Subject: Re: [RESEND RFC PATCH v3] clk: Use new helper in managed functions Message-ID: <20200220112700.GJ3374196@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org On Thu, Feb 20, 2020 at 11:04:58AM +0100, Marc Gonzalez wrote: > Introduce devm_add() to wrap devres_alloc() / devres_add() calls. > > Using that helper produces simpler code, and smaller object size. > E.g. with gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu: > > text data bss dec hex filename > - 1708 80 0 1788 6fc drivers/clk/clk-devres.o > + 1524 80 0 1604 644 drivers/clk/clk-devres.o > > Signed-off-by: Marc Gonzalez > --- > Differences from v2 to v3 > x Make devm_add() return an error-code rather than the raw data pointer > (in case devres_alloc ever returns an ERR_PTR) as suggested by Geert > x Provide a variadic version devm_vadd() to work with structs as suggested > by Geert > x Don't use nested ifs in clk_devm* implementations (hopefully simpler > code logic to follow) as suggested by Geert > > Questions: > x This patch might need to be split in two? (Introduce the new API, then use it) > x Convert other subsystems to show the value of this proposal? > x Maybe comment the API usage somewhere > --- > drivers/base/devres.c | 15 ++++++ > drivers/clk/clk-devres.c | 99 ++++++++++++++-------------------------- > include/linux/device.h | 3 ++ > 3 files changed, 53 insertions(+), 64 deletions(-) > > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > index 0bbb328bd17f..b2603789755b 100644 > --- a/drivers/base/devres.c > +++ b/drivers/base/devres.c > @@ -685,6 +685,21 @@ int devres_release_group(struct device *dev, void *id) > } > EXPORT_SYMBOL_GPL(devres_release_group); > > +int devm_add(struct device *dev, dr_release_t func, void *arg, size_t size) Please add a bunch of kerneldoc here, as I have no idea what this function does just by looking at the name of it :( thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE533C11D04 for ; Thu, 20 Feb 2020 11:27:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B52ED2465D for ; Thu, 20 Feb 2020 11:27:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EVktEJWp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="oE+5vMyS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B52ED2465D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kMZQrpn6a0fxVsEdpTOzEfJlFcmB9jEjz5j/tEUCRMw=; b=EVktEJWp5PSN6f DceS2F5Q+qqQqlkvP89PxsmhGrYOdrXji7nHlUdml+1J42x3tXtKi8jmk5kOBvgUObC5rKSdqbMj8 GlIFzIJ3ph9lz93RR5WW3+M0GdFuorCbouav/KK8BVrJVSTmABYrfBHdhy8MTn11GlRnEUgf5PP8H OtoOm+QSBW7lUuS89rcV8hEoyLxciW+2PUk9JQhkQfepR6zYvdL7BH21lNDu7Y4llEVh/bhhczCsk YnpqOUeqnAEODlLmvYsi/GBDAmQqXuWJyRHraXZdpBYLjgcd3eSWGNLp67DDtg+hZOPgShp+fmFz9 GhMg3/Cqnqh9kBbPhrWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4jz0-0005Ao-Uw; Thu, 20 Feb 2020 11:27:06 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4jyx-0005AM-I4 for linux-arm-kernel@lists.infradead.org; Thu, 20 Feb 2020 11:27:04 +0000 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 562672071E; Thu, 20 Feb 2020 11:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582198022; bh=CEk8idDaWnhSZHqSnOYyFDbQj7mAiD4KIa+YtxoO+74=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oE+5vMySvi9PlHim4VNQTDn1Xdu7+jIng8by5DrKHwUmBtzXw/q+D0OuuFw31GjU4 yHpVgEeeT6CivTYmiMgnaDHlu3RUlPRKIhCtsoiuGP3u+Ue25jjAbYnbS4K/6wxndy y8gXHMTIT/7Tpmh5Whdg6Z7BHDpWfN4N9ktjeA3g= Date: Thu, 20 Feb 2020 12:27:00 +0100 From: Greg Kroah-Hartman To: Marc Gonzalez Subject: Re: [RESEND RFC PATCH v3] clk: Use new helper in managed functions Message-ID: <20200220112700.GJ3374196@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200220_032703_621662_B3EDE847 X-CRM114-Status: GOOD ( 16.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-clk , LKML , Arnd Bergmann , Kuninori Morimoto , Ard Biesheuvel , Stephen Boyd , Suzuki Poulose , Michael Turquette , Dmitry Torokhov , Rafael Wysocki , Russell King , Bjorn Andersson , Geert Uytterhoeven , Linux ARM , Robin Murphy , Sudip Mukherjee , Guenter Roeck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 20, 2020 at 11:04:58AM +0100, Marc Gonzalez wrote: > Introduce devm_add() to wrap devres_alloc() / devres_add() calls. > > Using that helper produces simpler code, and smaller object size. > E.g. with gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu: > > text data bss dec hex filename > - 1708 80 0 1788 6fc drivers/clk/clk-devres.o > + 1524 80 0 1604 644 drivers/clk/clk-devres.o > > Signed-off-by: Marc Gonzalez > --- > Differences from v2 to v3 > x Make devm_add() return an error-code rather than the raw data pointer > (in case devres_alloc ever returns an ERR_PTR) as suggested by Geert > x Provide a variadic version devm_vadd() to work with structs as suggested > by Geert > x Don't use nested ifs in clk_devm* implementations (hopefully simpler > code logic to follow) as suggested by Geert > > Questions: > x This patch might need to be split in two? (Introduce the new API, then use it) > x Convert other subsystems to show the value of this proposal? > x Maybe comment the API usage somewhere > --- > drivers/base/devres.c | 15 ++++++ > drivers/clk/clk-devres.c | 99 ++++++++++++++-------------------------- > include/linux/device.h | 3 ++ > 3 files changed, 53 insertions(+), 64 deletions(-) > > diff --git a/drivers/base/devres.c b/drivers/base/devres.c > index 0bbb328bd17f..b2603789755b 100644 > --- a/drivers/base/devres.c > +++ b/drivers/base/devres.c > @@ -685,6 +685,21 @@ int devres_release_group(struct device *dev, void *id) > } > EXPORT_SYMBOL_GPL(devres_release_group); > > +int devm_add(struct device *dev, dr_release_t func, void *arg, size_t size) Please add a bunch of kerneldoc here, as I have no idea what this function does just by looking at the name of it :( thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel