On 5/1/13 9:15 AM, Jiri Olsa wrote:
+static char **formula_add(char **f, char *new)
+{
+       int i;
+#define FORMULAS_CNT 20
+
+       if (!f) {
+               f = zalloc(sizeof(char *) * FORMULAS_CNT + 1);
+               if (!f)
+                       return NULL;
+       }
+
+       for (i = 0; f[i] && (i < FORMULAS_CNT); i++);
+
+       if (i == FORMULAS_CNT) {
+               pr_err("Too many formula defined, max = %d\n",
+                      FORMULAS_CNT);
+               return NULL;
+       }

Why have an array of arbitrary limit versus a linked list?

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

Reply via email to