Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cd005ca authored by Dominik Brodowski's avatar Dominik Brodowski
Browse files

cpupowerutils: helpers - ConfigStyle bugfixes

parent b510b541
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static int get_cof(int family, union msr_pstate pstate)
	if (family == 0x11)
		t = 0x8;

	return ((100 * (fid + t)) >> did);
	return (100 * (fid + t)) >> did;
}

/* Needs:
+7 −5
Original line number Diff line number Diff line
@@ -73,7 +73,8 @@ static void _setbit(struct bitmask *bmp, unsigned int n, unsigned int v)
		if (v)
			bmp->maskp[n/bitsperlong] |= 1UL << (n % bitsperlong);
		else
			bmp->maskp[n/bitsperlong] &= ~(1UL << (n % bitsperlong));
			bmp->maskp[n/bitsperlong] &=
				~(1UL << (n % bitsperlong));
	}
}

@@ -251,7 +252,8 @@ static inline int emit(char *buf, int buflen, int rbot, int rtop, int len)
	if (rbot == rtop)
		len += snprintf(buf + len, max(buflen - len, 0), "%d", rbot);
	else
		len += snprintf(buf + len, max(buflen - len, 0), "%d-%d", rbot, rtop);
		len += snprintf(buf + len, max(buflen - len, 0), "%d-%d",
				rbot, rtop);
	return len;
}

+6 −8
Original line number Diff line number Diff line
@@ -67,28 +67,26 @@ int get_cpu_info(unsigned int cpu, struct cpupower_cpu_info *cpu_info)
			continue;
		value[63 - 1] = '\0';

		if (!strncmp(value, "processor\t: ", 12)) {
		if (!strncmp(value, "processor\t: ", 12))
			sscanf(value, "processor\t: %u", &proc);
		}

		if (proc != cpu)
			continue;

		/* Get CPU vendor */
		if (!strncmp(value, "vendor_id", 9))
		if (!strncmp(value, "vendor_id", 9)) {
			for (x = 1; x < X86_VENDOR_MAX; x++) {
				if (strstr(value, cpu_vendor_table[x]))
					cpu_info->vendor = x;
			}
		/* Get CPU family, etc. */
		else if (!strncmp(value, "cpu family\t: ", 13)) {
		} else if (!strncmp(value, "cpu family\t: ", 13)) {
			sscanf(value, "cpu family\t: %u",
			       &cpu_info->family);
		}
		else if (!strncmp(value, "model\t\t: ", 9)) {
		} else if (!strncmp(value, "model\t\t: ", 9)) {
			sscanf(value, "model\t\t: %u",
			       &cpu_info->model);
		}
		else if (!strncmp(value, "stepping\t: ", 10)) {
		} else if (!strncmp(value, "stepping\t: ", 10)) {
			sscanf(value, "stepping\t: %u",
			       &cpu_info->stepping);

+3 −3
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ extern int be_verbose;
#define dprint(fmt, ...) {					\
		if (be_verbose) {				\
			fprintf(stderr, "%s: " fmt,		\
				__FUNCTION__, ##__VA_ARGS__);	\
				__func__, ##__VA_ARGS__);	\
		}						\
	}
#else
+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@

#include "helpers/helpers.h"

int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active, int * states)
int cpufreq_has_boost_support(unsigned int cpu, int *support, int *active,
			int *states)
{
	struct cpupower_cpu_info cpu_info;
	int ret;
Loading