* [PATCH] staging/zram: Fix sparse warning 'Using plain integer as NULL pointer'
@ 2010-12-07 22:44 Peter Huewe
2010-12-07 23:09 ` Nitin Gupta
0 siblings, 1 reply; 4+ messages in thread
From: Peter Huewe @ 2010-12-07 22:44 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Pekka Enberg, Nitin Gupta, devel, linux-kernel, Peter Huewe
This patch fixes the warning generated by sparse: "Using plain integer
as NULL pointer" by replacing the offending 0s with NULL.
Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
KernelVersion: linux-next-20101207
drivers/staging/zram/xvmalloc.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/zram/xvmalloc.c b/drivers/staging/zram/xvmalloc.c
index 3fdbb8a..b644067 100644
--- a/drivers/staging/zram/xvmalloc.c
+++ b/drivers/staging/zram/xvmalloc.c
@@ -187,7 +187,7 @@ static void insert_block(struct xv_pool *pool, struct page *page, u32 offset,
slindex = get_index_for_insert(block->size);
flindex = slindex / BITS_PER_LONG;
- block->link.prev_page = 0;
+ block->link.prev_page = NULL;
block->link.prev_offset = 0;
block->link.next_page = pool->freelist[slindex].page;
block->link.next_offset = pool->freelist[slindex].offset;
@@ -217,7 +217,7 @@ static void remove_block_head(struct xv_pool *pool,
pool->freelist[slindex].page = block->link.next_page;
pool->freelist[slindex].offset = block->link.next_offset;
- block->link.prev_page = 0;
+ block->link.prev_page = NULL;
block->link.prev_offset = 0;
if (!pool->freelist[slindex].page) {
@@ -232,7 +232,7 @@ static void remove_block_head(struct xv_pool *pool,
*/
tmpblock = get_ptr_atomic(pool->freelist[slindex].page,
pool->freelist[slindex].offset, KM_USER1);
- tmpblock->link.prev_page = 0;
+ tmpblock->link.prev_page = NULL;
tmpblock->link.prev_offset = 0;
put_ptr_atomic(tmpblock, KM_USER1);
}
--
1.7.2.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] staging/zram: Fix sparse warning 'Using plain integer as NULL pointer'
2010-12-07 22:44 [PATCH] staging/zram: Fix sparse warning 'Using plain integer as NULL pointer' Peter Huewe
@ 2010-12-07 23:09 ` Nitin Gupta
2010-12-08 22:30 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Nitin Gupta @ 2010-12-07 23:09 UTC (permalink / raw)
To: Peter Huewe; +Cc: Greg Kroah-Hartman, Pekka Enberg, devel, linux-kernel
On 12/7/2010 5:44 PM, Peter Huewe wrote:
> This patch fixes the warning generated by sparse: "Using plain integer
> as NULL pointer" by replacing the offending 0s with NULL.
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Thanks for the fix. I see that it's already fixed in the
project internal repo but I somehow missed sending it to
mainline.
Nitin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging/zram: Fix sparse warning 'Using plain integer as NULL pointer'
2010-12-07 23:09 ` Nitin Gupta
@ 2010-12-08 22:30 ` Greg KH
2010-12-08 22:47 ` Nitin Gupta
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2010-12-08 22:30 UTC (permalink / raw)
To: Nitin Gupta
Cc: Peter Huewe, Greg Kroah-Hartman, Pekka Enberg, devel,
linux-kernel
On Tue, Dec 07, 2010 at 06:09:22PM -0500, Nitin Gupta wrote:
> On 12/7/2010 5:44 PM, Peter Huewe wrote:
> > This patch fixes the warning generated by sparse: "Using plain integer
> > as NULL pointer" by replacing the offending 0s with NULL.
> >
> > Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
>
> Thanks for the fix. I see that it's already fixed in the
> project internal repo but I somehow missed sending it to
> mainline.
Are you ever going to sync your internal repo with the in-kernel one, or
should I just delete the in-kernel one?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging/zram: Fix sparse warning 'Using plain integer as NULL pointer'
2010-12-08 22:30 ` Greg KH
@ 2010-12-08 22:47 ` Nitin Gupta
0 siblings, 0 replies; 4+ messages in thread
From: Nitin Gupta @ 2010-12-08 22:47 UTC (permalink / raw)
To: Greg KH; +Cc: Peter Huewe, Greg Kroah-Hartman, Pekka Enberg, devel,
linux-kernel
On 12/8/2010 5:30 PM, Greg KH wrote:
> On Tue, Dec 07, 2010 at 06:09:22PM -0500, Nitin Gupta wrote:
>> On 12/7/2010 5:44 PM, Peter Huewe wrote:
>>> This patch fixes the warning generated by sparse: "Using plain integer
>>> as NULL pointer" by replacing the offending 0s with NULL.
>>>
>>> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
>>
>> Thanks for the fix. I see that it's already fixed in the
>> project internal repo but I somehow missed sending it to
>> mainline.
>
> Are you ever going to sync your internal repo with the in-kernel one, or
> should I just delete the in-kernel one?
>
It is almost sync'ed up (apart from "scalability enhancements") but I
somehow missed this part. Currently, I'm completely occupied with
final exams due next week. So, please be patient.
I plan to completely discard scalability part and solve outstanding
crash reports (http://code.google.com/p/compcache/issues/list) once
this school overhead is over.
Thanks,
Nitin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-08 22:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-07 22:44 [PATCH] staging/zram: Fix sparse warning 'Using plain integer as NULL pointer' Peter Huewe
2010-12-07 23:09 ` Nitin Gupta
2010-12-08 22:30 ` Greg KH
2010-12-08 22:47 ` Nitin Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox