[lkml]   [2004]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 2.6.10-rc1 1/15] driver-model: param_array_set num field fix

    This is the 1st patch of 15 patches for devparam.

    This patches fixes param_array_set() to not use arr->max as nump
    argument of param_array. If arr->max is used as nump and the
    configuration variable is exported writeable in the syfs, the size of
    the array will be limited by the smallest number of elements
    specified. One side effect is that as the actual number of elements
    is not recorded anymore when nump is NULL, all elements should be
    printed when referencing the corresponding sysfs node. I don't think
    that will cause any problem.

    Signed-off-by: Tejun Heo <>

    Index: linux-export/kernel/params.c
    --- linux-export.orig/kernel/params.c 2004-11-04 10:25:51.000000000 +0900
    +++ linux-export/kernel/params.c 2004-11-04 11:04:07.000000000 +0900
    @@ -305,9 +305,10 @@ int param_array(const char *name,
    int param_array_set(const char *val, struct kernel_param *kp)
    struct kparam_array *arr = kp->arg;
    + unsigned int t;

    return param_array(kp->name, val, 1, arr->max, arr->elem,
    - arr->elemsize, arr->set, arr->num ?: &arr->max);
    + arr->elemsize, arr->set, arr->num ?: &t);

    int param_array_get(char *buffer, struct kernel_param *kp)
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at
     \ /
      Last update: 2005-03-22 14:07    [W:0.020 / U:6.524 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site