[S390] Replace ENOTSUPP usage with EOPNOTSUPP
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 26 Feb 2010 21:37:41 +0000 (22:37 +0100)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Fri, 26 Feb 2010 21:37:31 +0000 (22:37 +0100)
ENOTSUPP is not supposed to leak to userspace so lets just use
EOPNOTSUPP everywhere.
Doesn't fix a bug, but makes future reviews easier.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/hypfs/hypfs_diag.c
arch/s390/kernel/ipl.c
arch/s390/kvm/diag.c
arch/s390/kvm/intercept.c
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/priv.c
arch/s390/kvm/sigp.c
arch/s390/mm/extmem.c

index 2b92d501425f20262c0f38e5c34f4634634732db..87cf523192e98527d85b00c7ee646b79b00b74d5 100644 (file)
@@ -488,7 +488,7 @@ out:
 
 static int diag224(void *ptr)
 {
-       int rc = -ENOTSUPP;
+       int rc = -EOPNOTSUPP;
 
        asm volatile(
                "       diag    %1,%2,0x224\n"
@@ -507,7 +507,7 @@ static int diag224_get_name_table(void)
                return -ENOMEM;
        if (diag224(diag224_cpu_names)) {
                kfree(diag224_cpu_names);
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        }
        EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
        return 0;
index ae9c564e375df09030082c9456c9e8f60f691232..998bde3ec5ea7b242c297c22e084dea4a8114996 100644 (file)
@@ -1592,7 +1592,7 @@ static void vmcmd_run(struct shutdown_trigger *trigger)
 static int vmcmd_init(void)
 {
        if (!MACHINE_IS_VM)
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        vmcmd_kset = kset_create_and_add("vmcmd", NULL, firmware_kobj);
        if (!vmcmd_kset)
                return -ENOMEM;
index 8300309698fa3abce3b9b84a5884aba432c372fe..9e4c84187cf504fc0fdffed9afb80ce3a393b05a 100644 (file)
@@ -39,7 +39,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
                vcpu->run->s390_reset_flags = 0;
                break;
        default:
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        }
 
        atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
@@ -62,6 +62,6 @@ int kvm_s390_handle_diag(struct kvm_vcpu *vcpu)
        case 0x308:
                return __diag_ipl_functions(vcpu);
        default:
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        }
 }
index b40096494e469f6018146b517c54b7c5228ad7b1..3ddc30895e31f8bb9a3d87ff40fd357c671edb21 100644 (file)
@@ -32,7 +32,7 @@ static int handle_lctlg(struct kvm_vcpu *vcpu)
 
        vcpu->stat.instruction_lctlg++;
        if ((vcpu->arch.sie_block->ipb & 0xff) != 0x2f)
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
 
        useraddr = disp2;
        if (base2)
@@ -138,7 +138,7 @@ static int handle_stop(struct kvm_vcpu *vcpu)
                rc = __kvm_s390_vcpu_store_status(vcpu,
                                                  KVM_S390_STORE_STATUS_NOADDR);
                if (rc >= 0)
-                       rc = -ENOTSUPP;
+                       rc = -EOPNOTSUPP;
        }
 
        if (vcpu->arch.local_int.action_bits & ACTION_RELOADVCPU_ON_STOP) {
@@ -150,7 +150,7 @@ static int handle_stop(struct kvm_vcpu *vcpu)
        if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) {
                vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP;
                VCPU_EVENT(vcpu, 3, "%s", "cpu stopped");
-               rc = -ENOTSUPP;
+               rc = -EOPNOTSUPP;
        }
 
        spin_unlock_bh(&vcpu->arch.local_int.lock);
@@ -171,9 +171,9 @@ static int handle_validity(struct kvm_vcpu *vcpu)
                         2*PAGE_SIZE);
                if (rc)
                        /* user will receive sigsegv, exit to user */
-                       rc = -ENOTSUPP;
+                       rc = -EOPNOTSUPP;
        } else
-               rc = -ENOTSUPP;
+               rc = -EOPNOTSUPP;
 
        if (rc)
                VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d",
@@ -189,7 +189,7 @@ static int handle_instruction(struct kvm_vcpu *vcpu)
        handler = instruction_handlers[vcpu->arch.sie_block->ipa >> 8];
        if (handler)
                return handler(vcpu);
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
 
 static int handle_prog(struct kvm_vcpu *vcpu)
@@ -206,7 +206,7 @@ static int handle_instruction_and_prog(struct kvm_vcpu *vcpu)
        rc = handle_instruction(vcpu);
        rc2 = handle_prog(vcpu);
 
-       if (rc == -ENOTSUPP)
+       if (rc == -EOPNOTSUPP)
                vcpu->arch.sie_block->icptcode = 0x04;
        if (rc)
                return rc;
@@ -231,9 +231,9 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
        u8 code = vcpu->arch.sie_block->icptcode;
 
        if (code & 3 || (code >> 2) >= ARRAY_SIZE(intercept_funcs))
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        func = intercept_funcs[code >> 2];
        if (func)
                return func(vcpu);
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
index 43486c2408e1c571c1b933d1105f23dd06e2e2db..da20c3df3ec12fb14ea6bc7d60803dd9e9d3849e 100644 (file)
@@ -342,7 +342,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
        if (psw_interrupts_disabled(vcpu)) {
                VCPU_EVENT(vcpu, 3, "%s", "disabled wait");
                __unset_cpu_idle(vcpu);
-               return -ENOTSUPP; /* disabled wait */
+               return -EOPNOTSUPP; /* disabled wait */
        }
 
        if (psw_extint_disabled(vcpu) ||
index 70e799eefec938a5f4eb67fa7d89616d74b4f0ca..7f19340481b74c5763825f60d22473ad9ba7b072 100644 (file)
@@ -543,7 +543,7 @@ rerun_vcpu:
                rc = -EINTR;
        }
 
-       if (rc == -ENOTSUPP) {
+       if (rc == -EOPNOTSUPP) {
                /* intercept cannot be handled in-kernel, prepare kvm-run */
                kvm_run->exit_reason         = KVM_EXIT_S390_SIEIC;
                kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode;
index d426aac8095de3552177158bc88fa72e1ef9a82e..28c55677eb399c33f472a564d596666f01bcedd3 100644 (file)
@@ -323,5 +323,5 @@ int kvm_s390_handle_b2(struct kvm_vcpu *vcpu)
                else
                        return handler(vcpu);
        }
-       return -ENOTSUPP;
+       return -EOPNOTSUPP;
 }
index 15ee1111de58facc30bc852df866aac3c69e46af..241a48459b666fab172d376ddfda2da4562145ad 100644 (file)
@@ -172,7 +172,7 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
                rc = 0; /* order accepted */
                break;
        default:
-               rc = -ENOTSUPP;
+               rc = -EOPNOTSUPP;
        }
        return rc;
 }
@@ -293,7 +293,7 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
                vcpu->stat.instruction_sigp_restart++;
                /* user space must know about restart */
        default:
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        }
 
        if (rc < 0)
index 5c8457129603233e020c6799101360707f51354c..6409fd57eb049c837bd9693db08e835908121c99 100644 (file)
@@ -309,7 +309,7 @@ query_segment_type (struct dcss_segment *seg)
        }
 #endif
        if (qout->segcnt > 6) {
-               rc = -ENOTSUPP;
+               rc = -EOPNOTSUPP;
                goto out_free;
        }
 
@@ -324,11 +324,11 @@ query_segment_type (struct dcss_segment *seg)
                for (i=0; i<qout->segcnt; i++) {
                        if (((qout->range[i].start & 0xff) != SEG_TYPE_EW) &&
                            ((qout->range[i].start & 0xff) != SEG_TYPE_EN)) {
-                               rc = -ENOTSUPP;
+                               rc = -EOPNOTSUPP;
                                goto out_free;
                        }
                        if (start != qout->range[i].start >> PAGE_SHIFT) {
-                               rc = -ENOTSUPP;
+                               rc = -EOPNOTSUPP;
                                goto out_free;
                        }
                        start = (qout->range[i].end >> PAGE_SHIFT) + 1;
@@ -357,7 +357,7 @@ query_segment_type (struct dcss_segment *seg)
  * -ENOSYS  : we are not running on VM
  * -EIO     : could not perform query diagnose
  * -ENOENT  : no such segment
- * -ENOTSUPP: multi-part segment cannot be used with linux
+ * -EOPNOTSUPP: multi-part segment cannot be used with linux
  * -ENOMEM  : out of memory
  * 0 .. 6   : type of segment as defined in include/asm-s390/extmem.h
  */
@@ -515,7 +515,7 @@ __segment_load (char *name, int do_nonshared, unsigned long *addr, unsigned long
  * -ENOSYS  : we are not running on VM
  * -EIO     : could not perform query or load diagnose
  * -ENOENT  : no such segment
- * -ENOTSUPP: multi-part segment cannot be used with linux
+ * -EOPNOTSUPP: multi-part segment cannot be used with linux
  * -ENOSPC  : segment cannot be used (overlaps with storage)
  * -EBUSY   : segment can temporarily not be used (overlaps with dcss)
  * -ERANGE  : segment cannot be used (exceeds kernel mapping range)
@@ -742,7 +742,7 @@ void segment_warning(int rc, char *seg_name)
                pr_err("Loading or querying DCSS %s resulted in a "
                       "hardware error\n", seg_name);
                break;
-       case -ENOTSUPP:
+       case -EOPNOTSUPP:
                pr_err("DCSS %s has multiple page ranges and cannot be "
                       "loaded or queried\n", seg_name);
                break;