lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 31 Oct 2019 04:53:26 -0700
From:   Joe Perches <joe@...ches.com>
To:     Huazhong Tan <tanhuazhong@...wei.com>, davem@...emloft.net
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        salil.mehta@...wei.com, yisen.zhuang@...wei.com,
        linuxarm@...wei.com, jakub.kicinski@...ronome.com,
        Guojia Liao <liaoguojia@...wei.com>
Subject: Re: [PATCH net-next 8/9] net: hns3: cleanup some print format
 warning

On Thu, 2019-10-31 at 19:23 +0800, Huazhong Tan wrote:
> From: Guojia Liao <liaoguojia@...wei.com>
> 
> Using '%d' for printing type unsigned int or '%u' for
> type int would cause static tools to give false warnings,
> so this patch cleanups this warning by using the suitable
> format specifier of the type of variable.
> 
> BTW, modifies the type of some variables and macro to
> synchronize with their usage.

What tool is this?

I think this static warning is excessive as macro
defines with a small positive number are common

> diff --git a/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h b/drivers/net/ethernet/hisilicon/hns3/hclge_mbx.h
[]
> @@ -72,7 +72,7 @@ enum hclge_mbx_vlan_cfg_subcode {
>  };
>  
>  #define HCLGE_MBX_MAX_MSG_SIZE	16
> -#define HCLGE_MBX_MAX_RESP_DATA_SIZE	8
> +#define HCLGE_MBX_MAX_RESP_DATA_SIZE	8U
>  #define HCLGE_MBX_RING_MAP_BASIC_MSG_NUM	3
>  #define HCLGE_MBX_RING_NODE_VARIABLE_NUM	3

like this one

> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
[]
> @@ -57,68 +57,68 @@ static int hns3_dbg_queue_info(struct hnae3_handle *h,
>  					   HNS3_RING_RX_RING_BASEADDR_H_REG);
>  		base_add_l = readl_relaxed(ring->tqp->io_base +
>  					   HNS3_RING_RX_RING_BASEADDR_L_REG);
> -		dev_info(&h->pdev->dev, "RX(%d) BASE ADD: 0x%08x%08x\n", i,
> +		dev_info(&h->pdev->dev, "RX(%u) BASE ADD: 0x%08x%08x\n", i,

so using %d is correct enough.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ