public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Caz Yokoyama <Caz.Yokoyama@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH 1/1] lib/vfs_file_max(): initialize static variable
Date: Tue, 16 Apr 2019 08:55:40 -0700	[thread overview]
Message-ID: <e651112e5e85d22bd4a0fef683a5b7e8c16c524e.camel@intel.com> (raw)
In-Reply-To: <515754349d83a31b5ba581aad7ce72ec8a05a366.1555422905.git.caz.yokoyama@intel.com>

Drop.
Static is always initialized to 0, no need to explicitly initialize.
Thank you, Ashutosh.
-caz

On Tue, 2019-04-16 at 06:57 -0700, Caz Yokoyama wrote:
> I believe un-initialized static variable is most probably not zero.
> Correct me if I am wrong.
> 
> Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com>
> ---
>  lib/intel_os.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/intel_os.c b/lib/intel_os.c
> index dd93bea1..a4fe6b34 100644
> --- a/lib/intel_os.c
> +++ b/lib/intel_os.c
> @@ -281,7 +281,7 @@ void *intel_get_total_pinnable_mem(size_t *total)
>  
>  static uint64_t vfs_file_max(void)
>  {
> -	static long long unsigned max;
> +	static long long unsigned max = 0;
>  	if (max == 0) {
>  		FILE *file = fopen("/proc/sys/fs/file-max", "r");
>  		max = 80000;

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-04-16 15:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16 13:57 [igt-dev] [PATCH 1/1] lib/vfs_file_max(): initialize static variable Caz Yokoyama
2019-04-16 14:30 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [1/1] " Patchwork
2019-04-16 15:55 ` Caz Yokoyama [this message]
2019-04-16 20:25 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=e651112e5e85d22bd4a0fef683a5b7e8c16c524e.camel@intel.com \
    --to=caz.yokoyama@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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