projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fce2145
)
ppp: use vmalloc_array() to simplify code
author
Qianfeng Rong
<rongqianfeng@vivo.com>
Sat, 16 Aug 2025 09:06:54 +0000
(17:06 +0800)
committer
Jakub Kicinski
<kuba@kernel.org>
Tue, 19 Aug 2025 00:49:52 +0000
(17:49 -0700)
Remove array_size() calls and replace vmalloc() with vmalloc_array() in
bsd_alloc().
vmalloc_array() is also optimized better, resulting in less instructions
being used.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Link:
https://patch.msgid.link/20250816090659.117699-4-rongqianfeng@vivo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ppp/bsd_comp.c
patch
|
blob
|
history
diff --git
a/drivers/net/ppp/bsd_comp.c
b/drivers/net/ppp/bsd_comp.c
index
5595459
..
f385b75
100644
(file)
--- a/
drivers/net/ppp/bsd_comp.c
+++ b/
drivers/net/ppp/bsd_comp.c
@@
-406,7
+406,7
@@
static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
* Allocate space for the dictionary. This may be more than one page in
* length.
*/
- db->dict = vmalloc
(array_size(hsize, sizeof(struct bsd_dict)
));
+ db->dict = vmalloc
_array(hsize, sizeof(struct bsd_dict
));
if (!db->dict)
{
bsd_free (db);
@@
-425,7
+425,7
@@
static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
*/
else
{
- db->lens = vmalloc
(array_size(sizeof(db->lens[0]), (maxmaxcode + 1)
));
+ db->lens = vmalloc
_array(maxmaxcode + 1, sizeof(db->lens[0]
));
if (!db->lens)
{
bsd_free (db);