These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / misc / sgi-gru / grukdump.c
index a3700a5..313da31 100644 (file)
@@ -78,11 +78,10 @@ static int gru_dump_tfm(struct gru_state *gru,
                void __user *ubuf, void __user *ubufend)
 {
        struct gru_tlb_fault_map *tfm;
-       int i, ret, bytes;
+       int i;
 
-       bytes = GRU_NUM_TFM * GRU_CACHE_LINE_BYTES;
-       if (bytes > ubufend - ubuf)
-               ret = -EFBIG;
+       if (GRU_NUM_TFM * GRU_CACHE_LINE_BYTES > ubufend - ubuf)
+               return -EFBIG;
 
        for (i = 0; i < GRU_NUM_TFM; i++) {
                tfm = get_tfm(gru->gs_gru_base_vaddr, i);
@@ -99,11 +98,10 @@ static int gru_dump_tgh(struct gru_state *gru,
                void __user *ubuf, void __user *ubufend)
 {
        struct gru_tlb_global_handle *tgh;
-       int i, ret, bytes;
+       int i;
 
-       bytes = GRU_NUM_TGH * GRU_CACHE_LINE_BYTES;
-       if (bytes > ubufend - ubuf)
-               ret = -EFBIG;
+       if (GRU_NUM_TGH * GRU_CACHE_LINE_BYTES > ubufend - ubuf)
+               return -EFBIG;
 
        for (i = 0; i < GRU_NUM_TGH; i++) {
                tgh = get_tgh(gru->gs_gru_base_vaddr, i);
@@ -196,7 +194,7 @@ int gru_dump_chiplet_request(unsigned long arg)
                return -EFAULT;
 
        /* Currently, only dump by gid is implemented */
-       if (req.gid >= gru_max_gids || req.gid < 0)
+       if (req.gid >= gru_max_gids)
                return -EINVAL;
 
        gru = GID_TO_GRU(req.gid);