switch device_get_devnode() and ->devnode() to umode_t *
[firefly-linux-kernel-4.4.55.git] / drivers / infiniband / core / user_mad.c
index 8d261b6ea5feaef85091726c81df2230d38e56b0..f0d588f8859ef5fd2f7679504351003ac77c2589 100644 (file)
@@ -458,8 +458,7 @@ static ssize_t ib_umad_write(struct file *filp, const char __user *buf,
                goto err;
        }
 
-       if (packet->mad.hdr.id < 0 ||
-           packet->mad.hdr.id >= IB_UMAD_MAX_AGENTS) {
+       if (packet->mad.hdr.id >= IB_UMAD_MAX_AGENTS) {
                ret = -EINVAL;
                goto err;
        }
@@ -703,7 +702,7 @@ static int ib_umad_unreg_agent(struct ib_umad_file *file, u32 __user *arg)
        mutex_lock(&file->port->file_mutex);
        mutex_lock(&file->mutex);
 
-       if (id < 0 || id >= IB_UMAD_MAX_AGENTS || !__get_agent(file, id)) {
+       if (id >= IB_UMAD_MAX_AGENTS || !__get_agent(file, id)) {
                ret = -EINVAL;
                goto out;
        }
@@ -1176,7 +1175,7 @@ static void ib_umad_remove_one(struct ib_device *device)
        kref_put(&umad_dev->ref, ib_umad_release_dev);
 }
 
-static char *umad_devnode(struct device *dev, mode_t *mode)
+static char *umad_devnode(struct device *dev, umode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
 }