amp: Remove pointless private_amp_data->conf.
authorAndre Noll <maan@systemlinux.org>
Tue, 9 Oct 2012 21:07:24 +0000 (23:07 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 21 Oct 2012 09:33:07 +0000 (11:33 +0200)
There is no need to store the configuration of the amp filter
in its privata_data structure since we can always get it via
the filter node pointer.

amp_filter.c

index dd2c619..2edfdd5 100644 (file)
@@ -23,7 +23,6 @@ extern char *stat_item_values[NUM_STAT_ITEMS];
 /** Data specific to the amplify filter. */
 struct private_amp_data {
        /** Points to the configuration data for this instance of this filter. */
-       struct amp_filter_args_info *conf;
        /** Amplification factor. */
        unsigned amp;
 };
@@ -53,14 +52,14 @@ err:
 static void amp_open(struct filter_node *fn)
 {
        struct private_amp_data *pad = para_calloc(sizeof(*pad));
+       struct amp_filter_args_info *conf = fn->conf;
 
-       pad->conf = fn->conf;
        fn->private_data = pad;
        fn->min_iqs = 2;
-       if (!pad->conf->amp_given && stat_item_values[SI_AMPLIFICATION])
+       if (!conf->amp_given && stat_item_values[SI_AMPLIFICATION])
                sscanf(stat_item_values[SI_AMPLIFICATION], "%u", &pad->amp);
        else
-               pad->amp = pad->conf->amp_arg;
+               pad->amp = conf->amp_arg;
        PARA_NOTICE_LOG("amplification: %u (scaling factor: %1.2f)\n",
                pad->amp, pad->amp / 64.0 + 1.0);
 }