]> Git Repo - linux.git/blobdiff - arch/powerpc/lib/code-patching.c
md/raid1: only allocate write behind bio for WriteMostly device
[linux.git] / arch / powerpc / lib / code-patching.c
index f9a3019e37b43cfffb66e23f882d6314dfd2ae39..c5ed9882383521ec65c30a96cbc09037e9624ae3 100644 (file)
@@ -228,6 +228,11 @@ bool is_offset_in_branch_range(long offset)
        return (offset >= -0x2000000 && offset <= 0x1fffffc && !(offset & 0x3));
 }
 
+bool is_offset_in_cond_branch_range(long offset)
+{
+       return offset >= -0x8000 && offset <= 0x7fff && !(offset & 0x3);
+}
+
 /*
  * Helper to check if a given instruction is a conditional branch
  * Derived from the conditional checks in analyse_instr()
@@ -280,7 +285,7 @@ int create_cond_branch(struct ppc_inst *instr, const u32 *addr,
                offset = offset - (unsigned long)addr;
 
        /* Check we can represent the target in the instruction format */
-       if (offset < -0x8000 || offset > 0x7FFF || offset & 0x3)
+       if (!is_offset_in_cond_branch_range(offset))
                return 1;
 
        /* Mask out the flags and target, so they don't step on each other. */
This page took 0.030356 seconds and 4 git commands to generate.