@@ -572,7 +572,6 @@ _public_ int sd_device_get_ifindex(sd_device *device, int *ifindex) {
572572 int r ;
573573
574574 assert_return (device , - EINVAL );
575- assert_return (ifindex , - EINVAL );
576575
577576 r = device_read_uevent_file (device );
578577 if (r < 0 )
@@ -581,7 +580,8 @@ _public_ int sd_device_get_ifindex(sd_device *device, int *ifindex) {
581580 if (device -> ifindex <= 0 )
582581 return - ENOENT ;
583582
584- * ifindex = device -> ifindex ;
583+ if (ifindex )
584+ * ifindex = device -> ifindex ;
585585
586586 return 0 ;
587587}
@@ -889,7 +889,6 @@ _public_ int sd_device_get_devnum(sd_device *device, dev_t *devnum) {
889889 int r ;
890890
891891 assert_return (device , - EINVAL );
892- assert_return (devnum , - EINVAL );
893892
894893 r = device_read_uevent_file (device );
895894 if (r < 0 )
@@ -898,7 +897,8 @@ _public_ int sd_device_get_devnum(sd_device *device, dev_t *devnum) {
898897 if (major (device -> devnum ) <= 0 )
899898 return - ENOENT ;
900899
901- * devnum = device -> devnum ;
900+ if (devnum )
901+ * devnum = device -> devnum ;
902902
903903 return 0 ;
904904}
@@ -1374,19 +1374,16 @@ static int device_read_db(sd_device *device) {
13741374 return device_read_db_aux (device , false);
13751375}
13761376
1377- _public_ int sd_device_get_is_initialized (sd_device * device , int * initialized ) {
1377+ _public_ int sd_device_get_is_initialized (sd_device * device ) {
13781378 int r ;
13791379
13801380 assert_return (device , - EINVAL );
1381- assert_return (initialized , - EINVAL );
13821381
13831382 r = device_read_db (device );
13841383 if (r < 0 )
13851384 return r ;
13861385
1387- * initialized = device -> is_initialized ;
1388-
1389- return 0 ;
1386+ return device -> is_initialized ;
13901387}
13911388
13921389_public_ int sd_device_get_usec_since_initialized (sd_device * device , uint64_t * usec ) {
@@ -1677,7 +1674,6 @@ _public_ int sd_device_get_property_value(sd_device *device, const char *key, co
16771674
16781675 assert_return (device , - EINVAL );
16791676 assert_return (key , - EINVAL );
1680- assert_return (_value , - EINVAL );
16811677
16821678 r = device_properties_prepare (device );
16831679 if (r < 0 )
@@ -1687,7 +1683,8 @@ _public_ int sd_device_get_property_value(sd_device *device, const char *key, co
16871683 if (!value )
16881684 return - ENOENT ;
16891685
1690- * _value = value ;
1686+ if (_value )
1687+ * _value = value ;
16911688
16921689 return 0 ;
16931690}
0 commit comments