Skip to content

Commit

Permalink
Minor coding style improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeDP committed Aug 28, 2018
1 parent 68ae69c commit da26838
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define DDCUTIL_LOOP(func) \
const DDCA_Vcp_Feature_Code br_code = 0x10; \
DDCA_Display_Info_List *dlist = NULL; \
ddca_get_display_info_list2(0, &dlist); \
ddca_get_display_info_list2(false, &dlist); \
if (dlist) { \
for (int ndx = 0; ndx < dlist->ct; ndx++) { \
DDCA_Display_Info *dinfo = &dlist->info[ndx]; \
Expand Down
10 changes: 3 additions & 7 deletions src/udev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ static void get_first_matching_device(struct udev_device **dev, const char *subs
* Set dev to first device in subsystem
*/
static void get_first_matching_device(struct udev_device **dev, const char *subsystem) {
struct udev_enumerate *enumerate;
struct udev_list_entry *devices;

enumerate = udev_enumerate_new(udev);
struct udev_enumerate *enumerate = udev_enumerate_new(udev);
udev_enumerate_add_match_subsystem(enumerate, subsystem);
udev_enumerate_scan_devices(enumerate);
devices = udev_enumerate_get_list_entry(enumerate);
struct udev_list_entry *devices = udev_enumerate_get_list_entry(enumerate);
if (devices) {
const char *path;
path = udev_list_entry_get_name(devices);
const char *path = udev_list_entry_get_name(devices);
*dev = udev_device_new_from_syspath(udev, path);
}
/* Free the enumerator object */
Expand Down

0 comments on commit da26838

Please sign in to comment.