mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC/PATCH] Per-device parameter support (2/16)
@ 2004-10-23  4:24 Tejun Heo
  2004-10-25  4:28 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2004-10-23  4:24 UTC (permalink / raw)
  To: rusty, mochel; +Cc: linux-kernel

 dp_02_param_array_bug.diff

 This is the 2nd patch of 16 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 <tj@home-tj.org>


Index: linux-devparam-export/kernel/params.c
===================================================================
--- linux-devparam-export.orig/kernel/params.c	2004-10-22 17:13:33.000000000 +0900
+++ linux-devparam-export/kernel/params.c	2004-10-23 11:09:28.000000000 +0900
@@ -302,9 +302,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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-25  7:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-23  4:24 [RFC/PATCH] Per-device parameter support (2/16) Tejun Heo
2004-10-25  4:28 ` Rusty Russell
2004-10-25  7:18   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®