hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/ethernet/cadence/macb_ptp.c
....@@ -1,22 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /**
23 * 1588 PTP support for Cadence GEM device.
34 *
4
- * Copyright (C) 2017 Cadence Design Systems - http://www.cadence.com
5
+ * Copyright (C) 2017 Cadence Design Systems - https://www.cadence.com
56 *
67 * Authors: Rafal Ozieblo <rafalo@cadence.com>
78 * Bartosz Folta <bfolta@cadence.com>
8
- *
9
- * This program is free software: you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 of
11
- * the License as published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
209 */
2110 #include <linux/kernel.h>
2211 #include <linux/types.h>
....@@ -149,7 +138,7 @@
149138 * (temp / USEC_PER_SEC) + 0.5
150139 */
151140 adj += (USEC_PER_SEC >> 1);
152
- adj >>= GEM_SUBNSINCR_SIZE; /* remove fractions */
141
+ adj >>= PPM_FRACTION; /* remove fractions */
153142 adj = div_u64(adj, USEC_PER_SEC);
154143 adj = neg_adj ? (word - adj) : (word + adj);
155144
....@@ -480,7 +469,7 @@
480469 case HWTSTAMP_TX_ONESTEP_SYNC:
481470 if (gem_ptp_set_one_step_sync(bp, 1) != 0)
482471 return -ERANGE;
483
- /* fall through */
472
+ fallthrough;
484473 case HWTSTAMP_TX_ON:
485474 tx_bd_control = TSTAMP_ALL_FRAMES;
486475 break;