public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Pagano" <mpagano@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/linux-patches:6.6 commit in: /
Date: Tue,  6 Feb 2024 15:34:45 +0000 (UTC)	[thread overview]
Message-ID: <1707233666.a1866d237318ab644beeacf8aa82c9422a353970.mpagano@gentoo> (raw)

commit:     a1866d237318ab644beeacf8aa82c9422a353970
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  6 15:34:26 2024 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Tue Feb  6 15:34:26 2024 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=a1866d23

media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c)

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README                                        |   4 +
 ...zes-only-if-Secure-Simple-Pairing-enabled.patch | 105 ++++++++++++++-------
 2 files changed, 73 insertions(+), 36 deletions(-)

diff --git a/0000_README b/0000_README
index f2e7d99c..89d72103 100644
--- a/0000_README
+++ b/0000_README
@@ -123,6 +123,10 @@ Patch:  2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
 From:   https://lore.kernel.org/linux-bluetooth/20190522070540.48895-1-marcel@holtmann.org/raw
 Desc:   Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. See bug #686758
 
+Patch:  2700_solo6x10-mem-resource-reduction-fix.patch
+From:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+Desc:   media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c)
+
 Patch:  2800_amdgpu-Adj-kmalloc-array-calls-for-new-Walloc-size.patch
 From:   sam@gentoo.org
 Desc:   amdgpu: Adjust kmalloc_array calls for new -Walloc-size

diff --git a/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch b/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
index 394ad48f..a0b55a8c 100644
--- a/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
+++ b/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
@@ -1,37 +1,70 @@
-The encryption is only mandatory to be enforced when both sides are using
-Secure Simple Pairing and this means the key size check makes only sense
-in that case.
-
-On legacy Bluetooth 2.0 and earlier devices like mice the encryption was
-optional and thus causing an issue if the key size check is not bound to
-using Secure Simple Pairing.
-
-Fixes: d5bb334a8e17 ("Bluetooth: Align minimum encryption key size for LE and BR/EDR connections")
-Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-Cc: stable@vger.kernel.org
----
- net/bluetooth/hci_conn.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
-index 3cf0764d5793..7516cdde3373 100644
---- a/net/bluetooth/hci_conn.c
-+++ b/net/bluetooth/hci_conn.c
-@@ -1272,8 +1272,13 @@ int hci_conn_check_link_mode(struct hci_conn *conn)
- 			return 0;
- 	}
- 
--	if (hci_conn_ssp_enabled(conn) &&
--	    !test_bit(HCI_CONN_ENCRYPT, &conn->flags))
-+	/* If Secure Simple Pairing is not enabled, then legacy connection
-+	 * setup is used and no encryption or key sizes can be enforced.
-+	 */
-+	if (!hci_conn_ssp_enabled(conn))
-+		return 1;
-+
-+	if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags))
- 		return 0;
- 
- 	/* The minimum encryption key size needs to be enforced by the
+diff --git a/2700_solo6x10-mem-resource-reduction-fix.patch b/2700_solo6x10-mem-resource-reduction-fix.patch
+new file mode 100644
+index 00000000..bf406a92
+--- /dev/null
++++ b/2700_solo6x10-mem-resource-reduction-fix.patch
+@@ -0,0 +1,61 @@
++From 31e97d7c9ae3de072d7b424b2cf706a03ec10720 Mon Sep 17 00:00:00 2001
++From: Aurelien Jarno <aurelien@aurel32.net>
++Date: Sat, 13 Jan 2024 19:33:31 +0100
++Subject: media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c)
++
++This patch replaces max(a, min(b, c)) by clamp(b, a, c) in the solo6x10
++driver.  This improves the readability and more importantly, for the
++solo6x10-p2m.c file, this reduces on my system (x86-64, gcc 13):
++
++ - the preprocessed size from 121 MiB to 4.5 MiB;
++
++ - the build CPU time from 46.8 s to 1.6 s;
++
++ - the build memory from 2786 MiB to 98MiB.
++
++In fine, this allows this relatively simple C file to be built on a
++32-bit system.
++
++Reported-by: Jiri Slaby <jirislaby@gmail.com>
++Closes: https://lore.kernel.org/lkml/18c6df0d-45ed-450c-9eda-95160a2bbb8e@gmail.com/
++Cc:  <stable@vger.kernel.org> # v6.7+
++Suggested-by: David Laight <David.Laight@ACULAB.COM>
++Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
++Reviewed-by: David Laight <David.Laight@ACULAB.COM>
++Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
++Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
++---
++ drivers/media/pci/solo6x10/solo6x10-offsets.h | 10 +++++-----
++ 1 file changed, 5 insertions(+), 5 deletions(-)
++
++(limited to 'drivers/media/pci/solo6x10/solo6x10-offsets.h')
++
++diff --git a/drivers/media/pci/solo6x10/solo6x10-offsets.h b/drivers/media/pci/solo6x10/solo6x10-offsets.h
++index f414ee1316f29c..fdbb817e63601c 100644
++--- a/drivers/media/pci/solo6x10/solo6x10-offsets.h
+++++ b/drivers/media/pci/solo6x10/solo6x10-offsets.h
++@@ -57,16 +57,16 @@
++ #define SOLO_MP4E_EXT_ADDR(__solo) \
++ 	(SOLO_EREF_EXT_ADDR(__solo) + SOLO_EREF_EXT_AREA(__solo))
++ #define SOLO_MP4E_EXT_SIZE(__solo) \
++-	max((__solo->nr_chans * 0x00080000),				\
++-	    min(((__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo)) -	\
++-		 __SOLO_JPEG_MIN_SIZE(__solo)), 0x00ff0000))
+++	clamp(__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo) -	\
+++	      __SOLO_JPEG_MIN_SIZE(__solo),			\
+++	      __solo->nr_chans * 0x00080000, 0x00ff0000)
++ 
++ #define __SOLO_JPEG_MIN_SIZE(__solo)		(__solo->nr_chans * 0x00080000)
++ #define SOLO_JPEG_EXT_ADDR(__solo) \
++ 		(SOLO_MP4E_EXT_ADDR(__solo) + SOLO_MP4E_EXT_SIZE(__solo))
++ #define SOLO_JPEG_EXT_SIZE(__solo) \
++-	max(__SOLO_JPEG_MIN_SIZE(__solo),				\
++-	    min((__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo)), 0x00ff0000))
+++	clamp(__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo),	\
+++	      __SOLO_JPEG_MIN_SIZE(__solo), 0x00ff0000)
++ 
++ #define SOLO_SDRAM_END(__solo) \
++ 	(SOLO_JPEG_EXT_ADDR(__solo) + SOLO_JPEG_EXT_SIZE(__solo))
++-- 
++cgit 1.2.3-korg
++
 -- 
-2.20.1
+cgit v1.2.3
+


             reply	other threads:[~2024-02-06 15:34 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 15:34 Mike Pagano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-08 16:30 [gentoo-commits] proj/linux-patches:6.6 commit in: / Mike Pagano
2024-11-04 20:46 Mike Pagano
2024-11-03 11:26 Mike Pagano
2024-11-01 12:02 Mike Pagano
2024-11-01 11:52 Mike Pagano
2024-11-01 11:27 Mike Pagano
2024-10-26 22:46 Mike Pagano
2024-10-25 11:44 Mike Pagano
2024-10-22 16:57 Mike Pagano
2024-10-17 14:28 Mike Pagano
2024-10-17 14:05 Mike Pagano
2024-10-10 11:37 Mike Pagano
2024-10-04 15:23 Mike Pagano
2024-09-30 16:04 Mike Pagano
2024-09-30 15:18 Mike Pagano
2024-09-18 18:03 Mike Pagano
2024-09-12 12:32 Mike Pagano
2024-09-08 11:06 Mike Pagano
2024-09-04 13:51 Mike Pagano
2024-08-29 16:49 Mike Pagano
2024-08-19 10:24 Mike Pagano
2024-08-14 15:14 Mike Pagano
2024-08-14 14:51 Mike Pagano
2024-08-14 14:10 Mike Pagano
2024-08-11 13:28 Mike Pagano
2024-08-10 15:43 Mike Pagano
2024-08-03 15:22 Mike Pagano
2024-07-27 13:46 Mike Pagano
2024-07-25 15:48 Mike Pagano
2024-07-25 12:09 Mike Pagano
2024-07-18 12:15 Mike Pagano
2024-07-15 11:15 Mike Pagano
2024-07-11 11:48 Mike Pagano
2024-07-09 10:45 Mike Pagano
2024-07-05 10:49 Mike Pagano
2024-06-27 12:32 Mike Pagano
2024-06-21 14:06 Mike Pagano
2024-06-16 14:33 Mike Pagano
2024-06-12 10:23 Mike Pagano
2024-05-25 15:17 Mike Pagano
2024-05-17 11:49 Mike Pagano
2024-05-17 11:35 Mike Pagano
2024-05-05 18:06 Mike Pagano
2024-05-02 15:01 Mike Pagano
2024-04-27 22:05 Mike Pagano
2024-04-27 17:21 Mike Pagano
2024-04-27 17:05 Mike Pagano
2024-04-18  6:38 Alice Ferrazzi
2024-04-18  3:05 Alice Ferrazzi
2024-04-13 13:06 Mike Pagano
2024-04-11 14:49 Mike Pagano
2024-04-10 15:09 Mike Pagano
2024-04-04 19:06 Mike Pagano
2024-04-03 14:03 Mike Pagano
2024-03-27 11:24 Mike Pagano
2024-03-15 22:00 Mike Pagano
2024-03-06 18:07 Mike Pagano
2024-03-02 22:37 Mike Pagano
2024-03-01 13:06 Mike Pagano
2024-02-23 13:25 Mike Pagano
2024-02-23 12:36 Mike Pagano
2024-02-22 13:39 Mike Pagano
2024-02-16 19:06 Mike Pagano
2024-02-16 18:59 Mike Pagano
2024-02-06 17:27 Mike Pagano
2024-02-06 15:38 Mike Pagano
2024-02-05 21:04 Mike Pagano
2024-02-05 21:00 Mike Pagano
2024-02-01 23:18 Mike Pagano
2024-02-01  1:22 Mike Pagano
2024-01-26 22:48 Mike Pagano
2024-01-26  0:08 Mike Pagano
2024-01-25 13:49 Mike Pagano
2024-01-20 11:45 Mike Pagano
2024-01-15 18:46 Mike Pagano
2024-01-10 17:20 Mike Pagano
2024-01-10 17:16 Mike Pagano
2024-01-05 14:49 Mike Pagano
2024-01-04 15:36 Mike Pagano
2024-01-01 13:45 Mike Pagano
2023-12-20 16:55 Mike Pagano
2023-12-17 14:55 Mike Pagano
2023-12-13 18:26 Mike Pagano
2023-12-11 14:19 Mike Pagano
2023-12-08 12:01 Mike Pagano
2023-12-08 10:54 Mike Pagano
2023-12-07 18:53 Mike Pagano
2023-12-03 11:24 Mike Pagano
2023-12-03 11:15 Mike Pagano
2023-12-01 10:31 Mike Pagano
2023-11-28 18:16 Mike Pagano
2023-11-28 17:50 Mike Pagano
2023-11-20 11:40 Mike Pagano
2023-11-19 15:18 Mike Pagano
2023-11-19 14:41 Mike Pagano
2023-11-08 11:52 Mike Pagano
2023-10-30 11:30 Mike Pagano

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=1707233666.a1866d237318ab644beeacf8aa82c9422a353970.mpagano@gentoo \
    --to=mpagano@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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