1
0
mirror of https://github.com/systemd/systemd.git synced 2025-09-16 17:45:36 +03:00

libudev-device: coding style fixes

This commit is contained in:
Yu Watanabe
2018-08-24 14:32:05 +09:00
parent 33a03e6eff
commit 76387b9abb

View File

@@ -45,8 +45,7 @@
* *
* Returns: the kernel event sequence number, or 0 if there is no sequence number available. * Returns: the kernel event sequence number, or 0 if there is no sequence number available.
**/ **/
_public_ unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device) _public_ unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device) {
{
const char *seqnum; const char *seqnum;
unsigned long long ret; unsigned long long ret;
int r; int r;
@@ -78,8 +77,7 @@ _public_ unsigned long long int udev_device_get_seqnum(struct udev_device *udev_
* *
* Returns: the dev_t number. * Returns: the dev_t number.
**/ **/
_public_ dev_t udev_device_get_devnum(struct udev_device *udev_device) _public_ dev_t udev_device_get_devnum(struct udev_device *udev_device) {
{
dev_t devnum; dev_t devnum;
int r; int r;
@@ -102,8 +100,7 @@ _public_ dev_t udev_device_get_devnum(struct udev_device *udev_device)
* *
* Returns: the driver name string, or #NULL if there is no driver attached. * Returns: the driver name string, or #NULL if there is no driver attached.
**/ **/
_public_ const char *udev_device_get_driver(struct udev_device *udev_device) _public_ const char *udev_device_get_driver(struct udev_device *udev_device) {
{
const char *driver; const char *driver;
int r; int r;
@@ -126,8 +123,7 @@ _public_ const char *udev_device_get_driver(struct udev_device *udev_device)
* *
* Returns: the devtype name of the udev device, or #NULL if it cannot be determined * Returns: the devtype name of the udev device, or #NULL if it cannot be determined
**/ **/
_public_ const char *udev_device_get_devtype(struct udev_device *udev_device) _public_ const char *udev_device_get_devtype(struct udev_device *udev_device) {
{
const char *devtype; const char *devtype;
int r; int r;
@@ -151,8 +147,7 @@ _public_ const char *udev_device_get_devtype(struct udev_device *udev_device)
* *
* Returns: the subsystem name of the udev device, or #NULL if it cannot be determined * Returns: the subsystem name of the udev device, or #NULL if it cannot be determined
**/ **/
_public_ const char *udev_device_get_subsystem(struct udev_device *udev_device) _public_ const char *udev_device_get_subsystem(struct udev_device *udev_device) {
{
const char *subsystem; const char *subsystem;
int r; int r;
@@ -177,8 +172,7 @@ _public_ const char *udev_device_get_subsystem(struct udev_device *udev_device)
* *
* Returns: the property string, or #NULL if there is no such property. * Returns: the property string, or #NULL if there is no such property.
**/ **/
_public_ const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key) _public_ const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key) {
{
const char *value = NULL; const char *value = NULL;
int r; int r;
@@ -263,8 +257,7 @@ _public_ struct udev_device *udev_device_new_from_syspath(struct udev *udev, con
* *
* Returns: a new udev device, or #NULL, if it does not exist * Returns: a new udev device, or #NULL, if it does not exist
**/ **/
_public_ struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum) _public_ struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum) {
{
struct udev_device *udev_device; struct udev_device *udev_device;
int r; int r;
@@ -300,8 +293,7 @@ _public_ struct udev_device *udev_device_new_from_devnum(struct udev *udev, char
* *
* Returns: a new udev device, or #NULL, if it does not exist * Returns: a new udev device, or #NULL, if it does not exist
**/ **/
_public_ struct udev_device *udev_device_new_from_device_id(struct udev *udev, const char *id) _public_ struct udev_device *udev_device_new_from_device_id(struct udev *udev, const char *id) {
{
struct udev_device *udev_device; struct udev_device *udev_device;
int r; int r;
@@ -334,8 +326,7 @@ _public_ struct udev_device *udev_device_new_from_device_id(struct udev *udev, c
* *
* Returns: a new udev device, or #NULL, if it does not exist * Returns: a new udev device, or #NULL, if it does not exist
**/ **/
_public_ struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname) _public_ struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname) {
{
struct udev_device *udev_device; struct udev_device *udev_device;
int r; int r;
@@ -367,8 +358,7 @@ _public_ struct udev_device *udev_device_new_from_subsystem_sysname(struct udev
* *
* Returns: a new udev device, or #NULL, if it does not exist * Returns: a new udev device, or #NULL, if it does not exist
**/ **/
_public_ struct udev_device *udev_device_new_from_environment(struct udev *udev) _public_ struct udev_device *udev_device_new_from_environment(struct udev *udev) {
{
struct udev_device *udev_device; struct udev_device *udev_device;
int r; int r;
@@ -386,8 +376,7 @@ _public_ struct udev_device *udev_device_new_from_environment(struct udev *udev)
return udev_device; return udev_device;
} }
static struct udev_device *device_new_from_parent(struct udev_device *child) static struct udev_device *device_new_from_parent(struct udev_device *child) {
{
struct udev_device *parent; struct udev_device *parent;
int r; int r;
@@ -428,8 +417,7 @@ static struct udev_device *device_new_from_parent(struct udev_device *child)
* *
* Returns: a new udev device, or #NULL, if it no parent exist. * Returns: a new udev device, or #NULL, if it no parent exist.
**/ **/
_public_ struct udev_device *udev_device_get_parent(struct udev_device *udev_device) _public_ struct udev_device *udev_device_get_parent(struct udev_device *udev_device) {
{
assert_return_errno(udev_device, NULL, EINVAL); assert_return_errno(udev_device, NULL, EINVAL);
if (!udev_device->parent_set) { if (!udev_device->parent_set) {
@@ -462,8 +450,7 @@ _public_ struct udev_device *udev_device_get_parent(struct udev_device *udev_dev
* *
* Returns: a new udev device, or #NULL if no matching parent exists. * Returns: a new udev device, or #NULL if no matching parent exists.
**/ **/
_public_ struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype) _public_ struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype) {
{
sd_device *parent; sd_device *parent;
int r; int r;
@@ -498,8 +485,7 @@ _public_ struct udev_device *udev_device_get_parent_with_subsystem_devtype(struc
* *
* Returns: the udev library context * Returns: the udev library context
**/ **/
_public_ struct udev *udev_device_get_udev(struct udev_device *udev_device) _public_ struct udev *udev_device_get_udev(struct udev_device *udev_device) {
{
assert_return_errno(udev_device, NULL, EINVAL); assert_return_errno(udev_device, NULL, EINVAL);
return udev_device->udev; return udev_device->udev;
@@ -548,8 +534,7 @@ DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC(struct udev_device, udev_device, udev_devic
* *
* Returns: the devpath of the udev device * Returns: the devpath of the udev device
**/ **/
_public_ const char *udev_device_get_devpath(struct udev_device *udev_device) _public_ const char *udev_device_get_devpath(struct udev_device *udev_device) {
{
const char *devpath; const char *devpath;
int r; int r;
@@ -573,8 +558,7 @@ _public_ const char *udev_device_get_devpath(struct udev_device *udev_device)
* *
* Returns: the sys path of the udev device * Returns: the sys path of the udev device
**/ **/
_public_ const char *udev_device_get_syspath(struct udev_device *udev_device) _public_ const char *udev_device_get_syspath(struct udev_device *udev_device) {
{
const char *syspath; const char *syspath;
int r; int r;
@@ -597,8 +581,7 @@ _public_ const char *udev_device_get_syspath(struct udev_device *udev_device)
* *
* Returns: the name string of the device * Returns: the name string of the device
**/ **/
_public_ const char *udev_device_get_sysname(struct udev_device *udev_device) _public_ const char *udev_device_get_sysname(struct udev_device *udev_device) {
{
const char *sysname; const char *sysname;
int r; int r;
@@ -621,8 +604,7 @@ _public_ const char *udev_device_get_sysname(struct udev_device *udev_device)
* *
* Returns: the trailing number string of the device name * Returns: the trailing number string of the device name
**/ **/
_public_ const char *udev_device_get_sysnum(struct udev_device *udev_device) _public_ const char *udev_device_get_sysnum(struct udev_device *udev_device) {
{
const char *sysnum; const char *sysnum;
int r; int r;
@@ -646,8 +628,7 @@ _public_ const char *udev_device_get_sysnum(struct udev_device *udev_device)
* *
* Returns: the device node file name of the udev device, or #NULL if no device node exists * Returns: the device node file name of the udev device, or #NULL if no device node exists
**/ **/
_public_ const char *udev_device_get_devnode(struct udev_device *udev_device) _public_ const char *udev_device_get_devnode(struct udev_device *udev_device) {
{
const char *devnode; const char *devnode;
int r; int r;
@@ -675,8 +656,7 @@ _public_ const char *udev_device_get_devnode(struct udev_device *udev_device)
* *
* Returns: the first entry of the device node link list * Returns: the first entry of the device node link list
**/ **/
_public_ struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device) _public_ struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device) {
{
assert_return_errno(udev_device, NULL, EINVAL); assert_return_errno(udev_device, NULL, EINVAL);
if (device_get_devlinks_generation(udev_device->device) != udev_device->devlinks_generation || if (device_get_devlinks_generation(udev_device->device) != udev_device->devlinks_generation ||
@@ -707,8 +687,7 @@ _public_ struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev
* *
* Returns: the first entry of the property list * Returns: the first entry of the property list
**/ **/
_public_ struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device) _public_ struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device) {
{
assert_return_errno(udev_device, NULL, EINVAL); assert_return_errno(udev_device, NULL, EINVAL);
if (device_get_properties_generation(udev_device->device) != udev_device->properties_generation || if (device_get_properties_generation(udev_device->device) != udev_device->properties_generation ||
@@ -764,8 +743,7 @@ _public_ const char *udev_device_get_action(struct udev_device *udev_device) {
* *
* Returns: the number of microseconds since the device was first seen. * Returns: the number of microseconds since the device was first seen.
**/ **/
_public_ unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device) _public_ unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device) {
{
usec_t ts; usec_t ts;
int r; int r;
@@ -790,8 +768,7 @@ _public_ unsigned long long int udev_device_get_usec_since_initialized(struct ud
* *
* Returns: the content of a sys attribute file, or #NULL if there is no sys attribute value. * Returns: the content of a sys attribute file, or #NULL if there is no sys attribute value.
**/ **/
_public_ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr) _public_ const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr) {
{
const char *value; const char *value;
int r; int r;
@@ -816,8 +793,7 @@ _public_ const char *udev_device_get_sysattr_value(struct udev_device *udev_devi
* *
* Returns: Negative error code on failure or 0 on success. * Returns: Negative error code on failure or 0 on success.
**/ **/
_public_ int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, char *value) _public_ int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, char *value) {
{
int r; int r;
assert_return(udev_device, -EINVAL); assert_return(udev_device, -EINVAL);
@@ -839,8 +815,7 @@ _public_ int udev_device_set_sysattr_value(struct udev_device *udev_device, cons
* *
* Returns: the first entry of the property list * Returns: the first entry of the property list
**/ **/
_public_ struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device) _public_ struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device) {
{
assert_return_errno(udev_device, NULL, EINVAL); assert_return_errno(udev_device, NULL, EINVAL);
if (!udev_device->sysattrs_read) { if (!udev_device->sysattrs_read) {
@@ -870,8 +845,7 @@ _public_ struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_
* *
* Returns: 1 if the device is set up. 0 otherwise. * Returns: 1 if the device is set up. 0 otherwise.
**/ **/
_public_ int udev_device_get_is_initialized(struct udev_device *udev_device) _public_ int udev_device_get_is_initialized(struct udev_device *udev_device) {
{
int r, initialized; int r, initialized;
assert_return(udev_device, -EINVAL); assert_return(udev_device, -EINVAL);
@@ -879,7 +853,6 @@ _public_ int udev_device_get_is_initialized(struct udev_device *udev_device)
r = sd_device_get_is_initialized(udev_device->device, &initialized); r = sd_device_get_is_initialized(udev_device->device, &initialized);
if (r < 0) { if (r < 0) {
errno = -r; errno = -r;
return 0; return 0;
} }
@@ -897,8 +870,7 @@ _public_ int udev_device_get_is_initialized(struct udev_device *udev_device)
* *
* Returns: the first entry of the tag list * Returns: the first entry of the tag list
**/ **/
_public_ struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device) _public_ struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device) {
{
assert_return_errno(udev_device, NULL, EINVAL); assert_return_errno(udev_device, NULL, EINVAL);
if (device_get_tags_generation(udev_device->device) != udev_device->tags_generation || if (device_get_tags_generation(udev_device->device) != udev_device->tags_generation ||