def list_deprecations(argument_spec, params):
    """Return a list of deprecations

    :arg argument_spec: An argument spec dictionary from a module
    :arg params: Dictionary of all module parameters

    :returns: List of dictionaries containing a message and version in which
        the deprecated parameter will be removed, or an empty list::

            [{'msg': "Param 'deptest' is deprecated. See the module docs for more information", 'version': '2.9'}]
    """

    deprecations = []
    for arg_name, arg_opts in argument_spec.items():
        if arg_opts.get('removed_in_version') is not None and arg_name in params:
            deprecations.append({
                'msg': "Param '%s' is deprecated. See the module docs for more information" % arg_name,
                'version': arg_opts.get('removed_in_version')
            })

    return deprecations