@@ -101,7 +101,6 @@ int _ethtool_etherinfo_init(etherinfo_py *self, PyObject *args, PyObject *kwds)
101101 */
102102PyObject * _ethtool_etherinfo_getter (etherinfo_py * self , PyObject * attr_o )
103103{
104- PyObject * ret ;
105104 char * attr = PyString_AsString (attr_o );
106105
107106 if ( !self || !self -> data ) {
@@ -110,24 +109,22 @@ PyObject *_ethtool_etherinfo_getter(etherinfo_py *self, PyObject *attr_o)
110109 }
111110
112111 if ( strcmp (attr , "device" ) == 0 ) {
113- ret = RETURN_STRING (self -> data -> ethinfo -> device );
112+ return RETURN_STRING (self -> data -> ethinfo -> device );
114113 } else if ( strcmp (attr , "mac_address" ) == 0 ) {
115114 get_etherinfo (self -> data , NLQRY_LINK );
116- ret = RETURN_STRING (self -> data -> ethinfo -> hwaddress );
115+ return RETURN_STRING (self -> data -> ethinfo -> hwaddress );
117116 } else if ( strcmp (attr , "ipv4_address" ) == 0 ) {
118117 get_etherinfo (self -> data , NLQRY_ADDR );
119- ret = RETURN_STRING (self -> data -> ethinfo -> ipv4_address );
118+ return RETURN_STRING (self -> data -> ethinfo -> ipv4_address );
120119 } else if ( strcmp (attr , "ipv4_netmask" ) == 0 ) {
121120 get_etherinfo (self -> data , NLQRY_ADDR );
122- ret = PyInt_FromLong (self -> data -> ethinfo -> ipv4_netmask );
121+ return PyInt_FromLong (self -> data -> ethinfo -> ipv4_netmask );
123122 } else if ( strcmp (attr , "ipv4_broadcast" ) == 0 ) {
124123 get_etherinfo (self -> data , NLQRY_ADDR );
125- ret = RETURN_STRING (self -> data -> ethinfo -> ipv4_broadcast );
124+ return RETURN_STRING (self -> data -> ethinfo -> ipv4_broadcast );
126125 } else {
127- ret = PyObject_GenericGetAttr ((PyObject * )self , attr_o );
126+ return PyObject_GenericGetAttr ((PyObject * )self , attr_o );
128127 }
129-
130- return ret ;
131128}
132129
133130/**
0 commit comments