lkml.org 
[lkml]   [2009]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [Resend Patch] kexec: allow to shrink reserved memory
    Dan Carpenter wrote:
    > On Mon, Nov 23, 2009 at 04:37:02AM -0500, Amerigo Wang wrote:
    > [snip]
    >> +size_t crash_get_memory_size(void);
    > [snip]
    >> +static ssize_t kexec_crash_size_show(struct kobject *kobj,
    >> + struct kobj_attribute *attr, char *buf)
    >> +{
    >> + return sprintf(buf, "%lu\n", crash_get_memory_size());
    >> +}
    >
    > CC kernel/ksysfs.o
    > kernel/ksysfs.c: In function ‘kexec_crash_size_show’:
    > kernel/ksysfs.c:106: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘size_t’
    >

    Patch below fixes this.

    Andrew, could you please fold it in? Thanks!

    diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
    index 5b9276b..3feaf5a 100644
    --- a/kernel/ksysfs.c
    +++ b/kernel/ksysfs.c
    @@ -103,7 +103,7 @@ KERNEL_ATTR_RO(kexec_crash_loaded);
    static ssize_t kexec_crash_size_show(struct kobject *kobj,
    struct kobj_attribute *attr, char *buf)
    {
    - return sprintf(buf, "%lu\n", crash_get_memory_size());
    + return sprintf(buf, "%zu\n", crash_get_memory_size());
    }
    static ssize_t kexec_crash_size_store(struct kobject *kobj,
    struct kobj_attribute *attr,
    \
     
     \ /
      Last update: 2009-11-24 09:51    [W:0.022 / U:244.664 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site