All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libgpiod] bindings: python: fix incorrect object size
@ 2020-10-06 17:16 Jiri Benc
  2020-10-09  7:47 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Benc @ 2020-10-06 17:16 UTC (permalink / raw)
  To: linux-gpio

tp_basicsize is the size of the allocated object, not of the class.

Fixes: 96c524c4951c ("bindings: implement python bindings")
Signed-off-by: Jiri Benc <jbenc@upir.cz>
---
 bindings/python/gpiodmodule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings/python/gpiodmodule.c b/bindings/python/gpiodmodule.c
index e5db26b88954..b3ae2bfebb8a 100644
--- a/bindings/python/gpiodmodule.c
+++ b/bindings/python/gpiodmodule.c
@@ -1874,7 +1874,7 @@ PyDoc_STRVAR(gpiod_LineBulkType_doc,
 static PyTypeObject gpiod_LineBulkType = {
 	PyVarObject_HEAD_INIT(NULL, 0)
 	.tp_name = "gpiod.LineBulk",
-	.tp_basicsize = sizeof(gpiod_LineBulkType),
+	.tp_basicsize = sizeof(gpiod_LineBulkObject),
 	.tp_flags = Py_TPFLAGS_DEFAULT,
 	.tp_doc = gpiod_LineBulkType_doc,
 	.tp_new = PyType_GenericNew,
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH libgpiod] bindings: python: fix incorrect object size
  2020-10-06 17:16 [PATCH libgpiod] bindings: python: fix incorrect object size Jiri Benc
@ 2020-10-09  7:47 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2020-10-09  7:47 UTC (permalink / raw)
  To: Jiri Benc; +Cc: open list:GPIO SUBSYSTEM

On Tue, Oct 6, 2020 at 7:21 PM Jiri Benc <jbenc@upir.cz> wrote:
>
> tp_basicsize is the size of the allocated object, not of the class.
>
> Fixes: 96c524c4951c ("bindings: implement python bindings")
> Signed-off-by: Jiri Benc <jbenc@upir.cz>
> ---
>  bindings/python/gpiodmodule.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bindings/python/gpiodmodule.c b/bindings/python/gpiodmodule.c
> index e5db26b88954..b3ae2bfebb8a 100644
> --- a/bindings/python/gpiodmodule.c
> +++ b/bindings/python/gpiodmodule.c
> @@ -1874,7 +1874,7 @@ PyDoc_STRVAR(gpiod_LineBulkType_doc,
>  static PyTypeObject gpiod_LineBulkType = {
>         PyVarObject_HEAD_INIT(NULL, 0)
>         .tp_name = "gpiod.LineBulk",
> -       .tp_basicsize = sizeof(gpiod_LineBulkType),
> +       .tp_basicsize = sizeof(gpiod_LineBulkObject),
>         .tp_flags = Py_TPFLAGS_DEFAULT,
>         .tp_doc = gpiod_LineBulkType_doc,
>         .tp_new = PyType_GenericNew,
> --
> 2.18.1
>

Applied to master and backported to v1.6.x and v1.4.x, thanks!

Bartosz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-09  7:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 17:16 [PATCH libgpiod] bindings: python: fix incorrect object size Jiri Benc
2020-10-09  7:47 ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.