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: <20180124212734.qeud4pv2i6jqjb34@dtor-ws>
Date:   Wed, 24 Jan 2018 13:27:34 -0800
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Marcus Folkesson <marcus.folkesson@...il.com>
Cc:     Simon Shields <simon@...eageos.org>,
        Andi Shyti <andi.shyti@...sung.com>,
        Rob Herring <robh@...nel.org>, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] Input: mms114 - add support for mms152

On Wed, Jan 24, 2018 at 09:04:08PM +0100, Marcus Folkesson wrote:
> Hello Dmitry,
> 
> On Wed, Jan 24, 2018 at 11:38:04AM -0800, Dmitry Torokhov wrote:
> > From: Simon Shields <simon@...eageos.org>
> > 
> > @@ -241,12 +251,28 @@ static int mms114_get_version(struct mms114_data *data)
> >  	u8 buf[6];
> >  	int error;
> >  
> > -	error = __mms114_read_reg(data, MMS114_TSP_REV, 6, buf);
> > -	if (error < 0)
> > -		return error;
> > +	switch (data->type) {
> > +	case TYPE_MMS152:
> > +		error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf);
> > +		if (error)
> > +			return error;
> > +		buf[3] = i2c_smbus_read_byte_data(data->client,
> > +						  MMS152_COMPAT_GROUP);
> > +		if (buf[3] < 0)
> > +			return buf[3];
> 
> buf is unsigned.
> 
> Maybe
> 		error = i2c_smbus_read_byte_data(data->client,
> 						  MMS152_COMPAT_GROUP);
> 		if (error < 0)
> 			return error;
> Instead?

Good catch. I think I'd rather have a separate variable "group" for
this.

Thank you.

> 
> 
> > +		dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x, Compat group: %c\n",
> > +			 buf[0], buf[1], buf[2], buf[3]);
> > +		break;
> > +
> > +	case TYPE_MMS114:
> > +		error = __mms114_read_reg(data, MMS114_TSP_REV, 6, buf);
> > +		if (error)
> > +			return error;
> >  
> > -	dev_info(dev, "TSP Rev: 0x%x, HW Rev: 0x%x, Firmware Ver: 0x%x\n",
> > -		 buf[0], buf[1], buf[3]);
> > +		dev_info(dev, "TSP Rev: 0x%x, HW Rev: 0x%x, Firmware Ver: 0x%x\n",
> > +			 buf[0], buf[1], buf[3]);
> > +		break;
> > +	}
> >  
> >  	return 0;
> >  }
> 
> 
> Best regards
> Marcus Folkesson



-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ