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: <20190621152052.ja2adc7usqsgyu62@shell.armlinux.org.uk>
Date:   Fri, 21 Jun 2019 16:20:52 +0100
From:   Russell King - ARM Linux admin <linux@...linux.org.uk>
To:     Sven Van Asbroeck <thesven73@...il.com>
Cc:     David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        Peter Rosin <peda@...ntia.se>
Subject: Re: [PATCH v1 2/2] drm/i2c: tda998x: remove indirect
 reg_read/_write() calls

On Mon, May 27, 2019 at 03:15:52PM -0400, Sven Van Asbroeck wrote:
> -static void
> -reg_set(struct tda998x_priv *priv, u16 reg, u8 val)
> +static int
> +reg_set(struct regmap *regmap, u16 reg, u8 val)

I don't see the point of making this return an 'int' - you don't modify
any of the callsites to check the returned value, so returning a value
is not useful.

>  {
> -	regmap_update_bits(priv->regmap, reg, val, val);
> +	return regmap_update_bits(regmap, reg, val, val);
>  }
>  
> -static void
> -reg_clear(struct tda998x_priv *priv, u16 reg, u8 val)
> +static int
> +reg_clear(struct regmap *regmap, u16 reg, u8 val)

Same here.

> @@ -685,16 +655,18 @@ static void tda998x_detect_work(struct work_struct *work)
>  static irqreturn_t tda998x_irq_thread(int irq, void *data)
>  {
>  	struct tda998x_priv *priv = data;
> -	u8 sta, cec, lvl, flag0, flag1, flag2;
> +	struct regmap *regmap = priv->regmap;
> +	u8 sta, cec, lvl;
> +	unsigned int flag0, flag1, flag2;
>  	bool handled = false;
>  
>  	sta = cec_read(priv, REG_CEC_INTSTATUS);
>  	if (sta & CEC_INTSTATUS_HDMI) {
>  		cec = cec_read(priv, REG_CEC_RXSHPDINT);
>  		lvl = cec_read(priv, REG_CEC_RXSHPDLEV);
> -		flag0 = reg_read(priv, REG_INT_FLAGS_0);
> -		flag1 = reg_read(priv, REG_INT_FLAGS_1);
> -		flag2 = reg_read(priv, REG_INT_FLAGS_2);
> +		regmap_read(regmap, REG_INT_FLAGS_0, &flag0);
> +		regmap_read(regmap, REG_INT_FLAGS_1, &flag1);
> +		regmap_read(regmap, REG_INT_FLAGS_2, &flag2);

Not particularly enamoured by this...

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ