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]
Date:   Mon, 28 Mar 2022 11:37:32 +0200
From:   Wolfram Sang <wsa+renesas@...g-engineering.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH v7 1/1] gpio: add sloppy logic analyzer using polling

Hi Andy,

> > +	for (i = 0; i < priv->trig_len; i+= 2) {
> 
> Missed space.

Yes.

> > +static int fops_buf_size_set(void *data, u64 val)
> > +{
> > +	struct gpio_la_poll_priv *priv = data;
> 
> > +	int ret = 0;
> 
> Instead of this assignment and other related things, can we do the following?
> 
> > +	void *p;
> > +
> > +	if (!val)
> > +		return -EINVAL;
> > +
> > +	mutex_lock(&priv->lock);
> > +
> > +	vfree(priv->blob.data);
> 
> 	priv->blob.data = NULL;
> 	priv->blob.size = 0;
> 
> > +	p = vzalloc(val);
> > +	if (!p) {
> > +		val = 0;
> > +		ret = -ENOMEM;
> > +	}
> 
> 	p = vzalloc(val);
> 	if (!p)
> 		return -ENOMEM;
> 
> > +	priv->blob.data = p;
> > +	priv->blob.size = val;

I don't like assigning 'priv' memebers twice, so I'd like to keep it as
is.

> > +static const struct file_operations fops_trigger = {
> > +	.owner = THIS_MODULE,
> > +	.open = trigger_open,
> > +	.write = trigger_write,
> > +	.llseek = no_llseek,
> > +	.release = single_release,
> > +};
> 
> Can it be wrapped by DEFINE_SHOW_ATTRIBUTE()?

I don't see a way. Do you?

> > +	dev_info(dev, "initialized");
> 
> Not sure how this one would be helpful.

Then please check my comments on your previous reviews.

All the best,

   Wolfram


Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ