> +     if (n_thresholds <= 1 && rdev->ops->set_cqm_rssi_config) {
> +             const s32 disable = 0;
> +
> +             if (n_thresholds == 0) {
> +                     n_thresholds = 1;
> +                     thresholds = &disable;
> +             }

This doesn't really make sense,

> +             return rdev_set_cqm_rssi_config(rdev, dev,
> +                                             thresholds[0],
> hysteresis);
> +     }

since you return immediately afterwards anyway, and don't even use the
n_thresholds?

Perhaps also removing the earlier "hysteresis = 0" part and
distinguishing here directly to call the function with different
arguments based on enable/disable would make sense.

> +             s32 *thresholds =
> nla_data(attrs[NL80211_ATTR_CQM_RSSI_THOLD]);

const?

johannes

Reply via email to