]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/netif-sriov.c
tree-wide: use ASSERT_PTR more
[thirdparty/systemd.git] / src / shared / netif-sriov.c
index 18e5f0eeb7a3859f9c7d3e02f792961aec94a8a4..7559b0d00cea7030dca345d5055e42f65df3ab81 100644 (file)
@@ -359,14 +359,13 @@ int config_parse_sr_iov_uint32(
                 void *userdata) {
 
         _cleanup_(sr_iov_free_or_set_invalidp) SRIOV *sr_iov = NULL;
-        OrderedHashmap **sr_iov_by_section = data;
+        OrderedHashmap **sr_iov_by_section = ASSERT_PTR(data);
         uint32_t k;
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
-        assert(data);
 
         r = sr_iov_new_static(sr_iov_by_section, filename, section_line, &sr_iov);
         if (r < 0)
@@ -427,13 +426,12 @@ int config_parse_sr_iov_vlan_proto(
                 void *userdata) {
 
         _cleanup_(sr_iov_free_or_set_invalidp) SRIOV *sr_iov = NULL;
-        OrderedHashmap **sr_iov_by_section = data;
+        OrderedHashmap **sr_iov_by_section = ASSERT_PTR(data);
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
-        assert(data);
 
         r = sr_iov_new_static(sr_iov_by_section, filename, section_line, &sr_iov);
         if (r < 0)
@@ -466,13 +464,12 @@ int config_parse_sr_iov_link_state(
                 void *userdata) {
 
         _cleanup_(sr_iov_free_or_set_invalidp) SRIOV *sr_iov = NULL;
-        OrderedHashmap **sr_iov_by_section = data;
+        OrderedHashmap **sr_iov_by_section = ASSERT_PTR(data);
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
-        assert(data);
 
         r = sr_iov_new_static(sr_iov_by_section, filename, section_line, &sr_iov);
         if (r < 0)
@@ -518,13 +515,12 @@ int config_parse_sr_iov_boolean(
                 void *userdata) {
 
         _cleanup_(sr_iov_free_or_set_invalidp) SRIOV *sr_iov = NULL;
-        OrderedHashmap **sr_iov_by_section = data;
+        OrderedHashmap **sr_iov_by_section = ASSERT_PTR(data);
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
-        assert(data);
 
         r = sr_iov_new_static(sr_iov_by_section, filename, section_line, &sr_iov);
         if (r < 0)
@@ -576,13 +572,12 @@ int config_parse_sr_iov_mac(
                 void *userdata) {
 
         _cleanup_(sr_iov_free_or_set_invalidp) SRIOV *sr_iov = NULL;
-        OrderedHashmap **sr_iov_by_section = data;
+        OrderedHashmap **sr_iov_by_section = ASSERT_PTR(data);
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
-        assert(data);
 
         r = sr_iov_new_static(sr_iov_by_section, filename, section_line, &sr_iov);
         if (r < 0)
@@ -617,13 +612,12 @@ int config_parse_sr_iov_num_vfs(
                 void *data,
                 void *userdata) {
 
-        uint32_t n, *num_vfs = data;
+        uint32_t n, *num_vfs = ASSERT_PTR(data);
         int r;
 
         assert(filename);
         assert(lvalue);
         assert(rvalue);
-        assert(data);
 
         if (isempty(rvalue)) {
                 *num_vfs = UINT32_MAX;