Explorar o código

irda: use get_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Harvey Harrison %!s(int64=17) %!d(string=hai) anos
pai
achega
260ffeed3f
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      net/irda/iriap.c

+ 5 - 3
net/irda/iriap.c

@@ -451,12 +451,14 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
 	n = 2;
 	n = 2;
 
 
 	/* Get length, MSB first */
 	/* Get length, MSB first */
-	len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2;
+	len = get_unaligned_be16(fp + n);
+	n += 2;
 
 
 	IRDA_DEBUG(4, "%s(), len=%d\n", __func__, len);
 	IRDA_DEBUG(4, "%s(), len=%d\n", __func__, len);
 
 
 	/* Get object ID, MSB first */
 	/* Get object ID, MSB first */
-	obj_id = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2;
+	obj_id = get_unaligned_be16(fp + n);
+	n += 2;
 
 
 	type = fp[n++];
 	type = fp[n++];
 	IRDA_DEBUG(4, "%s(), Value type = %d\n", __func__, type);
 	IRDA_DEBUG(4, "%s(), Value type = %d\n", __func__, type);
@@ -506,7 +508,7 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
 		value = irias_new_string_value(fp+n);
 		value = irias_new_string_value(fp+n);
 		break;
 		break;
 	case IAS_OCT_SEQ:
 	case IAS_OCT_SEQ:
-		value_len = be16_to_cpu(get_unaligned((__be16 *)(fp+n)));
+		value_len = get_unaligned_be16(fp + n);
 		n += 2;
 		n += 2;
 
 
 		/* Will truncate to IAS_MAX_OCTET_STRING bytes */
 		/* Will truncate to IAS_MAX_OCTET_STRING bytes */