Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965254AbcKDRte (ORCPT ); Fri, 4 Nov 2016 13:49:34 -0400 Received: from mga01.intel.com ([192.55.52.88]:48592 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933166AbcKDRtd (ORCPT ); Fri, 4 Nov 2016 13:49:33 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,444,1473145200"; d="scan'208";a="897803545" Message-ID: <1478281751.14557.8.camel@linux.intel.com> Subject: Re: [PATCH] hid: sensor: fix input and feature attributes in HID sensor custom sysfs interface From: Srinivas Pandruvada To: Benjamin Tissoires , "Ooi, Joyce" Cc: Jiri Kosina , Jonathan Cameron , linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Kweh Hock Leong , Ong Boon Leong , Lay Kuan Loon Date: Fri, 04 Nov 2016 10:49:11 -0700 In-Reply-To: <20161104140308.GC20334@mail.corp.redhat.com> References: <1478170515-24436-1-git-send-email-joyce.ooi@intel.com> <20161104140308.GC20334@mail.corp.redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1074 Lines: 26 On Fri, 2016-11-04 at 15:03 +0100, Benjamin Tissoires wrote: > On Nov 03 2016 or thereabouts, Ooi, Joyce wrote: > > > > User is unable to access to input-X-yyy and feature-X-yyy where > > X is a hex value and more than 9 (e.g. input-a-yyy, feature-b-yyy) > > in HID > > sensor custom sysfs interface. > > This is because when creating the attribute, the attribute index is > > written to using %x (hex). However, when reading and writing values > > into > > the attribute, the attribute index is scanned using %d (decimal). > > Hence, > > user is unable to access to attributes with index in hex values > > (e.g. 'a', 'b', 'c') but able to access to attributes with index in > > decimal values (e.g. 1, 2, 3,..). > > This fix will change input-%d-%x-%s and feature-%d-%x-%s to input- > > %x-%x-%s > > and feature-%x-%x-%s in show_values() and store_values() > > accordingly. > > > > Signed-off-by: Ooi, Joyce > > Reviewed-by: Benjamin Tissoires Acked-by: Srinivas Pandruvada >