diff --git a/drivers/net/ethernet/netswift/txgbe/txgbe_hw.c b/drivers/net/ethernet/netswift/txgbe/txgbe_hw.c index 3f5187b0ef23e76ba067fd792af820a6c20db559..5c04af677eb8f576a6a437e7ee427897a50d5a0d 100644 --- a/drivers/net/ethernet/netswift/txgbe/txgbe_hw.c +++ b/drivers/net/ethernet/netswift/txgbe/txgbe_hw.c @@ -3217,10 +3217,10 @@ s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw) tsv = tsv < 1200 ? tsv : 1200; tsv = -(48380 << 8) / 1000 - + tsv * (31020 << 8) / 100000 - - tsv * tsv * (18201 << 8) / 100000000 - + tsv * tsv * tsv * (81542 << 8) / 1000000000000 - - tsv * tsv * tsv * tsv * (16743 << 8) / 1000000000000000; + + div64_s64(tsv * (31020 << 8), 100000) + - div64_s64(tsv * tsv * (18201 << 8), 100000000) + + div64_s64(tsv * tsv * tsv * (81542 << 8), 1000000000000) + - div64_s64(tsv * tsv * tsv * tsv * (16743 << 8), 1000000000000000); tsv >>= 8; data->sensor.temp = (s16)tsv; @@ -3231,10 +3231,10 @@ s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw) tsv = tsv & TXGBE_TS_ST_DATA_OUT_MASK; tsv = tsv < 1200 ? tsv : 1200; tsv = -(48380 << 8) / 1000 - + tsv * (31020 << 8) / 100000 - - tsv * tsv * (18201 << 8) / 100000000 - + tsv * tsv * tsv * (81542 << 8) / 1000000000000 - - tsv * tsv * tsv * tsv * (16743 << 8) / 1000000000000000; + + div64_s64(tsv * (31020 << 8), 100000) + - div64_s64(tsv * tsv * (18201 << 8), 100000000) + + div64_s64(tsv * tsv * tsv * (81542 << 8), 1000000000000) + - div64_s64(tsv * tsv * tsv * tsv * (16743 << 8), 1000000000000000); tsv >>= 8; data->sensor.temp = (s16)tsv; diff --git a/drivers/net/ethernet/netswift/txgbe/txgbe_sysfs.c b/drivers/net/ethernet/netswift/txgbe/txgbe_sysfs.c index 29a4be546ac56cae16cd9a449feb27c5dbc91fc7..80084c96f47f830eab7efeb5dd9dd458fd570747 100644 --- a/drivers/net/ethernet/netswift/txgbe/txgbe_sysfs.c +++ b/drivers/net/ethernet/netswift/txgbe/txgbe_sysfs.c @@ -1,14 +1,3 @@ -/* - * WangXun 10 Gigabit PCI Express Linux driver - * Copyright (c) 2015 - 2017 Beijing WangXun Technology Co., Ltd. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for // SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2019 - 2022 Beijing WangXun Technology Co., Ltd. */