gas bfd_reloc_code_real_type

Enumeration constants are integer types, so there should be no need to
cast such constants to int in expressions.  (Perhaps some older gccs
warned, I checked back to gcc-4.5.)  Remove some of those unnecessary
casts.  Also remove unnecessary casts to bfd_reloc_code_real_type.
diff --git a/gas/cgen.c b/gas/cgen.c
index 030c2f0..8fbb531 100644
--- a/gas/cgen.c
+++ b/gas/cgen.c
@@ -248,9 +248,7 @@
      but it is the operand that has a pc relative relocation.  */
   fixP = fix_new (frag, where, length / 8, symbol, offset,
 		  CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR),
-		  (bfd_reloc_code_real_type)
-		    ((int) BFD_RELOC_UNUSED
-		     + (int) operand->type));
+		  BFD_RELOC_UNUSED + operand->type);
   fixP->fx_cgen.insn = insn;
   fixP->fx_cgen.opinfo = opinfo;
   fixP->fx_cgen.field = NULL;
@@ -283,9 +281,7 @@
      but it is the operand that has a pc relative relocation.  */
   fixP = fix_new_exp (frag, where, length / 8, exp,
 		      CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR),
-		      (bfd_reloc_code_real_type)
-		        ((int) BFD_RELOC_UNUSED
-			 + (int) operand->type));
+		      BFD_RELOC_UNUSED + operand->type);
   fixP->fx_cgen.insn = insn;
   fixP->fx_cgen.opinfo = opinfo;
   fixP->fx_cgen.field = NULL;
@@ -859,9 +855,9 @@
   if (fixP->fx_subsy != (symbolS *) NULL)
     as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex"));
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num (cd, opindex);
       const char *errmsg;
       bfd_reloc_code_real_type reloc_type;
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index e66e8d6..2d66986 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -1777,8 +1777,7 @@
       else
 	{
 	  reloc_howto_type *reloc_howto =
-              bfd_reloc_type_lookup (stdoutput,
-                                     (bfd_reloc_code_real_type) fixup->reloc);
+	    bfd_reloc_type_lookup (stdoutput, fixup->reloc);
 	  gas_assert (reloc_howto);
 
 	  size = bfd_get_reloc_size (reloc_howto);
@@ -1800,7 +1799,7 @@
 	}
 
       fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, size,
-			  &fixup->exp, pcrel, (bfd_reloc_code_real_type) fixup->reloc);
+			  &fixup->exp, pcrel, fixup->reloc);
 
       /* Turn off complaints that the addend is too large for some fixups,
          and copy in the sequence number for the explicit relocations.  */
@@ -2138,8 +2137,7 @@
       else if (reloc < BFD_RELOC_UNUSED && reloc > 0)
 	{
 	  reloc_howto_type *reloc_howto
-              = bfd_reloc_type_lookup (stdoutput,
-                                       (bfd_reloc_code_real_type) reloc);
+	    = bfd_reloc_type_lookup (stdoutput, reloc);
 	  if (reloc_operand == NULL
 	      || reloc_howto->bitsize != reloc_operand->bits)
 	    {
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 30d6cb9..ff14e91 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -1457,8 +1457,7 @@
       else
 	{
 	  reloc_howto_type *reloc_howto =
-	    bfd_reloc_type_lookup (stdoutput,
-				   (bfd_reloc_code_real_type) fixup->reloc);
+	    bfd_reloc_type_lookup (stdoutput, fixup->reloc);
 	  gas_assert (reloc_howto);
 
 	  /* FIXME! the reloc size is wrong in the BFD file.
@@ -4058,8 +4057,7 @@
 	    {
 	      /* sanity checks.  */
 	      reloc_howto_type *reloc_howto
-		= bfd_reloc_type_lookup (stdoutput,
-					 (bfd_reloc_code_real_type) reloc);
+		= bfd_reloc_type_lookup (stdoutput, reloc);
 	      unsigned reloc_bitsize = reloc_howto->bitsize;
 	      if (reloc_howto->rightshift)
 		reloc_bitsize -= reloc_howto->rightshift;
@@ -4083,8 +4081,7 @@
 	  else
 	    {
 	      reloc_howto_type *reloc_howto =
-		bfd_reloc_type_lookup (stdoutput,
-				       (bfd_reloc_code_real_type) fixup->reloc);
+		bfd_reloc_type_lookup (stdoutput, fixup->reloc);
 	      pcrel = reloc_howto->pc_relative;
 	    }
 	  fixup->pcrel = pcrel;
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 13afe8d..c6045a1 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -3844,9 +3844,8 @@
 	    emit_expr (&exp, (unsigned int) nbytes);
 	  else
 	    {
-	      reloc_howto_type *howto = (reloc_howto_type *)
-		  bfd_reloc_type_lookup (stdoutput,
-					 (bfd_reloc_code_real_type) reloc);
+	      reloc_howto_type *howto = bfd_reloc_type_lookup (stdoutput,
+							       reloc);
 	      int size = bfd_get_reloc_size (howto);
 
 	      if (reloc == BFD_RELOC_ARM_PLT32)
@@ -22218,8 +22217,8 @@
       break;
 
     default:
-      new_fix = (fixS *) fix_new (frag, where, size, make_expr_symbol (exp), 0,
-				  pc_rel, (enum bfd_reloc_code_real) reloc);
+      new_fix = fix_new (frag, where, size, make_expr_symbol (exp), 0,
+			 pc_rel, reloc);
       break;
     }
 
diff --git a/gas/config/tc-epiphany.c b/gas/config/tc-epiphany.c
index 4a027e9..64d70f4 100644
--- a/gas/config/tc-epiphany.c
+++ b/gas/config/tc-epiphany.c
@@ -251,7 +251,7 @@
   if (fixP->fx_addsy == (symbolS *) NULL)
     fixP->fx_done = 1;
 
-  if (((int) fixP->fx_r_type < (int) BFD_RELOC_UNUSED)
+  if ((fixP->fx_r_type < BFD_RELOC_UNUSED)
       && fixP->fx_done)
     {
       /* Install EPIPHANY-dependent relocations HERE because nobody else
@@ -1025,10 +1025,10 @@
 {
  bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = fixP->fx_cgen.insn;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand =
 	cgen_operand_lookup_by_num (gas_cgen_cpu_desc, opindex);
 
diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c
index 2c33c90..2c84812 100644
--- a/gas/config/tc-frv.c
+++ b/gas/config/tc-frv.c
@@ -1523,10 +1523,10 @@
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
       reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
     }
@@ -1705,7 +1705,7 @@
 	}
       else
 	{
-	  opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED;
+	  opindex = fixp->fx_r_type - BFD_RELOC_UNUSED;
 	  operand = cgen_operand_lookup_by_num (cd, opindex);
 	  reloc = md_cgen_lookup_reloc (insn, operand, fixp);
 	}
diff --git a/gas/config/tc-iq2000.c b/gas/config/tc-iq2000.c
index 1957235..e7e1235 100644
--- a/gas/config/tc-iq2000.c
+++ b/gas/config/tc-iq2000.c
@@ -728,10 +728,10 @@
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
 
       reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
index 2eddf16..de2f86c 100644
--- a/gas/config/tc-m32c.c
+++ b/gas/config/tc-m32c.c
@@ -1136,9 +1136,9 @@
 
   /* We need the symbol name for the VTABLE entries.  */
   reloc = fixP->fx_r_type;
-  if (reloc > (int)BFD_RELOC_UNUSED)
+  if (reloc > BFD_RELOC_UNUSED)
     {
-      reloc -= (int)BFD_RELOC_UNUSED;
+      reloc -= BFD_RELOC_UNUSED;
       switch (reloc)
 	{
 	case M32C_OPERAND_DSP_32_S16:
diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
index e9d9cc9..6946b2e 100644
--- a/gas/config/tc-m32r.c
+++ b/gas/config/tc-m32r.c
@@ -2128,10 +2128,10 @@
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand =
 	cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
 
diff --git a/gas/config/tc-mep.c b/gas/config/tc-mep.c
index 5e53421..d35a863 100644
--- a/gas/config/tc-mep.c
+++ b/gas/config/tc-mep.c
@@ -2051,10 +2051,10 @@
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand
 	= cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
       reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 5e602a4..9f4e01d 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -7728,17 +7728,16 @@
       && delayed_branch_p (ip))
     {
       relaxed_branch = true;
-      add_relaxed_insn (ip, (relaxed_branch_length
-			     (NULL, NULL,
-			      uncond_branch_p (ip) ? -1
-			      : branch_likely_p (ip) ? 1
-			      : 0)), 4,
-			RELAX_BRANCH_ENCODE
-			(AT, mips_pic != NO_PIC,
-			 uncond_branch_p (ip),
-			 branch_likely_p (ip),
-			 pinfo & INSN_WRITE_GPR_31,
-			 0),
+      add_relaxed_insn (ip,
+			relaxed_branch_length (NULL, NULL,
+					       uncond_branch_p (ip) ? -1
+					       : branch_likely_p (ip) ? 1
+					       : 0),
+			4,
+			RELAX_BRANCH_ENCODE (AT, mips_pic != NO_PIC,
+					     uncond_branch_p (ip),
+					     branch_likely_p (ip),
+					     pinfo & INSN_WRITE_GPR_31, 0),
 			address_expr->X_add_symbol,
 			address_expr->X_add_number);
       *reloc_type = BFD_RELOC_UNUSED;
@@ -7814,15 +7813,15 @@
 	  offset = 0;
 	}
       add_relaxed_insn (ip, 12, 0,
-			RELAX_MIPS16_ENCODE
-			(*reloc_type - BFD_RELOC_UNUSED,
-			 mips_opts.ase & ASE_MIPS16E2,
-			 mips_pic != NO_PIC,
-			 HAVE_32BIT_SYMBOLS,
-			 mips_opts.warn_about_macros,
-			 require_unextended, require_extended,
-			 delayed_branch_p (&history[0]),
-			 history[0].mips16_absolute_jump_p),
+			RELAX_MIPS16_ENCODE (*reloc_type - BFD_RELOC_UNUSED,
+					     mips_opts.ase & ASE_MIPS16E2,
+					     mips_pic != NO_PIC,
+					     HAVE_32BIT_SYMBOLS,
+					     mips_opts.warn_about_macros,
+					     require_unextended,
+					     require_extended,
+					     delayed_branch_p (&history[0]),
+					     history[0].mips16_absolute_jump_p),
 			symbol, offset);
     }
   else if (mips_opts.mips16 && insn_length (ip) == 2)
@@ -8438,7 +8437,7 @@
 	    case 'D':
 	    case 'E':
 	      if (!forced_insn_length)
-		*offset_reloc = (int) BFD_RELOC_UNUSED + c;
+		*offset_reloc = BFD_RELOC_UNUSED + c;
 	      else if (c == 'D')
 		*offset_reloc = BFD_RELOC_MICROMIPS_10_PCREL_S1;
 	      else
@@ -8566,7 +8565,7 @@
 		}
 	    }
 	  else if (relax_char)
-	    *offset_reloc = (int) BFD_RELOC_UNUSED + relax_char;
+	    *offset_reloc = BFD_RELOC_UNUSED + relax_char;
 
 	  check_completed_insn (&arg);
 	  return true;
@@ -8988,11 +8987,11 @@
 
   next = va_arg (*args, int);
   if (next >= 0)
-    r[0] = (bfd_reloc_code_real_type) next;
+    r[0] = next;
   else
     {
       for (i = 0; i < 3; i++)
-	r[i] = (bfd_reloc_code_real_type) va_arg (*args, int);
+	r[i] = va_arg (*args, int);
       /* This function is only used for 16-bit relocation fields.
 	 To make the macro code simpler, treat an unrelocated value
 	 in the same way as BFD_RELOC_LO16.  */
@@ -9240,7 +9239,7 @@
 	    gas_assert (ep != NULL);
 
 	    if (ep->X_op != O_constant)
-	      *r = (int) BFD_RELOC_UNUSED + c;
+	      *r = BFD_RELOC_UNUSED + c;
 	    else if (calculate_reloc (*r, ep->X_add_number, &value))
 	      {
 		mips16_immed (NULL, 0, c, *r, value, 0, &insn.insn_opcode);
@@ -11120,7 +11119,7 @@
 	}
       else if (!mips_big_got && !HAVE_NEWABI)
 	{
-	  int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
+	  int lw_reloc_type = BFD_RELOC_MIPS_GOT16;
 
 	  /* If this is a reference to an external symbol, and there
 	     is no constant, we want
@@ -11157,7 +11156,7 @@
 	      if (mips_pic == SVR4_PIC
 		  && breg == 0
 		  && (call || tempreg == PIC_CALL_REG))
-		lw_reloc_type = (int) BFD_RELOC_MIPS_CALL16;
+		lw_reloc_type = BFD_RELOC_MIPS_CALL16;
 
 	      relax_start (offset_expr.X_add_symbol);
 	      macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
@@ -11319,9 +11318,9 @@
       else if (mips_big_got && !HAVE_NEWABI)
 	{
 	  int gpdelay;
-	  int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
-	  int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
-	  int local_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
+	  int lui_reloc_type = BFD_RELOC_MIPS_GOT_HI16;
+	  int lw_reloc_type = BFD_RELOC_MIPS_GOT_LO16;
+	  int local_reloc_type = BFD_RELOC_MIPS_GOT16;
 
 	  /* This is the large GOT case.  If this is a reference to an
 	     external symbol, and there is no constant, we want
@@ -11371,8 +11370,8 @@
 	  if (expr1.X_add_number == 0 && breg == 0
 	      && (call || tempreg == PIC_CALL_REG))
 	    {
-	      lui_reloc_type = (int) BFD_RELOC_MIPS_CALL_HI16;
-	      lw_reloc_type = (int) BFD_RELOC_MIPS_CALL_LO16;
+	      lui_reloc_type = BFD_RELOC_MIPS_CALL_HI16;
+	      lw_reloc_type = BFD_RELOC_MIPS_CALL_LO16;
 	    }
 	  macro_build (&offset_expr, "lui", LUI_FMT, tempreg, lui_reloc_type);
 	  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
@@ -11474,8 +11473,8 @@
 	}
       else if (mips_big_got && HAVE_NEWABI)
 	{
-	  int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
-	  int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
+	  int lui_reloc_type = BFD_RELOC_MIPS_GOT_HI16;
+	  int lw_reloc_type = BFD_RELOC_MIPS_GOT_LO16;
 	  int add_breg_early = 0;
 
 	  /* This is the large GOT case.  If this is a reference to an
@@ -11517,8 +11516,8 @@
 	  if (expr1.X_add_number == 0 && breg == 0
 	      && (call || tempreg == PIC_CALL_REG))
 	    {
-	      lui_reloc_type = (int) BFD_RELOC_MIPS_CALL_HI16;
-	      lw_reloc_type = (int) BFD_RELOC_MIPS_CALL_LO16;
+	      lui_reloc_type = BFD_RELOC_MIPS_CALL_HI16;
+	      lw_reloc_type = BFD_RELOC_MIPS_CALL_LO16;
 	    }
 	  macro_build (&offset_expr, "lui", LUI_FMT, tempreg, lui_reloc_type);
 	  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
@@ -12532,7 +12531,7 @@
 	}
       else if (!mips_big_got)
 	{
-	  int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
+	  int lw_reloc_type = BFD_RELOC_MIPS_GOT16;
 
 	  /* If this is a reference to an external symbol, we want
 	       lw	$tempreg,<sym>($gp)	(BFD_RELOC_MIPS_GOT16)
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index c4cf804..3c8834e 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -2145,7 +2145,7 @@
 
 	      fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset,
 				  reloc_size / 8, &fixups[i].exp, pcrel,
-				  ((bfd_reloc_code_real_type) reloc));
+				  reloc);
 
 	      if (pcrel)
 		fixP->fx_offset += offset;
diff --git a/gas/config/tc-mt.c b/gas/config/tc-mt.c
index 0cfc82d..9dd884f 100644
--- a/gas/config/tc-mt.c
+++ b/gas/config/tc-mt.c
@@ -461,10 +461,10 @@
 bool
 mt_fix_adjustable (fixS * fixP)
 {
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand;
 
       operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index bb5d387..5a93b41 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -2298,7 +2298,7 @@
 	  }
 	*str_p = str;
 
-	if (reloc == (int) BFD_RELOC_PPC64_TOC
+	if (reloc == BFD_RELOC_PPC64_TOC
 	    && exp_p->X_op == O_symbol
 	    && strcmp (S_GET_NAME (exp_p->X_add_symbol), ".TOC.") == 0)
 	  {
@@ -2311,7 +2311,7 @@
 	    && (ppc_cpu & PPC_OPCODE_POWER10) == 0)
 	  reloc = BFD_RELOC_PPC64_REL24_P9NOTOC;
 
-	return (bfd_reloc_code_real_type) reloc;
+	return reloc;
       }
 
   return BFD_RELOC_NONE;
@@ -2779,7 +2779,7 @@
 	&& (ppc_obj64 ? ptr->valid64 : ptr->valid32))
       {
 	*str_p = str;
-	return (bfd_reloc_code_real_type) ptr->reloc;
+	return ptr->reloc;
       }
 
   return BFD_RELOC_NONE;
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 6e9dca0..4ddee63 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -1906,8 +1906,7 @@
 	fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, 4,
 			    &fixups[i].exp,
 			    (operand->flags & S390_OPERAND_PCREL) != 0,
-			    ((bfd_reloc_code_real_type)
-			     (fixups[i].opindex + (int) BFD_RELOC_UNUSED)));
+			    fixups[i].opindex + BFD_RELOC_UNUSED);
       /* s390_insert_operand () does the range checking.  */
       if (operand->flags & S390_OPERAND_PCREL)
 	fixP->fx_no_overflow = 1;
@@ -2490,12 +2489,12 @@
   else
     fixP->fx_done = 1;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const struct s390_operand *operand;
       int opindex;
 
-      opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       operand = &s390_operands[opindex];
 
       if (fixP->fx_done)
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index a519856..85a59ac 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -3310,8 +3310,7 @@
 		       f - frag_now->fr_literal, 4,
 		       & fixups[i].exp,
 		       (operand->flags & V850_PCREL) != 0,
-		       (bfd_reloc_code_real_type) (fixups[i].opindex
-						   + (int) BFD_RELOC_UNUSED));
+		       fixups[i].opindex + BFD_RELOC_UNUSED);
 	}
     }
 
@@ -3439,14 +3438,14 @@
       fixP->fx_addnumber = value;
     }
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       int opindex;
       const struct v850_operand *operand;
       unsigned long insn;
       const char *errmsg = NULL;
 
-      opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       operand = &v850_operands[opindex];
 
       /* Fetch the instruction, insert the fully resolved operand
diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c
index 83bf873..f7807f5 100644
--- a/gas/config/tc-xstormy16.c
+++ b/gas/config/tc-xstormy16.c
@@ -481,9 +481,9 @@
   if (fixP->fx_subsy != (symbolS *) NULL)
     as_bad_subtract (fixP);
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num (cd, opindex);
       const char *errmsg;
       bfd_reloc_code_real_type reloc_type;