all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob a0df8c3763606905deb20e84ebabd31c0ecdd257 1921 bytes (raw)
name: gnu/packages/patches/linux-libre-arm64-pinenote-battery-level.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
From 822294664906499682b55264ae0553ee05caa352 Mon Sep 17 00:00:00 2001
From: Dorian Rudolph <mail@dorianrudolph.com>
Date: Sat, 14 May 2022 14:28:37 +0200
Subject: [PATCH] fix power_supply_temp2resist_simple and
 power_supply_ocv2cap_simple

---
 drivers/power/supply/power_supply_core.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index ec838c9bcc0a5e..3828ba9d0eab90 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -801,17 +801,17 @@ int power_supply_temp2resist_simple(struct power_supply_resistance_temp_table *t
 {
 	int i, high, low;
 
-	/* Break loop at table_len - 1 because that is the highest index */
-	for (i = 0; i < table_len - 1; i++)
+	for (i = 0; i < table_len; i++)
 		if (temp > table[i].temp)
 			break;
 
 	/* The library function will deal with high == low */
-	if ((i == 0) || (i == (table_len - 1)))
-		high = i;
+	if (i == 0)
+		high = low = i;
+	else if (i == table_len)
+		high = low = i - 1;
 	else
-		high = i - 1;
-	low = i;
+		high = (low = i) - 1;
 
 	return fixp_linear_interpolate(table[low].temp,
 				       table[low].resistance,
@@ -838,17 +838,17 @@ int power_supply_ocv2cap_simple(struct power_supply_battery_ocv_table *table,
 {
 	int i, high, low;
 
-	/* Break loop at table_len - 1 because that is the highest index */
-	for (i = 0; i < table_len - 1; i++)
+	for (i = 0; i < table_len; i++)
 		if (ocv > table[i].ocv)
 			break;
 
 	/* The library function will deal with high == low */
-	if ((i == 0) || (i == (table_len - 1)))
-		high = i - 1;
+	if (i == 0)
+		high = low = i;
+	else if (i == table_len)
+		high = low = i - 1;
 	else
-		high = i; /* i.e. i == 0 */
-	low = i;
+		high = (low = i) - 1;
 
 	return fixp_linear_interpolate(table[low].ocv,
 				       table[low].capacity,

debug log:

solving a0df8c3763 ...
found a0df8c3763 in https://yhetil.org/guix/OIYFBlSAc3AtEGSihoRRRjvGJ5cVaAohjF03EWQFDIiKgUINx3vm2xY-8IXvkFs-ZOPh6Yvohd7WoaKiRCREFIf3c_BkPJ11GiJBjhtAOQQ=@protonmail.com/ ||
	https://yhetil.org/guix/MXYIbrOGPKv1gj_NgM0E0qrQaFByQZqAQP57nzG-jeBaqBYVmXEVGOlzafIk0niSTn9jL0Tv9qg5Pkd08nfqejaWrskSAFqpzMKiU68pALQ=@protonmail.com/

applying [1/1] https://yhetil.org/guix/OIYFBlSAc3AtEGSihoRRRjvGJ5cVaAohjF03EWQFDIiKgUINx3vm2xY-8IXvkFs-ZOPh6Yvohd7WoaKiRCREFIf3c_BkPJ11GiJBjhtAOQQ=@protonmail.com/
diff --git a/gnu/packages/patches/linux-libre-arm64-pinenote-battery-level.patch b/gnu/packages/patches/linux-libre-arm64-pinenote-battery-level.patch
new file mode 100644
index 0000000000..a0df8c3763

1:23: space before tab in indent.
 	int i, high, low;
1:24: trailing whitespace.
 
1:28: space before tab in indent.
 		if (temp > table[i].temp)
1:29: space before tab in indent.
 			break;
1:30: trailing whitespace.
 
Checking patch gnu/packages/patches/linux-libre-arm64-pinenote-battery-level.patch...
Applied patch gnu/packages/patches/linux-libre-arm64-pinenote-battery-level.patch cleanly.
warning: squelched 15 whitespace errors
warning: 20 lines add whitespace errors.

skipping https://yhetil.org/guix/MXYIbrOGPKv1gj_NgM0E0qrQaFByQZqAQP57nzG-jeBaqBYVmXEVGOlzafIk0niSTn9jL0Tv9qg5Pkd08nfqejaWrskSAFqpzMKiU68pALQ=@protonmail.com/ for a0df8c3763
index at:
100644 a0df8c3763606905deb20e84ebabd31c0ecdd257	gnu/packages/patches/linux-libre-arm64-pinenote-battery-level.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.