Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1425711ybb; Sun, 29 Mar 2020 04:27:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuLBvGLKKTwymnnYwLO2Rl1KSm9cLtDm7DNhYgSqT7tDbiQhjO+6tX8JJrU723Puuiyh64S X-Received: by 2002:a9d:4f0:: with SMTP id 103mr5390697otm.336.1585481274425; Sun, 29 Mar 2020 04:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585481274; cv=none; d=google.com; s=arc-20160816; b=ysrwLz3hl9aLujL0/XEkh+OtPaTr4p8GMQC73ZLTI6O+xv/eGKnZA10Z6YzPF0WQJs YbndPFfyqof4hBoAJzSKsDFad49ib5E0SrSzKc6fg+TkOQymJ/SP0jKHi17Opi9w7hQ3 ZbUSvQiAwBbYpBXZWwWZN1O+QcsFR5eJCpiojEFrNUuktMPyE0P0fgIoJp52guepcrQ8 kBgs3R4xf4c6/6iRWvuHynZnUPawbcLOs8nZMIScz3CMAvFrapuD+IDJQmQdNrAczBGW rArg6h4/eqf39etSDeC558ipK0MF+OMql83WEkBiRTxSOJAy6jOd4Vh9IbXbd574gvsY u7Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GMN72kZ+dQBIE9BK5gK8is5DfX56QN4AerLjDwscHk0=; b=kh8z7/ywjl9DnUsUvIk6o/z0YA1vywPFHZkw32JLk3ctf3he9QbEXV3LmxCOvwhhM9 mRGzcPHvpjIJiapoB+urToYpzDK1qY1OahY/j5cWXKOA/ruowvuO4lN+3lePge06ZObC mAe8C0fTkgNPJFKqZMRRFzZjesGk7dOEG9IHZ6kLfdpiAfR22+29ggITNd/sJHNxqvou X3E7l5giHPjrMtGKJBfXEh7frNdhmtNihQHcf4CemIhVjw0DQ0UMbdRlwJQ0hUIkIVa2 xBlRZBcx7H3b7QRq70vtet8RXrSdAdd/jV/absj+5v2pSSaGD/JV1JFtooz9Zo1tQn9J ZpBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="q/OHEu1h"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si3572910otd.63.2020.03.29.04.27.41; Sun, 29 Mar 2020 04:27:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="q/OHEu1h"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728096AbgC2LW0 (ORCPT + 99 others); Sun, 29 Mar 2020 07:22:26 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46314 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728070AbgC2LW0 (ORCPT ); Sun, 29 Mar 2020 07:22:26 -0400 Received: by mail-pg1-f193.google.com with SMTP id k191so7217702pgc.13; Sun, 29 Mar 2020 04:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GMN72kZ+dQBIE9BK5gK8is5DfX56QN4AerLjDwscHk0=; b=q/OHEu1huh69xufvD4/e6DgSXihaH27aM7Fi7rji/CBHrZB5nhe28g7vKTQSJ6Tuuq eNrTJSmg0Zttdzil6nDKEenb7+1r+HwkuSbmzytcybRkQsiFOxcS8FTS1EzZoss7YSw4 9n6dLN7TMT2czm097pK6hQ0kJtyYc4LfYCPvbWGWg708YeBfg1Oq3T9rB1HjsODJzseb H1syhjFExGnlXsOyWBGBhZLjAL3DdUKTu3rUoeap1tJ5zkU9hUzbbwIM7+2NLhCXMvxr zUwMw1sqX3TGaUMO+YtQ41EOT/s4q3B6HUfcIsDJpgeSg93l3HtSxvxDxG7+WwajBc1j WCTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GMN72kZ+dQBIE9BK5gK8is5DfX56QN4AerLjDwscHk0=; b=aa7wPYsbCqJO8nHorslY6epClbb6wtM+h+zi+txTG2KNT+Q+s32HTGmhb3TEPdtGY0 7KnIRaWt0gp0OuK2TXfEwW//GUdI0x9Tv8ieC05pUWLVYtmeIwzEcvrdcbjdt7KuCraI fIZjr8fMU24WPKc/IfjO+/vKEs88GtVQ3yYP3OKlL1qNeiRyV3LKWZIwj+d/FpcSnxBO tUgjMMrnP0Kfn+YjzuabY76Na4LmSus3JZ75FD8APVKAIPnQ/liyEgepffg3rqnQLUBL QEpunYAUhCJzf+6FLlQTc9vkSKdE+6P3buz5p6kks9MISJNNydmX3QedgopL8udMuFyA Q0Hg== X-Gm-Message-State: ANhLgQ3/CUjQ99Qj/hE/G0B3B9gLLGFRaaJe/MxHPQo3eIMMXfdJfuR/ KN9LSdu1ivbtXbUAy1H5sBjz9cMRZpGTSsy+QYc= X-Received: by 2002:a05:6a00:2b4:: with SMTP id q20mr8360593pfs.36.1585480943579; Sun, 29 Mar 2020 04:22:23 -0700 (PDT) MIME-Version: 1.0 References: <20200327223443.6006-1-gwendal@chromium.org> <20200327223443.6006-13-gwendal@chromium.org> In-Reply-To: <20200327223443.6006-13-gwendal@chromium.org> From: Andy Shevchenko Date: Sun, 29 Mar 2020 14:22:11 +0300 Message-ID: Subject: Re: [PATCH v7 12/12] iio: cros_ec: flush as hwfifo attribute To: Gwendal Grignou Cc: Benson Leung , Enric Balletbo i Serra , Jonathan Cameron , linux-iio , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 28, 2020 at 12:37 AM Gwendal Grignou wrote: > > Add buffer/hwfifo_flush. It is not part of the ABI, but it follows ST > and HID lead: Tells the sensor hub to send to the host all pending > sensor events. I see where discussion is going, but nevertheless some comments below that you will not make same mistakes in the future. ... > + int ret = 0; Useless assignment. > + bool flush; > + > + ret = strtobool(buf, &flush); kstrtobool() > + if (ret < 0) Positive error codes? I'm not sure it returns a such. So ' < 0' part is redundant. > + return ret; > + if (!flush) > + return -EINVAL; This I didn't get, you have accept only true as input? It's really strange. > + ret = cros_ec_motion_send_host_cmd(st, 0); > + if (ret != 0) Similar to above ' != 0' part is redundant. > + dev_warn(&indio_dev->dev, "Unable to flush sensor\n"); ... > +static IIO_DEVICE_ATTR(hwfifo_flush, 0644, NULL, > + cros_ec_sensors_flush, 0); IIO_DEVICE_ATTR_RW() ? -- With Best Regards, Andy Shevchenko