Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2469443imw; Wed, 6 Jul 2022 06:32:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sV7+sHPFjkJXA3RVznr+Zu/72uDiRAXjCjrRT1Vqa+cJ07R4iKLaq7zlP9CZK2yamWvIRx X-Received: by 2002:a17:90b:3505:b0:1ec:db5d:794b with SMTP id ls5-20020a17090b350500b001ecdb5d794bmr50827059pjb.24.1657114350030; Wed, 06 Jul 2022 06:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657114350; cv=none; d=google.com; s=arc-20160816; b=draOAy56JyKAAcf6UdtvRsWI6a6qIjBxk8T55BCWSU2KEMk8bwsUgXpJLSjrMTLHU+ M+1gQpysMp0khL88Q3TdppJhIcFXZZ5RMgFuC6iGvYdANXv4BTvaZR9sq353EkbPB6Ne Ft/zwdQmJWqhHFKATXEMv7/TIjsHxinISpo+6/tHdiC5jU2JnEssK59S9tKrDzv9q+9J pBnoqI+sEJXiYIdI1P2C/Hwh1bhMmJuIHuvzonULcPNbHqTUpXx4/XtImvxvNiG2lziI QPQCndbgAR3UIDDssRpmcM+XDyNTpt2wPI0xcIupLDfzNwKF7aLaKKH/IQCTQ/nxID9F TxMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/5y+ayoqK0xBHDulZ+6Ht1XtHZqZEVyNCk6BdzJd4xM=; b=YX3C5fkji3Ae7WqYubAFqdwgVyM7Zy3Hq2j6XcJRdbWkUFd4u7jCDNoOzIDmAfb4+v bmzB3A739RP6ToA3H9oWxHyArH8dF0C0ltAnzrnG5y9iphC9eTTjo5/g/FvpbjlyDsVD 6/IiOucP8xeYALp2kWObCsnhpC7JSNR2a0YNdbyvmzqNlZHcg0zyTMhkTqoOG/0oS7hk 72QwjOI9Ei7vX8/zv4AMjeoq8pYVwl5pfjmbIHOFHisewmEedwUdscDjCCsGWq5w8dHz 5GCq3ryHRngQFyBLkBa0BhLDQ5Rq7jWwBwYIE0m8MdcgcdDycAoNRE0cJmZzWyAys/BD 37Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cbH0Na0s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u137-20020a63798f000000b0040d26509689si29458912pgc.628.2022.07.06.06.32.00; Wed, 06 Jul 2022 06:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cbH0Na0s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232348AbiGFMnb (ORCPT + 99 others); Wed, 6 Jul 2022 08:43:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbiGFMna (ORCPT ); Wed, 6 Jul 2022 08:43:30 -0400 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 559971002; Wed, 6 Jul 2022 05:43:28 -0700 (PDT) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-31cac89d8d6so68956517b3.2; Wed, 06 Jul 2022 05:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/5y+ayoqK0xBHDulZ+6Ht1XtHZqZEVyNCk6BdzJd4xM=; b=cbH0Na0sFkVOZOYEflwN8I1ccVKKD/HBtf9v+GQTNFmbqelo3sg01Wn8eM6m6P6BXM KGeFrHA7F5GjSOdIsQwZ5xoth/YHA1SCnz25FykjOuheRjEXCnqvwWkAXD8Kob0o+egF Vddxt3E8TjWXNCZd+JAufe3N99vYj0kbe+5GzE0lH52J818y2OeDVbTcGa4GIzgj1A3f 1eFgMQ/a7tG1/66qmpCRcWUjv8QEEzsh2ZNj/g7CrfCE3DwJcbA5zcKCrTxW3PjpfMcD 41Wl4AaNtec5Js7p7n5bXvEgB0Jhg6NmXjOyAgyLmX3XP0CKyUvkt0nWpfpv/0mjoGtE AF7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/5y+ayoqK0xBHDulZ+6Ht1XtHZqZEVyNCk6BdzJd4xM=; b=X7J2jKGi2hoo/m/8HikYW0kYu6UIghs1FiQroJcYnCnFoh+gQo1ngNp5fzE3G1XgHw WvInpXMt79HN3UWTtLvCQxbug7qjr0xh/E6HPDzKl8n/oVhnm+Pg75ZUfjO7bwd887+Z ujWwVx8s+NXJKjI6Q9tx/RCk5AIt4z6B+lLqhaIMglHEwIkHxCKQXnyDUtYAZiCBbTbf CIsBYh0HjyIODhz7M2EGq5Z7q6Hrlfwat+CVoh3VlrluO9pzPoAjM9H5TqinxE2UKnAT X7fKTfv16cAXjCm4znlQE2gFn+u8AYQ2807jJWUb+roj73XZXnRosXuO5W6ie8pMOye+ s9Xg== X-Gm-Message-State: AJIora/8+JZRPWvxeKbAxormrmpuXEtvj4467DlSokdkmNK9JaXVCfgz QUs+JtlFdRdFG3IuxeJit86wg8P2Gbe2U8eclz4= X-Received: by 2002:a81:3984:0:b0:31c:b59e:a899 with SMTP id g126-20020a813984000000b0031cb59ea899mr12875568ywa.195.1657111407489; Wed, 06 Jul 2022 05:43:27 -0700 (PDT) MIME-Version: 1.0 References: <20220704003337.208696-1-ang.iglesiasg@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 6 Jul 2022 14:42:51 +0200 Message-ID: Subject: Re: [PATCH v2 5/5] iio: pressure: bmp280: Adds more tunable config parameters for BMP380 To: Angel Iglesias Cc: Jonathan Cameron , Lars-Peter Clausen , "Rafael J. Wysocki" , Paul Cercueil , Ulf Hansson , linux-iio , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wed, Jul 6, 2022 at 12:51 AM Angel Iglesias wrote: > On Mon, 2022-07-04 at 22:08 +0200, Andy Shevchenko wrote: > > On Mon, Jul 4, 2022 at 2:41 AM Angel Iglesias wrote: ... > > > + if (unlikely(!data->chip_info->sampling_freq_avail)) { > > > > Why unlikely() ? How does this improve code generation / performance? > > As Jonathan Cameron sugested on a previous version of the patch, even thought > this code should be safe (as if we are checking sampling frequency is because > the sensor is a BMP380 and has that property), it would be better to have a > sanity check just to be sure the property is really available. I used unlikely > macro to take into account that the property would be almost always initialized. > > Now that you mention, probably this code won't be called too often to make the > "unlikely" branching hint make a meaningful performance difference > > > > + if (unlikely(!data->chip_info->iir_filter_coeffs_avail)) { > > > > Ditto. Is this really a performance-critical path? How did you check that unlikely() makes sense? More evidence, please! ... > > Why do you need to copy'n'paste dozens of the very same comment? > > Wouldn't it be enough to explain it somewhere at the top of the file > > or in the respective documentation (if it exists)? No answer? -- With Best Regards, Andy Shevchenko