lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200520115705.GV374218@vkoul-mobl.Dlink>
Date:   Wed, 20 May 2020 17:27:05 +0530
From:   Vinod Koul <vkoul@...nel.org>
To:     Bard Liao <yung-chuan.liao@...ux.intel.com>
Cc:     alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        tiwai@...e.de, broonie@...nel.org, gregkh@...uxfoundation.org,
        jank@...ence.com, srinivas.kandagatla@...aro.org,
        rander.wang@...ux.intel.com, ranjani.sridharan@...ux.intel.com,
        hui.wang@...onical.com, pierre-louis.bossart@...ux.intel.com,
        sanyog.r.kale@...el.com, slawomir.blauciak@...el.com,
        mengdong.lin@...el.com, bard.liao@...el.com
Subject: Re: [PATCH 3/3] soundwire: add Slave sysfs support

On 19-05-20, 04:35, Bard Liao wrote:

> +int sdw_slave_sysfs_init(struct sdw_slave *slave)
> +{
> +	int ret;
> +
> +	ret = devm_device_add_groups(&slave->dev, slave_groups);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = devm_device_add_group(&slave->dev, &sdw_slave_dev_attr_group);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (slave->prop.dp0_prop) {
> +		ret = devm_device_add_group(&slave->dev, &dp0_group);
> +		if (ret < 0)
> +			return ret;
> +	}
> +
> +	if (slave->prop.source_ports || slave->prop.sink_ports) {
> +		ret = sdw_slave_sysfs_dpn_init(slave);
> +		if (ret < 0)
> +			return ret;
> +	}
> +
> +	return 0;
> +}
> +

We have trailing line here

> +static int add_all_attributes(struct device *dev, int N, int dir)
> +{
> +	struct attribute **dpn_attrs;
> +	struct attribute_group *dpn_group;
> +	int i = 0;
> +	int ret;
> +
> +	/* allocate attributes, last one is NULL */
> +	dpn_attrs = devm_kcalloc(dev, SDW_DPN_ATTRIBUTES + 1,
> +				 sizeof(struct attribute *),
> +				 GFP_KERNEL);
> +	if (!dpn_attrs)
> +		return -ENOMEM;
> +
> +	ret = max_word_attribute_alloc(dev, &dpn_attrs[i++],
> +				       N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = min_word_attribute_alloc(dev, &dpn_attrs[i++],
> +				       N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = words_attribute_alloc(dev, &dpn_attrs[i++],
> +				    N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = type_attribute_alloc(dev, &dpn_attrs[i++],
> +				   N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = max_grouping_attribute_alloc(dev, &dpn_attrs[i++],
> +					   N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = simple_ch_prep_sm_attribute_alloc(dev, &dpn_attrs[i++],
> +						N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = ch_prep_timeout_attribute_alloc(dev, &dpn_attrs[i++],
> +					      N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = imp_def_interrupts_attribute_alloc(dev, &dpn_attrs[i++],
> +						 N, dir, "0x%x\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = min_ch_attribute_alloc(dev, &dpn_attrs[i++],
> +				     N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = max_ch_attribute_alloc(dev, &dpn_attrs[i++],
> +				     N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = channels_attribute_alloc(dev, &dpn_attrs[i++],
> +				       N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = ch_combinations_attribute_alloc(dev, &dpn_attrs[i++],
> +					      N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = max_async_buffer_attribute_alloc(dev, &dpn_attrs[i++],
> +					       N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = block_pack_mode_attribute_alloc(dev, &dpn_attrs[i++],
> +					      N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = port_encoding_attribute_alloc(dev, &dpn_attrs[i++],
> +					    N, dir, "%d\n");
> +	if (ret < 0)
> +		return ret;
> +
> +	/* paranioa check for editing mistakes */

s/paranioa/paranoia

I found only these two nitpicks so I will go ahead and apply these and
fix them up.

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ