| .. | .. |
|---|
| 1 | | -// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) |
|---|
| 2 | +/* Copyright (c) 2019-2020 Marvell International Ltd. */ |
|---|
| 3 | + |
|---|
| 2 | 4 | #include <linux/types.h> |
|---|
| 3 | 5 | #include <asm/byteorder.h> |
|---|
| 4 | 6 | #include <linux/bug.h> |
|---|
| .. | .. |
|---|
| 420 | 422 | if (p_time->hour > 23) |
|---|
| 421 | 423 | p_time->hour = 0; |
|---|
| 422 | 424 | if (p_time->min > 59) |
|---|
| 423 | | - p_time->hour = 0; |
|---|
| 425 | + p_time->min = 0; |
|---|
| 424 | 426 | if (p_time->msec > 999) |
|---|
| 425 | 427 | p_time->msec = 0; |
|---|
| 426 | 428 | if (p_time->usec > 999) |
|---|
| .. | .. |
|---|
| 1274 | 1276 | */ |
|---|
| 1275 | 1277 | for (offset = 0; offset < size; offset += sizeof(u32)) { |
|---|
| 1276 | 1278 | val = qed_rd(p_hwfn, p_ptt, addr + offset); |
|---|
| 1277 | | - val = be32_to_cpu(val); |
|---|
| 1279 | + val = be32_to_cpu((__force __be32)val); |
|---|
| 1278 | 1280 | memcpy(&p_mfw_buf[offset], &val, sizeof(u32)); |
|---|
| 1279 | 1281 | } |
|---|
| 1280 | 1282 | |
|---|
| .. | .. |
|---|
| 1323 | 1325 | */ |
|---|
| 1324 | 1326 | for (offset = 0; offset < size; offset += sizeof(u32)) { |
|---|
| 1325 | 1327 | memcpy(&val, &p_mfw_buf[offset], sizeof(u32)); |
|---|
| 1326 | | - val = cpu_to_be32(val); |
|---|
| 1328 | + val = (__force u32)cpu_to_be32(val); |
|---|
| 1327 | 1329 | qed_wr(p_hwfn, p_ptt, addr + offset, val); |
|---|
| 1328 | 1330 | } |
|---|
| 1329 | 1331 | |
|---|