Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaGarg8 authored Feb 22, 2025
1 parent e8378a7 commit 034ddeb
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions 1012-lib-vsprintf-Add-support-for-generic-FOURCCs-by-exte.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d6452703245230953308b46bc920db8f176ea5d6 Mon Sep 17 00:00:00 2001
From 035a518f663a2f5e60975f26e7cc477ba260a1ed Mon Sep 17 00:00:00 2001
From: Hector Martin <[email protected]>
Date: Tue, 8 Nov 2022 16:33:22 +0000
Subject: [PATCH 2/3] lib/vsprintf: Add support for generic FOURCCs by
Expand All @@ -24,11 +24,11 @@ value).
Signed-off-by: Hector Martin <[email protected]>
Signed-off-by: Aditya Garg <[email protected]>
---
Documentation/core-api/printk-formats.rst | 32 +++++++++++
lib/test_printf.c | 39 +++++++++++---
lib/vsprintf.c | 66 ++++++++++++++++++++---
Documentation/core-api/printk-formats.rst | 32 ++++++++++
lib/test_printf.c | 39 +++++++++---
lib/vsprintf.c | 72 ++++++++++++++++++++---
scripts/checkpatch.pl | 2 +-
4 files changed, 124 insertions(+), 15 deletions(-)
4 files changed, 128 insertions(+), 17 deletions(-)

diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
index ecccc0473..9982861fa 100644
Expand Down Expand Up @@ -132,10 +132,10 @@ index 59dbe4f9a..056929c06 100644

static void __init
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 56fe96319..7ec7218bb 100644
index 56fe96319..42d4809af 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1781,31 +1781,83 @@ char *fourcc_string(char *buf, char *end, const u32 *fourcc,
@@ -1781,31 +1781,85 @@ char *fourcc_string(char *buf, char *end, const u32 *fourcc,
char output[sizeof("0123 little-endian (0x01234567)")];
char *p = output;
unsigned int i;
Expand Down Expand Up @@ -183,17 +183,21 @@ index 56fe96319..7ec7218bb 100644
+ case 'r':
+ case 'c':
+ unsigned char c = val >> ((3 - i) * 8);

- /* Print non-control ASCII characters as-is, dot otherwise */
- *p++ = isascii(c) && isprint(c) ? c : '.';
+ /* Print non-control ASCII characters as-is, dot otherwise */
+ *p++ = isascii(c) && isprint(c) ? c : '.';
+ break;
+ case 'l':
+ unsigned char c = orig_le >> ((3 - i) * 8);
+ unsigned char c_le = orig_le >> ((3 - i) * 8);
+ *p++ = isascii(c_le) && isprint(c_le) ? c_le : '.';
+ break;
+ case 'b':
+ unsigned char c = orig_be >> ((3 - i) * 8);
+ unsigned char c_be = orig_be >> ((3 - i) * 8);
+ *p++ = isascii(c_be) && isprint(c_be) ? c_be : '.';
+ break;
+ }

/* Print non-control ASCII characters as-is, dot otherwise */
*p++ = isascii(c) && isprint(c) ? c : '.';
}

- *p++ = ' ';
Expand Down

0 comments on commit 034ddeb

Please sign in to comment.