Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylibfdt: fix get_mem_rsv for newer Python versions #128

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions pylibfdt/libfdt.i
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ class FdtRo(object):
Returns:
Number of memory reserve-map records
"""
return check_err(fdt_get_mem_rsv(self._fdt, index), quiet)
val = fdt_get_mem_rsv(self._fdt, index)
check_err(val[0], quiet)
return val[1:]

def subnode_offset(self, parentoffset, name, quiet=()):
"""Get the offset of a named subnode
Expand Down Expand Up @@ -1188,12 +1190,7 @@ typedef uint32_t fdt32_t;

%typemap(argout) uint64_t * {
PyObject *val = PyLong_FromUnsignedLongLong(*arg$argnum);
if (!result) {
if (PyTuple_GET_SIZE(resultobj) == 0)
resultobj = val;
else
resultobj = SWIG_Python_AppendOutput(resultobj, val);
}
resultobj = SWIG_Python_AppendOutput(resultobj, val);
}

%include "cstring.i"
Expand Down
Loading