Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp3621868lfb; Mon, 9 May 2022 00:12:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF8v4N+uDR3m5B1bCl7aue0Tae5DUKbRgb4V0mSrdTZV3Ow7uAg9XhI5g7/lFtaqJFztKG X-Received: by 2002:a17:902:f64f:b0:156:f1cc:b284 with SMTP id m15-20020a170902f64f00b00156f1ccb284mr14659653plg.147.1652080329278; Mon, 09 May 2022 00:12:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652080329; cv=none; d=google.com; s=arc-20160816; b=PXzIahmef5FErdB9zkAKjO1BBzT7HpKt7f7xYnrcIjEYfXbkYNfDVG1wQZt5ybhkj/ McdKZ+4E4JfhNFx5ozBgjsBANcGI1YLJfki+cYf0ZRgix5BhMahesKby2bT9rmWDzv5f HCtQxRF4W5efPPnK2av1TNe01meynBZVehFAvJh6+/hAUc3z3yGPxtpiwESiDzoZfDUh Pupwq93QRsNMrG/cM+gJD6bLjKJidAIC86basM1Os39F7i4nKuViqX8JhaVHQV0M/Bpv Lblh8RwmNYzDDcyPwUjBAzBNO56mgzTtQdHcxBuLa74kDuBQfoHnFn5cz00JePAT7CRE emPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kGs//DBoOaEI6Zx951fOXyayhBD4JAeJQNuOJN5qNkQ=; b=lIeGYBZUmomv7vlnr9w0eIRVijd5d61TmvvS9sH2KDJNZp5uNkeleMjb0VSSJX/2KI FO0ci5iUsJkowGPrX4qUJQIQOsxaDUqB23JBXUR9KRDyVcec8Oc/Sao/5PzqL/3O6Obf P58cef6alp0oaz8o1GUFxNND84Hn3oNh7kA7+0DI3tlxzKrgZ4ey5AuhM6O1JbdGZNAy KKGydfwV1ZUjLejWyuo+1+9vUdocQL9/1jifDnf/YizqR15arr1h3/5Xdop+jqzsLFZU FJFut7ZicuRsJjDdnepWXLLJ9pqg+sD/9SbEGCazjC/dSPeMLkMb4M5tmJSY5PtI/fMJ QX2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YgC971pQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q3-20020a634303000000b003990b9576f5si13552375pga.425.2022.05.09.00.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:12:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YgC971pQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 047493EF10; Mon, 9 May 2022 00:05:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446622AbiEGQE4 (ORCPT + 99 others); Sat, 7 May 2022 12:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237306AbiEGQEw (ORCPT ); Sat, 7 May 2022 12:04:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D960FE027; Sat, 7 May 2022 09:01:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 87390B80AE5; Sat, 7 May 2022 16:01:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04CA9C385A6; Sat, 7 May 2022 16:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651939262; bh=NHfiodbVnluSYWb96H0xbgRSiv4JTISVRIRQPyzuieM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YgC971pQOFnvnhI2RIkeZJ8woF2HDrbf6Vs/HHx8ZrvDxWb3SZSaLSARZxMh6lZvk rQwUuWpKw1KycIqKF55KlhvYv620ecmdpME+DTsI6Ef24NK77F/k2e/FWmZhbeZWK4 XswlI0vrI8gCpflHrQszI46J6BjSntw49D2z7ZbITJBZQ7LGe9YIIpH59DsGp2jBXj By4N0ZgmlD6w3TIl8niz0FYkz0gGrUEe5aRCGuXJf0Ej1kmF0uorEp63dPX0G0igWg wH3ebHKsJBlGHCk5Uy2kXGuDo0hUWLqIc9IBf268SnYgIjnhAJbU8PJMdarYhERbSA FWSdhWRTbGUQQ== Date: Sat, 7 May 2022 17:09:29 +0100 From: Jonathan Cameron To: Jagath Jog J Cc: dan@dlrobertson.com, andy.shevchenko@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 05/10] iio: accel: bma400: Add separate channel for step counter Message-ID: <20220507170929.4fa967d8@jic23-huawei> In-Reply-To: <20220505133021.22362-6-jagathjog1996@gmail.com> References: <20220505133021.22362-1-jagathjog1996@gmail.com> <20220505133021.22362-6-jagathjog1996@gmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 May 2022 19:00:16 +0530 Jagath Jog J wrote: > Added channel for step counter which can be enable or disable > through the sysfs interface. > > Signed-off-by: Jagath Jog J > --- > > +static int bma400_enable_steps(struct bma400_data *data, int val) > +{ > + int ret; > + > + if (data->steps_enabled == val) > + return 0; > + > + ret = regmap_update_bits(data->regmap, BMA400_INT_CONFIG1_REG, > + BMA400_STEP_INT_MSK, > + FIELD_PREP(BMA400_STEP_INT_MSK, !!val)); This gives a dubious x & !y warning So I've changed it to val ? 1 : 0 Jonathan > + if (ret) > + return ret; > + data->steps_enabled = val; > + return ret; > +}