Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1586717 > unrolled thread
| Started by | Chen-Yu Tsai <wens@csie.org> |
|---|---|
| First post | 2017-02-23 09:20 +0100 |
| Last post | 2017-02-23 19:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 03/11] drm/sun4i: Add end of list element for sun4i_layers_init's returned list Chen-Yu Tsai <wens@csie.org> - 2017-02-23 09:20 +0100
Re: [PATCH 03/11] drm/sun4i: Add end of list element for sun4i_layers_init's returned list Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-23 19:30 +0100
| From | Chen-Yu Tsai <wens@csie.org> |
|---|---|
| Date | 2017-02-23 09:20 +0100 |
| Subject | [PATCH 03/11] drm/sun4i: Add end of list element for sun4i_layers_init's returned list |
| Message-ID | <tdWN4-731-27@gated-at.bofh.it> |
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. Signed-off-by: Chen-Yu Tsai <wens@csie.org> --- drivers/gpu/drm/sun4i/sun4i_layer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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_device *drm) struct sun4i_layer **layers; int i; - layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes), + layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes) + 1, sizeof(*layers), GFP_KERNEL); if (!layers) return ERR_PTR(-ENOMEM); -- 2.11.0
[toc] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2017-02-23 19:30 +0100 |
| Subject | Re: [PATCH 03/11] drm/sun4i: Add end of list element for sun4i_layers_init's returned list |
| Message-ID | <te6jo-4Yu-5@gated-at.bofh.it> |
| In reply to | #1586717 |
[Multipart message — attachments visible in raw view] — view raw
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. > > Signed-off-by: Chen-Yu Tsai <wens@csie.org> 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(-) > > 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_device *drm) > struct sun4i_layer **layers; > int i; > > - layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes), > + layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes) + 1, > sizeof(*layers), GFP_KERNEL); > if (!layers) > return ERR_PTR(-ENOMEM); > -- > 2.11.0 > -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web