patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xu, Rosen" <rosen.xu@intel.com>
To: "Walsh, Conor" <conor.walsh@intel.com>,
	"Zhang, Tianfei" <tianfei.zhang@intel.com>,
	"Pei, Andy" <andy.pei@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Chen,  LingliX" <linglix.chen@intel.com>
Subject: Re: [dpdk-stable] [PATCH] raw/ifpga/base: fix uninitialized variables gcc warning
Date: Fri, 20 Nov 2020 01:22:22 +0000	[thread overview]
Message-ID: <BYAPR11MB2901875C803B14588DBEA47F89FF0@BYAPR11MB2901.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201119150011.4005300-1-conor.walsh@intel.com>

Hi,


> -----Original Message-----
> From: Walsh, Conor <conor.walsh@intel.com>
> Sent: Thursday, November 19, 2020 23:00
> To: Xu, Rosen <rosen.xu@intel.com>; Zhang, Tianfei
> <tianfei.zhang@intel.com>; Pei, Andy <andy.pei@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Chen, LingliX <linglix.chen@intel.com>;
> Walsh, Conor <conor.walsh@intel.com>
> Subject: [PATCH] raw/ifpga/base: fix uninitialized variables gcc warning
> 
> On Ubuntu 18.04 using gcc 7.5, gcc sees size and start as possibly being
> uninitialized. This patch initialises size and start to correct this warning.
> 
> Exact warning:
> ../drivers/raw/ifpga/base/opae_intel_max10.c:488:22: warning: ‘size’
> may be used uninitialized in this function [-Wmaybe-uninitialized]
> raw->regs[i].size = size;
> ../drivers/raw/ifpga/base/opae_intel_max10.c:484:25: warning: ‘start’
> may be used uninitialized in this function [-Wmaybe-uninitialized]
> raw->regs[i].regoff = start;
> 
> Fixes: 45f301724ba7 ("raw/ifpga/base: support sensor")
> 
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> ---
>  drivers/raw/ifpga/base/opae_intel_max10.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga/base/opae_intel_max10.c
> b/drivers/raw/ifpga/base/opae_intel_max10.c
> index 1a526ea549..1c12a85195 100644
> --- a/drivers/raw/ifpga/base/opae_intel_max10.c
> +++ b/drivers/raw/ifpga/base/opae_intel_max10.c
> @@ -418,7 +418,7 @@ max10_sensor_init(struct intel_max10_device *dev,
> int parent)
>  	int i, ret = 0, offset = 0;
>  	const fdt32_t *num;
>  	const char *ptr;
> -	u64 start, size;
> +	u64 start = 0, size = 0;
>  	struct raw_sensor_info *raw;
>  	struct opae_sensor_info *sensor;
>  	char *fdt_root = dev->fdt_root;
> --
> 2.25.1

Reviewed-by: Rosen Xu <rosen.xu@intel.com>

  reply	other threads:[~2020-11-20  1:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:00 Conor Walsh
2020-11-20  1:22 ` Xu, Rosen [this message]
2020-11-23 17:18   ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2020-11-20  7:28 ` [dpdk-stable] " Chen, LingliX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB2901875C803B14588DBEA47F89FF0@BYAPR11MB2901.namprd11.prod.outlook.com \
    --to=rosen.xu@intel.com \
    --cc=andy.pei@intel.com \
    --cc=conor.walsh@intel.com \
    --cc=dev@dpdk.org \
    --cc=linglix.chen@intel.com \
    --cc=stable@dpdk.org \
    --cc=tianfei.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).