Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/956561/?format=api
{ "id": 956561, "url": "http://patchwork.ozlabs.org/api/patches/956561/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20180811152820.26817-3-xypron.glpk@gmx.de/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20180811152820.26817-3-xypron.glpk@gmx.de>", "list_archive_url": null, "date": "2018-08-11T15:28:07", "name": "[U-Boot,02/15] efi_loader: rename utf16_strlen, utf16_strnlen", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3c3e6ba7e7130abf797bc288bd7ce23962f4bc75", "submitter": { "id": 61270, "url": "http://patchwork.ozlabs.org/api/people/61270/?format=api", "name": "Heinrich Schuchardt", "email": "xypron.glpk@gmx.de" }, "delegate": { "id": 3400, "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api", "username": "agraf", "first_name": "Alexander", "last_name": "Graf", "email": "agraf@suse.de" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20180811152820.26817-3-xypron.glpk@gmx.de/mbox/", "series": [ { "id": 60397, "url": "http://patchwork.ozlabs.org/api/series/60397/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=60397", "date": "2018-08-11T15:28:06", "name": "efi_loader: EFI_UNICODE_COLLATION_PROTOCOL", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/60397/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/956561/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/956561/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=gmx.de" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 41nmDT1Y8nz9sBD\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 12 Aug 2018 01:31:20 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid B16E5C21DD3; Sat, 11 Aug 2018 15:30:29 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 07490C21E18;\n\tSat, 11 Aug 2018 15:28:50 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 947BFC21D4A; Sat, 11 Aug 2018 15:28:45 +0000 (UTC)", "from mout.gmx.net (mout.gmx.net [212.227.17.20])\n\tby lists.denx.de (Postfix) with ESMTPS id D2B53C21C8B\n\tfor <u-boot@lists.denx.de>; Sat, 11 Aug 2018 15:28:44 +0000 (UTC)", "from LT02.fritz.box ([88.152.14.153]) by mail.gmx.com (mrgmx102\n\t[212.227.17.174]) with ESMTPSA (Nemesis) id 0MY4Ls-1fSdNS045g-00UoXP;\n\tSat, 11 Aug 2018 17:28:42 +0200" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=0.0 required=5.0 tests=FREEMAIL_FROM\n\tautolearn=unavailable autolearn_force=no version=3.4.0", "From": "Heinrich Schuchardt <xypron.glpk@gmx.de>", "To": "Alexander Graf <agraf@suse.de>", "Date": "Sat, 11 Aug 2018 17:28:07 +0200", "Message-Id": "<20180811152820.26817-3-xypron.glpk@gmx.de>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20180811152820.26817-1-xypron.glpk@gmx.de>", "References": "<20180811152820.26817-1-xypron.glpk@gmx.de>", "X-Provags-ID": "V03:K1:xfDuTgJU/geOVKDt5Ip5RY30qrcqizSUbzAETYxdwnuzvaZS9Wk\n\tNWlpgR9ihI/rWvA6kN7UtfrFe+fA18+bunRDLMrpmUidfppEgAay0kd/QtYA6sgfHYCFSGe\n\tPDwMqtId8+zxECPHsftlLcZWShH6q1qpZhD1JBcMUXD+xld/TTnL75zz9qEUsfdzRccuNp1\n\ttBT9eEtMkMlb8b3q3rAOQ==", "X-UI-Out-Filterresults": "notjunk:1; V01:K0:u8oOTeMveTE=:J4CG6lgl5bvXIE/XolhWeR\n\t/I+qtk38/gwy0nv96JcciqwbMgn61CwOWqgZn6jdqSOt+7FJ1oNGJJRoFtHR/HKxbSeBFsita\n\tAy6sbE2yuPcolbzAB4UZT1J3vfZnAuBWBBpWe+Dg8WfRMOX7qQn/MUENLO359jz+cKZsXYHA2\n\tH61BqwpI4V9IapSzKqU1BOch6qendHnhovhsh+uYdXJvZK1asp65m8T9/pnq7M97RbR37rh3W\n\tgRVvGhYCLR2lxXt0RUVx50t3qoz5MSkJpbZjonkdF+LCyucLOLQSc+1QmjCB8pf1nnbBSfkLU\n\tog6MJVRhz6xThZhUowikgGpOqimcA28QlL+rppkz2+XUccL8O4aRCz1cevY90uiZkhkmJodT6\n\tr/0JCVdQ3IfBhNk/1hB8u+sxeNTiTfLLBLqiC6xdFAjiYHRuntAlgPZNOCkPDE2Q2zZn5nG+1\n\tZbkIQn/D9wTFVIy0ucJQ1rCa717Cal7wKWjoZQ3MqpfbMfRjvex8Cp4ASIaIN6rX7bbriirPJ\n\tvcUpxtlVSE+fuzim8U811q1HIfPTY9cKGYoJaPya64V6I8ZA7RbDTx12IxQfEuFevqKJWuQBp\n\tvWZsc/BXxNPtYgcbw0enFG5bnhtzu7hUHrhVDVZ3VqQlQeP7gowXuZmuhW1GTqdWKuRiCgUSq\n\tSqMazJc6+iushzSjFdBKCwvyY9E1IlKkiZ4H+LMl9iZzqd9ZyuUm9d6VdJD1kbf7aVRYjGQoe\n\tSuMeqL3uTvJOsJ4EH576AUjsFtLNPcyNWwn/kzgaOWRPUDDlswdYLTzPSOM=", "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, u-boot@lists.denx.de", "Subject": "[U-Boot] [PATCH 02/15] efi_loader: rename utf16_strlen,\n\tutf16_strnlen", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "The function names utf16_strlen() and utf16_strnlen() are misnomers.\nThe functions do not count utf-16 characters but non-zero words.\nSo let's rename them to u16_strlen and u16_strnlen().\n\nIn utf16_dup() avoid assignment in if clause.\n\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n include/charset.h | 28 +++++++++++-----------------\n lib/charset.c | 10 +++++++---\n lib/efi_loader/efi_bootmgr.c | 2 +-\n lib/efi_loader/efi_console.c | 2 +-\n lib/efi_loader/efi_file.c | 2 +-\n lib/efi_loader/efi_variable.c | 2 +-\n lib/vsprintf.c | 2 +-\n 7 files changed, 23 insertions(+), 25 deletions(-)", "diff": "diff --git a/include/charset.h b/include/charset.h\nindex 11832cbd12..2307559890 100644\n--- a/include/charset.h\n+++ b/include/charset.h\n@@ -13,29 +13,23 @@\n #define MAX_UTF8_PER_UTF16 3\n \n /**\n- * utf16_strlen() - Get the length of an utf16 string\n+ * u16_strlen - count non-zero words\n *\n- * Returns the number of 16 bit characters in an utf16 string, not\n- * including the terminating NULL character.\n- *\n- * @in the string to measure\n- * @return the string length\n+ * @in:\t\t\tutf-16 string\n+ * ReturnValue:\t\tnumber of non-zero words.\n+ *\t\t\tThis is not the number of utf-16 letters!\n */\n-size_t utf16_strlen(const uint16_t *in);\n+size_t u16_strlen(const u16 *in);\n \n /**\n- * utf16_strnlen() - Get the length of a fixed-size utf16 string.\n- *\n- * Returns the number of 16 bit characters in an utf16 string,\n- * not including the terminating NULL character, but at most\n- * 'count' number of characters. In doing this, utf16_strnlen()\n- * looks at only the first 'count' characters.\n+ * u16_strlen - count non-zero words\n *\n- * @in the string to measure\n- * @count the maximum number of characters to count\n- * @return the string length, up to a maximum of 'count'\n+ * @in:\t\t\tutf-16 string\n+ * @count:\t\tmaximum number of words to count\n+ * ReturnValue:\t\tnumber of non-zero words.\n+ *\t\t\tThis is not the number of utf-16 letters!\n */\n-size_t utf16_strnlen(const uint16_t *in, size_t count);\n+size_t u16_strnlen(const u16 *in, size_t count);\n \n /**\n * utf16_strcpy() - UTF16 equivalent of strcpy()\ndiff --git a/lib/charset.c b/lib/charset.c\nindex cd186a5a5a..8ff8d59957 100644\n--- a/lib/charset.c\n+++ b/lib/charset.c\n@@ -12,14 +12,14 @@\n * utf8/utf16 conversion mostly lifted from grub\n */\n \n-size_t utf16_strlen(const uint16_t *in)\n+size_t u16_strlen(const u16 *in)\n {\n \tsize_t i;\n \tfor (i = 0; in[i]; i++);\n \treturn i;\n }\n \n-size_t utf16_strnlen(const uint16_t *in, size_t count)\n+size_t u16_strnlen(const u16 *in, size_t count)\n {\n \tsize_t i;\n \tfor (i = 0; count-- && in[i]; i++);\n@@ -39,7 +39,11 @@ uint16_t *utf16_strcpy(uint16_t *dest, const uint16_t *src)\n uint16_t *utf16_strdup(const uint16_t *s)\n {\n \tuint16_t *new;\n-\tif (!s || !(new = malloc((utf16_strlen(s) + 1) * 2)))\n+\n+\tif (!s)\n+\t\treturn NULL;\n+\tnew = malloc((u16_strlen(s) + 1) * 2);\n+\tif (!new)\n \t\treturn NULL;\n \tutf16_strcpy(new, s);\n \treturn new;\ndiff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c\nindex 853358ab93..0c5764db12 100644\n--- a/lib/efi_loader/efi_bootmgr.c\n+++ b/lib/efi_loader/efi_bootmgr.c\n@@ -60,7 +60,7 @@ static void parse_load_option(struct load_option *lo, void *ptr)\n \tptr += sizeof(u16);\n \n \tlo->label = ptr;\n-\tptr += (utf16_strlen(lo->label) + 1) * 2;\n+\tptr += (u16_strlen(lo->label) + 1) * 2;\n \n \tlo->file_path = ptr;\n \tptr += lo->file_path_length;\ndiff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c\nindex b487288785..f3d612880c 100644\n--- a/lib/efi_loader/efi_console.c\n+++ b/lib/efi_loader/efi_console.c\n@@ -114,7 +114,7 @@ static efi_status_t EFIAPI efi_cout_output_string(\n \n \tEFI_ENTRY(\"%p, %p\", this, string);\n \n-\tunsigned int n16 = utf16_strlen(string);\n+\tunsigned int n16 = u16_strlen(string);\n \tchar buf[MAX_UTF8_PER_UTF16 * n16 + 1];\n \tu16 *p;\n \ndiff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c\nindex e6a15bcb52..c21881b32c 100644\n--- a/lib/efi_loader/efi_file.c\n+++ b/lib/efi_loader/efi_file.c\n@@ -139,7 +139,7 @@ static struct efi_file_handle *file_open(struct file_system *fs,\n \n \tif (file_name) {\n \t\tutf16_to_utf8((u8 *)f0, (u16 *)file_name, 1);\n-\t\tflen = utf16_strlen((u16 *)file_name);\n+\t\tflen = u16_strlen((u16 *)file_name);\n \t}\n \n \t/* we could have a parent, but also an absolute path: */\ndiff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c\nindex 90b637215e..770c67abb9 100644\n--- a/lib/efi_loader/efi_variable.c\n+++ b/lib/efi_loader/efi_variable.c\n@@ -106,7 +106,7 @@ static efi_status_t efi_to_native(char *native, u16 *variable_name,\n {\n \tsize_t len;\n \n-\tlen = utf16_strlen((u16 *)variable_name);\n+\tlen = u16_strlen((u16 *)variable_name);\n \tif (len >= MAX_VAR_NAME)\n \t\treturn EFI_DEVICE_ERROR;\n \ndiff --git a/lib/vsprintf.c b/lib/vsprintf.c\nindex 6100357858..a07128ad96 100644\n--- a/lib/vsprintf.c\n+++ b/lib/vsprintf.c\n@@ -280,7 +280,7 @@ static char *string16(char *buf, char *end, u16 *s, int field_width,\n \t\tint precision, int flags)\n {\n \tu16 *str = s ? s : L\"<NULL>\";\n-\tint utf16_len = utf16_strnlen(str, precision);\n+\tint utf16_len = u16_strnlen(str, precision);\n \tu8 utf8[utf16_len * MAX_UTF8_PER_UTF16];\n \tint utf8_len, i;\n \n", "prefixes": [ "U-Boot", "02/15" ] }