From: Jack Stone <jwjstone@fastmail.fm>
To: viresh kumar <viresh.kumar@st.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] fs/eventpoll.c: fix compilation warning
Date: Fri, 14 Jan 2011 10:55:14 +0000 [thread overview]
Message-ID: <4D302B92.902@fastmail.fm> (raw)
In-Reply-To: <4D30198D.9080206@st.com>
On 14/01/2011 09:38, viresh kumar wrote:
> On 01/14/2011 03:03 PM, Jack Stone wrote:
>>>> - long slack;
>>>> + long slack = 0;
>>>> wait_queue_t wait;
>>>> struct timespec end_time;
>>>> ktime_t expires, *to = NULL;
>> I don't think this is the correct fix. This function is fine unless timeout is negative.
>>
>> If a negative timeout is possible then this function will create timer far in the future.
>> I'll leave it up to the maintainer how to solve that one. The two solutions I can see are making
>> timeout unsigned or extending the bottom case of the if to <=0.
>>
>> Either way we should use uninitalized_var() rather than setting it to zero.
>
> Using uninitialized var gives compilation warning, How should we fix that.
>
I meant something like
- long slack;
+ long uninitialized_var(slack);
I just had a go at generating this warning and couldn't. I've tried GCC
4.4.5 (From Fedora 13) and latest sparse.
Thanks,
Jack
next prev parent reply other threads:[~2011-01-14 10:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 7:15 [PATCH] fs/eventpoll.c: fix compilation warning Viresh Kumar
2011-01-14 9:33 ` Jack Stone
2011-01-14 9:38 ` viresh kumar
2011-01-14 10:55 ` Jack Stone [this message]
2011-01-14 11:12 ` viresh kumar
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=4D302B92.902@fastmail.fm \
--to=jwjstone@fastmail.fm \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viresh.kumar@st.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).