Commit 169d07e7 authored by Peiyang Wang's avatar Peiyang Wang Committed by Jakub Kicinski
Browse files

net: hns3: clear hns alarm: comparison of integer expressions of different signedness



A static alarm exists in the hns and needs to be cleared.

The alarm is comparison of integer expressions of different
signedness including 's64' and 'long unsigned int',
'int' and 'long unsigned int', 'u32' and 'int',
'int' and 'unsigned int'.

Signed-off-by: default avatarPeiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20250623040043.857782-8-shaojijie@huawei.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 84c0564b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ static int hclge_comm_cmd_csq_clean(struct hclge_comm_hw *hw)
static int hclge_comm_cmd_csq_done(struct hclge_comm_hw *hw)
{
	u32 head = hclge_comm_read_dev(hw, HCLGE_COMM_NIC_CSQ_HEAD_REG);
	return head == hw->cmq.csq.next_to_use;
	return head == (u32)hw->cmq.csq.next_to_use;
}

static u32 hclge_get_cmdq_tx_timeout(u16 opcode, u32 tx_timeout)
+11 −11
Original line number Diff line number Diff line
@@ -1690,8 +1690,8 @@ static int hns3_fill_desc(struct hns3_enet_ring *ring, dma_addr_t dma,
#define HNS3_LIKELY_BD_NUM	1

	struct hns3_desc *desc = &ring->desc[ring->next_to_use];
	unsigned int frag_buf_num;
	int k, sizeoflast;
	unsigned int frag_buf_num, k;
	int sizeoflast;

	if (likely(size <= HNS3_MAX_BD_SIZE)) {
		desc->addr = cpu_to_le64(dma);
@@ -1863,7 +1863,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
				     unsigned int bd_num, u8 max_non_tso_bd_num)
{
	unsigned int tot_len = 0;
	int i;
	unsigned int i;

	for (i = 0; i < max_non_tso_bd_num - 1U; i++)
		tot_len += bd_size[i];
@@ -1891,7 +1891,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,

void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size)
{
	int i;
	u32 i;

	for (i = 0; i < MAX_SKB_FRAGS; i++)
		size[i] = skb_frag_size(&shinfo->frags[i]);
@@ -2207,9 +2207,9 @@ static int hns3_handle_tx_sgl(struct hns3_enet_ring *ring,
	struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use];
	u32 nfrag = skb_shinfo(skb)->nr_frags + 1;
	struct sg_table *sgt;
	int i, bd_num = 0;
	int bd_num = 0;
	dma_addr_t dma;
	u32 cb_len;
	u32 cb_len, i;
	int nents;

	if (skb_has_frag_list(skb))
@@ -2544,7 +2544,7 @@ static void hns3_nic_get_stats64(struct net_device *netdev,
	struct hnae3_handle *handle = priv->ae_handle;
	struct rtnl_link_stats64 ring_total_stats;
	struct hns3_enet_ring *ring;
	unsigned int idx;
	int idx;

	if (test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
		return;
@@ -2770,7 +2770,7 @@ static int hns3_nic_change_mtu(struct net_device *netdev, int new_mtu)

static int hns3_get_timeout_queue(struct net_device *ndev)
{
	int i;
	unsigned int i;

	/* Find the stopped queue the same way the stack does */
	for (i = 0; i < ndev->num_tx_queues; i++) {
@@ -2851,7 +2851,7 @@ static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev)
	struct hns3_nic_priv *priv = netdev_priv(ndev);
	struct hnae3_handle *h = hns3_get_handle(ndev);
	struct hns3_enet_ring *tx_ring;
	int timeout_queue;
	u32 timeout_queue;

	timeout_queue = hns3_get_timeout_queue(ndev);
	if (timeout_queue >= ndev->num_tx_queues) {
@@ -3821,7 +3821,7 @@ static int hns3_gro_complete(struct sk_buff *skb, u32 l234info)
{
	__be16 type = skb->protocol;
	struct tcphdr *th;
	int depth = 0;
	u32 depth = 0;

	while (eth_type_vlan(type)) {
		struct vlan_hdr *vh;
@@ -5934,7 +5934,7 @@ static const struct hns3_hw_error_info hns3_hw_err[] = {
static void hns3_process_hw_error(struct hnae3_handle *handle,
				  enum hnae3_hw_error_type type)
{
	int i;
	u32 i;

	for (i = 0; i < ARRAY_SIZE(hns3_hw_err); i++) {
		if (hns3_hw_err[i].type == type) {
+1 −1
Original line number Diff line number Diff line
@@ -621,7 +621,7 @@ struct hns3_reset_type_map {
	enum hnae3_reset_type rst_type;
};

static inline int ring_space(struct hns3_enet_ring *ring)
static inline u32 ring_space(struct hns3_enet_ring *ring)
{
	/* This smp_load_acquire() pairs with smp_store_release() in
	 * hns3_nic_reclaim_one_desc called by hns3_clean_tx_ring.
+2 −2
Original line number Diff line number Diff line
@@ -541,7 +541,7 @@ static void hns3_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
{
	struct hnae3_handle *h = hns3_get_handle(netdev);
	const struct hnae3_ae_ops *ops = hns3_get_ops(h);
	int i;
	u32 i;

	if (!ops->get_strings)
		return;
@@ -569,7 +569,7 @@ static u64 *hns3_get_stats_tqps(struct hnae3_handle *handle, u64 *data)
	struct hns3_nic_priv *nic_priv = handle->priv;
	struct hns3_enet_ring *ring;
	u8 *stat;
	int i, j;
	u32 i, j;

	/* get stats for Tx */
	for (i = 0; i < kinfo->num_tqps; i++) {
+6 −7
Original line number Diff line number Diff line
@@ -830,10 +830,10 @@ hclge_dbg_dump_reg_tqp(struct hclge_dev *hdev,
{
	const struct hclge_dbg_dfx_message *dfx_message = reg_info->dfx_msg;
	const struct hclge_dbg_reg_common_msg *reg_msg = &reg_info->reg_msg;
	u32 index, entry, i, cnt, min_num;
	struct hclge_desc *desc_src;
	u32 index, entry, i, cnt;
	int bd_num, min_num, ret;
	struct hclge_desc *desc;
	int bd_num, ret;

	ret = hclge_dbg_get_dfx_bd_num(hdev, reg_msg->offset, &bd_num);
	if (ret)
@@ -885,9 +885,9 @@ hclge_dbg_dump_reg_common(struct hclge_dev *hdev,
	const struct hclge_dbg_reg_common_msg *reg_msg = &reg_info->reg_msg;
	const struct hclge_dbg_dfx_message *dfx_message = reg_info->dfx_msg;
	struct hclge_desc *desc_src;
	int bd_num, min_num, ret;
	int bd_num, min_num, ret, i;
	struct hclge_desc *desc;
	u32 entry, i;
	u32 entry;

	ret = hclge_dbg_get_dfx_bd_num(hdev, reg_msg->offset, &bd_num);
	if (ret)
@@ -1279,7 +1279,7 @@ static int hclge_dbg_dump_reg_cmd(struct hclge_dev *hdev,
{
	const struct hclge_dbg_reg_type_info *reg_info;
	int pos = 0, ret = 0;
	int i;
	u32 i;

	for (i = 0; i < ARRAY_SIZE(hclge_dbg_reg_info); i++) {
		reg_info = &hclge_dbg_reg_info[i];
@@ -2648,9 +2648,8 @@ static void hclge_dbg_dump_mac_list(struct hclge_dev *hdev, char *buf, int len,
	struct hclge_mac_node *mac_node, *tmp;
	struct hclge_vport *vport;
	struct list_head *list;
	u32 func_id;
	u32 func_id, i;
	int pos = 0;
	int i;

	for (i = 0; i < ARRAY_SIZE(mac_list_items); i++)
		result[i] = &data_str[i][0];
Loading