Skip to content

Commit

Permalink
Merge tag 'unicode-next-6.13' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/krisman/unicode

Pull unicode updates from Gabriel Krisman Bertazi:

 - constify a read-only struct (Thomas Weißschuh)

 - fix the error path of unicode_load, avoiding a possible kernel oops
   if it fails to find the unicode module (André Almeida)

 - documentation fix, updating a filename in the README (Gan Jie)

 - add the link of my tree to MAINTAINERS (André Almeida)

* tag 'unicode-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode:
  MAINTAINERS: Add Unicode tree
  unicode: change the reference of database file
  unicode: Fix utf8_load() error path
  unicode: constify utf8 data table
  • Loading branch information
Linus Torvalds committed Nov 23, 2024
2 parents 980f8f8 + 6b56a63 commit 060fc10
Showing 6 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -23925,6 +23925,7 @@ UNICODE SUBSYSTEM
M: Gabriel Krisman Bertazi <krisman@kernel.org>
L: linux-fsdevel@vger.kernel.org
S: Supported
T: git git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode.git
F: fs/unicode/

UNIFDEF
8 changes: 4 additions & 4 deletions fs/unicode/README.utf8data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The utf8data.h file in this directory is generated from the Unicode
The utf8data.c file in this directory is generated from the Unicode
Character Database for version 12.1.0 of the Unicode standard.

The full set of files can be found here:
@@ -45,13 +45,13 @@ Then, build under fs/unicode/ with REGENERATE_UTF8DATA=1:

make REGENERATE_UTF8DATA=1 fs/unicode/

After sanity checking the newly generated utf8data.h file (the
After sanity checking the newly generated utf8data.c file (the
version generated from the 12.1.0 UCD should be 4,109 lines long, and
have a total size of 324k) and/or comparing it with the older version
of utf8data.h_shipped, rename it to utf8data.h_shipped.
of utf8data.c_shipped, rename it to utf8data.c_shipped.

If you are a kernel developer updating to a newer version of the
Unicode Character Database, please update this README.utf8data file
with the version of the UCD that was used, the md5sum and sha1sums of
the *.txt files, before checking in the new versions of the utf8data.h
the *.txt files, before checking in the new versions of the utf8data.c
and README.utf8data files.
4 changes: 2 additions & 2 deletions fs/unicode/mkutf8data.c
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
#define FOLD_NAME "CaseFolding.txt"
#define NORM_NAME "NormalizationCorrections.txt"
#define TEST_NAME "NormalizationTest.txt"
#define UTF8_NAME "utf8data.h"
#define UTF8_NAME "utf8data.c"

const char *age_name = AGE_NAME;
const char *ccc_name = CCC_NAME;
@@ -3269,7 +3269,7 @@ static void write_file(void)
}
fprintf(file, "};\n");
fprintf(file, "\n");
fprintf(file, "struct utf8data_table utf8_data_table = {\n");
fprintf(file, "const struct utf8data_table utf8_data_table = {\n");
fprintf(file, "\t.utf8agetab = utf8agetab,\n");
fprintf(file, "\t.utf8agetab_size = ARRAY_SIZE(utf8agetab),\n");
fprintf(file, "\n");
2 changes: 1 addition & 1 deletion fs/unicode/utf8-core.c
Original file line number Diff line number Diff line change
@@ -198,7 +198,7 @@ struct unicode_map *utf8_load(unsigned int version)
return um;

out_symbol_put:
symbol_put(um->tables);
symbol_put(utf8_data_table);
out_free_um:
kfree(um);
return ERR_PTR(-EINVAL);
2 changes: 1 addition & 1 deletion fs/unicode/utf8data.c_shipped
Original file line number Diff line number Diff line change
@@ -4096,7 +4096,7 @@ static const unsigned char utf8data[64080] = {
0x80,0xcf,0x86,0x85,0x84,0xcf,0x86,0xcf,0x06,0x02,0x00,0x00,0x00,0x00,0x00,0x00
};

struct utf8data_table utf8_data_table = {
const struct utf8data_table utf8_data_table = {
.utf8agetab = utf8agetab,
.utf8agetab_size = ARRAY_SIZE(utf8agetab),

2 changes: 1 addition & 1 deletion fs/unicode/utf8n.h
Original file line number Diff line number Diff line change
@@ -78,6 +78,6 @@ struct utf8data_table {
const unsigned char *utf8data;
};

extern struct utf8data_table utf8_data_table;
extern const struct utf8data_table utf8_data_table;

#endif /* UTF8NORM_H */

0 comments on commit 060fc10

Please sign in to comment.