Skip to content

Commit

Permalink
cpuidle: CodingStyle: Break up multiple assignments on single line
Browse files Browse the repository at this point in the history
The function get_typical_interval() initializes a number of variables
that are immediately after declarations assigned constant values.
In addition, there are multiple assignments on a single line, which
is explicitly forbidden by Documentation/CodingStyle.

This patch removes redundant initial values for the variables and
breaks up the multiple assignment line.

Signed-off-by: Tuukka Tikkanen <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Tuukka Tikkanen authored and rafaeljw committed Aug 22, 2013
1 parent 0d6a7ff commit 4cd46bc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,17 @@ static u64 div_round64(u64 dividend, u32 divisor)
*/
static void get_typical_interval(struct menu_device *data)
{
int i = 0, divisor = 0;
uint64_t max = 0, avg = 0, stddev = 0;
int i, divisor;
uint64_t max, avg, stddev;
int64_t thresh = LLONG_MAX; /* Discard outliers above this value. */

again:

/* first calculate average and standard deviation of the past */
max = avg = divisor = stddev = 0;
max = 0;
avg = 0;
divisor = 0;
stddev = 0;
for (i = 0; i < INTERVALS; i++) {
int64_t value = data->intervals[i];
if (value <= thresh) {
Expand Down

0 comments on commit 4cd46bc

Please sign in to comment.