提交 c573f73c 编写于 作者: J Jesper Juhl 提交者: David S. Miller

[NET]: Avoid pointless allocation casts in BSD compression module

The general kernel memory allocation functions return void pointers
and there is no need to cast their return values.
Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 901ded25
......@@ -406,8 +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 = (struct bsd_dict *) vmalloc (hsize *
sizeof (struct bsd_dict));
db->dict = vmalloc(hsize * sizeof(struct bsd_dict));
if (!db->dict)
{
bsd_free (db);
......@@ -426,8 +425,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
*/
else
{
db->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
sizeof (db->lens[0]));
db->lens = vmalloc((maxmaxcode + 1) * sizeof(db->lens[0]));
if (!db->lens)
{
bsd_free (db);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册