@@ -41,7 +41,7 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len)
4141 packet_log ("SPU Message header %p len: %u\n" , buf , buf_len );
4242
4343 /* ========== Decode MH ========== */
44- packet_log (" MH 0x%08x\n" , be32_to_cpu ( * (( u32 * )ptr ) ));
44+ packet_log (" MH 0x%08x\n" , be32_to_cpup (( __be32 * )ptr ));
4545 if (spuh -> mh .flags & MH_SCTX_PRES )
4646 packet_log (" SCTX present\n" );
4747 if (spuh -> mh .flags & MH_BDESC_PRES )
@@ -273,22 +273,21 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len)
273273
274274 /* ========== Decode BDESC ========== */
275275 if (spuh -> mh .flags & MH_BDESC_PRES ) {
276- #ifdef DEBUG
277276 struct BDESC_HEADER * bdesc = (struct BDESC_HEADER * )ptr ;
278- #endif
279- packet_log (" BDESC[0] 0x%08x\n" , be32_to_cpu ( * (( u32 * )ptr ) ));
277+
278+ packet_log (" BDESC[0] 0x%08x\n" , be32_to_cpup (( __be32 * )ptr ));
280279 packet_log (" OffsetMAC:%u LengthMAC:%u\n" ,
281280 be16_to_cpu (bdesc -> offset_mac ),
282281 be16_to_cpu (bdesc -> length_mac ));
283282 ptr += sizeof (u32 );
284283
285- packet_log (" BDESC[1] 0x%08x\n" , be32_to_cpu ( * (( u32 * )ptr ) ));
284+ packet_log (" BDESC[1] 0x%08x\n" , be32_to_cpup (( __be32 * )ptr ));
286285 packet_log (" OffsetCrypto:%u LengthCrypto:%u\n" ,
287286 be16_to_cpu (bdesc -> offset_crypto ),
288287 be16_to_cpu (bdesc -> length_crypto ));
289288 ptr += sizeof (u32 );
290289
291- packet_log (" BDESC[2] 0x%08x\n" , be32_to_cpu ( * (( u32 * )ptr ) ));
290+ packet_log (" BDESC[2] 0x%08x\n" , be32_to_cpup (( __be32 * )ptr ));
292291 packet_log (" OffsetICV:%u OffsetIV:%u\n" ,
293292 be16_to_cpu (bdesc -> offset_icv ),
294293 be16_to_cpu (bdesc -> offset_iv ));
@@ -297,10 +296,9 @@ void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len)
297296
298297 /* ========== Decode BD ========== */
299298 if (spuh -> mh .flags & MH_BD_PRES ) {
300- #ifdef DEBUG
301299 struct BD_HEADER * bd = (struct BD_HEADER * )ptr ;
302- #endif
303- packet_log (" BD[0] 0x%08x\n" , be32_to_cpu ( * (( u32 * )ptr ) ));
300+
301+ packet_log (" BD[0] 0x%08x\n" , be32_to_cpup (( __be32 * )ptr ));
304302 packet_log (" Size:%ubytes PrevLength:%u\n" ,
305303 be16_to_cpu (bd -> size ), be16_to_cpu (bd -> prev_length ));
306304 ptr += 4 ;
@@ -1056,9 +1054,9 @@ void spum_request_pad(u8 *pad_start,
10561054
10571055 /* add the size at the end as required per alg */
10581056 if (auth_alg == HASH_ALG_MD5 )
1059- * (u64 * )ptr = cpu_to_le64 (( u64 ) total_sent * 8 );
1057+ * (__le64 * )ptr = cpu_to_le64 (total_sent * 8ull );
10601058 else /* SHA1, SHA2-224, SHA2-256 */
1061- * (u64 * )ptr = cpu_to_be64 (( u64 ) total_sent * 8 );
1059+ * (__be64 * )ptr = cpu_to_be64 (total_sent * 8ull );
10621060 ptr += sizeof (u64 );
10631061 }
10641062 }
0 commit comments