From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbdBWSVt (ORCPT ); Thu, 23 Feb 2017 13:21:49 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:49475 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdBWSVs (ORCPT ); Thu, 23 Feb 2017 13:21:48 -0500 Date: Thu, 23 Feb 2017 10:21:32 -0800 From: Maxime Ripard To: Chen-Yu Tsai Cc: David Airlie , dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/11] drm/sun4i: Add end of list element for sun4i_layers_init's returned list Message-ID: <20170223182132.lziv75zybuhp7wjb@lukather> References: <20170223080543.6659-1-wens@csie.org> <20170223080543.6659-4-wens@csie.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eiwjmiop4slybbx7" Content-Disposition: inline In-Reply-To: <20170223080543.6659-4-wens@csie.org> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --eiwjmiop4slybbx7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 23, 2017 at 04:05:35PM +0800, Chen-Yu Tsai wrote: > The number of defined planes in sun4i_layer is unknown to other parts > of the sun4i drm driver. Since the return value of sun4i_layers_init > is a list of layers, make it return 1 more empty layer as an end of > list guard value. >=20 > Signed-off-by: Chen-Yu Tsai Applied. Thanks! I guess you could also add a comment about what it returns, just so it's obvious that it's a NULL terminated list of items Maxime > --- > drivers/gpu/drm/sun4i/sun4i_layer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/= sun4i_layer.c > index 41bc0f860f5c..0b703fb02656 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_layer.c > +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c > @@ -139,7 +139,7 @@ struct sun4i_layer **sun4i_layers_init(struct drm_dev= ice *drm) > struct sun4i_layer **layers; > int i; > =20 > - layers =3D devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes), > + layers =3D devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes) + 1, > sizeof(*layers), GFP_KERNEL); > if (!layers) > return ERR_PTR(-ENOMEM); > --=20 > 2.11.0 >=20 --=20 Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com --eiwjmiop4slybbx7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYrygsAAoJEBx+YmzsjxAgZY4P/ip/pDpXbXcVxqL0fqDSX7Gb k3Xx30v61bZfk79jHMbCXWsGMPG0FDSmBSjWVZM0Bd6X5+bJc/Jge4WwkE+CoyAV pGf8rmXqx3GAhNhfDwMfnHCLuQLY7ze9tYnro4VrII+Ct3j6aGzxqvf8BKRp/nlX Vule13I0ICOD6cejHsPOcg2WR0b/Zd41pG6LJcR7YL+/5bWCPevnHSx4MDH1n/c6 mcgARFHYKPWCoCtVek4IkC4FeieBCCfA/TBtHKzJkd66kcJK1uuxRvNQjMBnsa3X TNTNOHht4Yk3VSE+cOz/vAceJdCAyPal4gytMzA0kSIAoop3ah0N2RcqD92LVX0B 7rKbi/4pfUJudscKq+yt23KTkPezi2Bw/OpLF6DZlTPCFGL7ZHAZ8QWt4aVDQ0BX KXW/AwaHd3uPXuX8H71fZ1LikSLLMr19RxmSJF9UB8eDIoL3fnI29UDhpDGv6pky w8WDRzcBhoTxG8zXfIQkg5LZ7MS8VYUiqq8t3hHwjg8+UnNSkKyVFd74G9aJy/Gn ZWdGuN5v1VwjTXg4Qvok/m6hf/9K0B2zI7+YTgBNWnx+sCL7sxhL+E1BcbTUO2Uh cgwFpOyzBb/2JmolFuK9wJ5z9Cu562XwSDlEMaa3H737X3l/k0ALqmKOx5bNSomC agAxUZdaM6/LGxeRrcN3 =km1N -----END PGP SIGNATURE----- --eiwjmiop4slybbx7--