[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111219141703.GG16765@erda.amd.com>
Date: Mon, 19 Dec 2011 15:17:03 +0100
From: Robert Richter <robert.richter@....com>
To: Ingo Molnar <mingo@...e.hu>
CC: LKML <linux-kernel@...r.kernel.org>,
oprofile-list <oprofile-list@...ts.sourceforge.net>
Subject: Re: [GIT PULL] oprofile fixes for 3.2
On 19.12.11 15:00:49, Ingo Molnar wrote:
> + if (!count)
> + return 0;
> +
> retval = oprofilefs_ulong_from_user(&value, buf, count);
> if (retval)
> return retval;
>
> See the ugly and fragile pattern?
>
> This should *really* be solved via the
> oprofilefs_ulong_from_user() helper function, not by sprinkling
> the !count checks in half a dozen places ...
Hmm, I thought there was no way to leave the code path with count == 0
and retval. But thinking about it it would be possible with returning
count or errors < 0. Will improve the patch.
Thanks,
-Robert
--
Advanced Micro Devices, Inc.
Operating System Research Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists