summaryrefslogtreecommitdiff
path: root/src/udev/ata_id
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-08-22 17:05:57 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-09-10 18:27:36 +0900
commit3b77b4e12f3f8372d533caf68d85982352510b92 (patch)
treeab553658349969b86503539f86503070d6c6cec5 /src/udev/ata_id
parenta168792c2d95695fd30c0371d4b3890a9df1eafb (diff)
downloadsystemd-3b77b4e12f3f8372d533caf68d85982352510b92.tar.gz
udev/ata_id: drop unused udev struct
Diffstat (limited to 'src/udev/ata_id')
-rw-r--r--src/udev/ata_id/ata_id.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
index b08588baf7..20157025e5 100644
--- a/src/udev/ata_id/ata_id.c
+++ b/src/udev/ata_id/ata_id.c
@@ -23,8 +23,6 @@
#include <sys/types.h>
#include <unistd.h>
-#include "libudev.h"
-
#include "fd-util.h"
#include "libudev-private.h"
#include "log.h"
@@ -294,7 +292,6 @@ static void disk_identify_fixup_uint16 (uint8_t identify[512], unsigned int offs
/**
* disk_identify:
- * @udev: The libudev context.
* @fd: File descriptor for the block device.
* @out_identify: Return location for IDENTIFY data.
* @out_is_packet_device: Return location for whether returned data is from a IDENTIFY PACKET DEVICE.
@@ -308,11 +305,9 @@ static void disk_identify_fixup_uint16 (uint8_t identify[512], unsigned int offs
* Returns: 0 if the data was successfully obtained, otherwise
* non-zero with errno set.
*/
-static int disk_identify(struct udev *udev,
- int fd,
+static int disk_identify(int fd,
uint8_t out_identify[512],
- int *out_is_packet_device)
-{
+ int *out_is_packet_device) {
int ret;
uint8_t inquiry_buf[36];
int peripheral_device_type;
@@ -390,7 +385,6 @@ out:
}
int main(int argc, char *argv[]) {
- _cleanup_(udev_unrefp) struct udev *udev = NULL;
struct hd_driveid id;
union {
uint8_t byte[512];
@@ -416,10 +410,6 @@ int main(int argc, char *argv[]) {
log_parse_environment();
log_open();
- udev = udev_new();
- if (udev == NULL)
- return 0;
-
for (;;) {
int option;
@@ -451,7 +441,7 @@ int main(int argc, char *argv[]) {
return 1;
}
- if (disk_identify(udev, fd, identify.byte, &is_packet_device) == 0) {
+ if (disk_identify(fd, identify.byte, &is_packet_device) == 0) {
/*
* fix up only the fields from the IDENTIFY data that we are going to
* use and copy it into the hd_driveid struct for convenience