Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH v3]mempool.c : clean up type-casting twice

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


figo1802 at gmail

Jul 5, 2009, 2:01 AM

Post #1 of 3 (178 views)
Permalink
[PATCH v3]mempool.c : clean up type-casting twice

clean up type-casting twice. "size_t" typedef as "unsigned long" in 64-bit system,
and "unsigned int" in 32-bit system.

in v3, remove the space to casts.

Signed-off-by: Figo.zhang <figo1802 [at] gmail>
---
mm/mempool.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/mempool.c b/mm/mempool.c
index a46eb1b..32e75d4 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -303,14 +303,14 @@ EXPORT_SYMBOL(mempool_free_slab);
*/
void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data)
{
- size_t size = (size_t)(long)pool_data;
+ size_t size = (size_t)pool_data;
return kmalloc(size, gfp_mask);
}
EXPORT_SYMBOL(mempool_kmalloc);

void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data)
{
- size_t size = (size_t) pool_data;
+ size_t size = (size_t)pool_data;
return kzalloc(size, gfp_mask);
}
EXPORT_SYMBOL(mempool_kzalloc);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


mingo at elte

Jul 5, 2009, 2:04 AM

Post #2 of 3 (174 views)
Permalink
Re: [PATCH v3]mempool.c : clean up type-casting twice [In reply to]

* Figo.zhang <figo1802 [at] gmail> wrote:

> clean up type-casting twice. "size_t" typedef as "unsigned long" in 64-bit system,
> and "unsigned int" in 32-bit system.

[.
You should line-length limit your changelogs btw., to 60
characters or so. git log will add another 4 characters. The
~/.vimrc magic for this is:

autocmd BufNewFile,BufRead *.patch setlocal textwidth=60
]

>
> in v3, remove the space to casts.
>
> Signed-off-by: Figo.zhang <figo1802 [at] gmail>
> ---
> mm/mempool.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/mempool.c b/mm/mempool.c
> index a46eb1b..32e75d4 100644
> --- a/mm/mempool.c
> +++ b/mm/mempool.c
> @@ -303,14 +303,14 @@ EXPORT_SYMBOL(mempool_free_slab);
> */
> void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data)
> {
> - size_t size = (size_t)(long)pool_data;
> + size_t size = (size_t)pool_data;
> return kmalloc(size, gfp_mask);
> }
> EXPORT_SYMBOL(mempool_kmalloc);
>
> void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data)
> {
> - size_t size = (size_t) pool_data;
> + size_t size = (size_t)pool_data;
> return kzalloc(size, gfp_mask);
> }
> EXPORT_SYMBOL(mempool_kzalloc);

Acked-by: Ingo Molnar <mingo [at] elte>

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


figo1802 at gmail

Jul 5, 2009, 2:13 AM

Post #3 of 3 (175 views)
Permalink
Re: [PATCH v3]mempool.c : clean up type-casting twice [In reply to]

On Sun, 2009-07-05 at 11:04 +0200, Ingo Molnar wrote:
> * Figo.zhang <figo1802 [at] gmail> wrote:
>
> > clean up type-casting twice. "size_t" typedef as "unsigned long" in 64-bit system,
> > and "unsigned int" in 32-bit system.
>
> [.
> You should line-length limit your changelogs btw., to 60
> characters or so. git log will add another 4 characters. The
> ~/.vimrc magic for this is:
>
> autocmd BufNewFile,BufRead *.patch setlocal textwidth=60
> ]

hi,Ingo,

Thanks a lot.

should i motify the log, and send it again?

Best,
Figo.zhang


>
> >
> > in v3, remove the space to casts.
> >
> > Signed-off-by: Figo.zhang <figo1802 [at] gmail>
> > ---
> > mm/mempool.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/mempool.c b/mm/mempool.c
> > index a46eb1b..32e75d4 100644
> > --- a/mm/mempool.c
> > +++ b/mm/mempool.c
> > @@ -303,14 +303,14 @@ EXPORT_SYMBOL(mempool_free_slab);
> > */
> > void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data)
> > {
> > - size_t size = (size_t)(long)pool_data;
> > + size_t size = (size_t)pool_data;
> > return kmalloc(size, gfp_mask);
> > }
> > EXPORT_SYMBOL(mempool_kmalloc);
> >
> > void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data)
> > {
> > - size_t size = (size_t) pool_data;
> > + size_t size = (size_t)pool_data;
> > return kzalloc(size, gfp_mask);
> > }
> > EXPORT_SYMBOL(mempool_kzalloc);
>
> Acked-by: Ingo Molnar <mingo [at] elte>
>
> Ingo

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.