From 44838a858671264cfb2085a3b1dbe6e01ca48feb Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Mon, 16 Dec 2013 12:26:24 +0100 Subject: Get rid of a single-user macro: RETURN_STRING() Signed-off-by: David Sommerseth --- python-ethtool/etherinfo_obj.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python-ethtool/etherinfo_obj.c') diff --git a/python-ethtool/etherinfo_obj.c b/python-ethtool/etherinfo_obj.c index 6acc571..56d88e7 100644 --- a/python-ethtool/etherinfo_obj.c +++ b/python-ethtool/etherinfo_obj.c @@ -145,7 +145,11 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o) } if( strcmp(attr, "device") == 0 ) { - return RETURN_STRING(self->data->ethinfo->device); + if( self->data->ethinfo->device ) { + return PyString_FromString(self->data->ethinfo->device); + } else { + return Py_INCREF(Py_None), Py_None; + } } else if( strcmp(attr, "mac_address") == 0 ) { get_etherinfo(self->data, NLQRY_LINK); Py_INCREF(self->data->ethinfo->hwaddress); -- cgit