提交 30bc83a7 编写于 作者: D DuanqiangWen

openeuler: net: txgbe: fix arm32 compile error because 64bit div and warnning

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5Y6RT
CVE: NA

1.fix arm32 compile error because 64bit div operate in txgbe_get_thermal_sensor_data function
2.fix txgbe_sysfs compile warning.
Signed-off-by: NDuanqiangWen <duanqiangwen@net-swift.com>
上级 79611f43
...@@ -3217,10 +3217,10 @@ s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw) ...@@ -3217,10 +3217,10 @@ s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw)
tsv = tsv < 1200 ? tsv : 1200; tsv = tsv < 1200 ? tsv : 1200;
tsv = -(48380 << 8) / 1000 tsv = -(48380 << 8) / 1000
+ tsv * (31020 << 8) / 100000 + div64_s64(tsv * (31020 << 8), 100000)
- tsv * tsv * (18201 << 8) / 100000000 - div64_s64(tsv * tsv * (18201 << 8), 100000000)
+ tsv * tsv * tsv * (81542 << 8) / 1000000000000 + div64_s64(tsv * tsv * tsv * (81542 << 8), 1000000000000)
- tsv * tsv * tsv * tsv * (16743 << 8) / 1000000000000000; - div64_s64(tsv * tsv * tsv * tsv * (16743 << 8), 1000000000000000);
tsv >>= 8; tsv >>= 8;
data->sensor.temp = (s16)tsv; data->sensor.temp = (s16)tsv;
...@@ -3231,10 +3231,10 @@ s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw) ...@@ -3231,10 +3231,10 @@ s32 txgbe_get_thermal_sensor_data(struct txgbe_hw *hw)
tsv = tsv & TXGBE_TS_ST_DATA_OUT_MASK; tsv = tsv & TXGBE_TS_ST_DATA_OUT_MASK;
tsv = tsv < 1200 ? tsv : 1200; tsv = tsv < 1200 ? tsv : 1200;
tsv = -(48380 << 8) / 1000 tsv = -(48380 << 8) / 1000
+ tsv * (31020 << 8) / 100000 + div64_s64(tsv * (31020 << 8), 100000)
- tsv * tsv * (18201 << 8) / 100000000 - div64_s64(tsv * tsv * (18201 << 8), 100000000)
+ tsv * tsv * tsv * (81542 << 8) / 1000000000000 + div64_s64(tsv * tsv * tsv * (81542 << 8), 1000000000000)
- tsv * tsv * tsv * tsv * (16743 << 8) / 1000000000000000; - div64_s64(tsv * tsv * tsv * tsv * (16743 << 8), 1000000000000000);
tsv >>= 8; tsv >>= 8;
data->sensor.temp = (s16)tsv; data->sensor.temp = (s16)tsv;
......
/*
* 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 // SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2019 - 2022 Beijing WangXun Technology Co., Ltd. */ /* Copyright (c) 2019 - 2022 Beijing WangXun Technology Co., Ltd. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册