Merge tag 'qcom-arm64-fixes-for-6.6' of https://git.kernel.org/pub/scm/linux/kernel...
[platform/kernel/linux-starfive.git] / block / ioprio.c
index 32a456b..b5a9425 100644 (file)
@@ -33,7 +33,7 @@
 int ioprio_check_cap(int ioprio)
 {
        int class = IOPRIO_PRIO_CLASS(ioprio);
-       int data = IOPRIO_PRIO_DATA(ioprio);
+       int level = IOPRIO_PRIO_LEVEL(ioprio);
 
        switch (class) {
                case IOPRIO_CLASS_RT:
@@ -49,15 +49,16 @@ int ioprio_check_cap(int ioprio)
                        fallthrough;
                        /* rt has prio field too */
                case IOPRIO_CLASS_BE:
-                       if (data >= IOPRIO_NR_LEVELS || data < 0)
+                       if (level >= IOPRIO_NR_LEVELS)
                                return -EINVAL;
                        break;
                case IOPRIO_CLASS_IDLE:
                        break;
                case IOPRIO_CLASS_NONE:
-                       if (data)
+                       if (level)
                                return -EINVAL;
                        break;
+               case IOPRIO_CLASS_INVALID:
                default:
                        return -EINVAL;
        }