Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1337581iog; Tue, 14 Jun 2022 04:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU0mRi3RbBVS6f9oz91HB5dCF+sJ9Ao06U42kZbSi2XAuoWIcyPNbNaFG1ul+xI2+lNm/7 X-Received: by 2002:a63:dd56:0:b0:405:34ac:9bc9 with SMTP id g22-20020a63dd56000000b0040534ac9bc9mr4179805pgj.324.1655205274648; Tue, 14 Jun 2022 04:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655205274; cv=none; d=google.com; s=arc-20160816; b=r88ZDvDG18alC7CYQQqNdxQjZIFxc3mUaSud1okzLsX0jqB3bIqiJiGfUtlJM55NoG h3Br4KBD6Yo3ooW1VvKjBwIFQnzC5enzxbFnzUnc46qAjFupHtalNF6X+R4yK+YV+qdG pQ2yHsPC8RIOI6Rn+ooHYVF2MNElhNi7i5kfZ1Vi37nrRbAqXJ5DQ5bV4E4Yqdh3Fd9l PK99VFgfDVGiiQdwUjQ3AA52sK+NnSH01Gf4tryvNo7lrBHYr87749BoJm53pdpwewyU /weePcImIZKg611tHOE5vpmS+kwq6Z2QlXf8siN0Iv+uQqugG5oB2EjsEV8w94k2B5Uk wicQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pIl3ve2qWNEUoL+rbrKIn4jxMygDkC3EHjty1+HINlM=; b=Qqy3r3PdRDScv1kRRz+twhtKqnySzyoqMrIGHVRaVqFP+yUL6S2bLpjsMnYCw7O4Z4 WzDP7f1cfammNoWAC4OcfjfbBM67BnuDYWY4M0vtSfWVIKt91LbELRbvvpLe0QzmLd1c 0pil3w59VEd4u8YmUHSsaX+bjImXCMBCuClX/vjZdUlX/pK1Ew72qFjHhuMTAFLWwjwV m7eq11y6X71++4Sv9RveatnJE9vp+pohCwcbIWYMKyPUiLcbHXIYOgq2NE5xkdnC4BAl x5ELcLXHXpFBXemp4pIdtKEi2tdRbsHlpXXAFULR4yqcKrGTXL3bIG0yQwl96QNXcHGc +bFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kasr6ciK; 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 o3-20020a170902d4c300b00158d1f2d451si15087458plg.45.2022.06.14.04.14.19; Tue, 14 Jun 2022 04:14:34 -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=kasr6ciK; 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 S243229AbiFNK7W (ORCPT + 99 others); Tue, 14 Jun 2022 06:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235667AbiFNK7B (ORCPT ); Tue, 14 Jun 2022 06:59:01 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36139286C1; Tue, 14 Jun 2022 03:59:00 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id u12so16370712eja.8; Tue, 14 Jun 2022 03:59:00 -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:content-transfer-encoding; bh=pIl3ve2qWNEUoL+rbrKIn4jxMygDkC3EHjty1+HINlM=; b=kasr6ciKYU3aBbGLQ4cwq8w8ZCkS9QclEp3UGTJv9aWFhfeH63Jg5ksFBP6v/z7ODZ 8I8GLstOsKRPgLEdR6nqRTmmZ6+r6cxP14bnQM/fAjWdecUQD1jkIRF2hLq7+Qid7dn0 R5vl18NeVxyFIFQUxMz+KC6RcogcaOIOBx+vsCfV7wRcxpOAs23M0OoGXet2l9ttYeFv TVMxTLQRtnEU6DXjzxUgPffb8F2riiAGo++fA7Qgj5hz+VaXpEBcNpGfAgP+p5nSMwTI VIsWZog4iHy8NVOpkIYwgLV/3uD51HeAL//2tu2hHhBVA+Kup5+NxDZIsocLR+DN6w+J tWVQ== 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:content-transfer-encoding; bh=pIl3ve2qWNEUoL+rbrKIn4jxMygDkC3EHjty1+HINlM=; b=60JKJwM/huQ/ECeL6ov3HJXIRqrlFK3JBtvLPxdYNVL2EYpU2cZocZZE2reL/YIXLg 9kUKBpZozSv2/BnwQ45lXgwS4E15SEKVEBUEDsEK2tjp1koZwziLI5pevH+rEqSS/Iz4 bzDhZna/pO3Zy6guJo38JcmwM3GQZshgH/FaVe9mE33mhHLm8IDoPWyQ4YnIy9KlwEG8 rGwRwGG8HFJ0PlUU/y7zCwwE+lLawtaJIn2W7ga4dtfftWkHrVglcDlT7yEVH1My7wfB TPeqj9+9C0i5wUQebMcqxX5y+nQAFaA3BqcleZrWNXfHJ0NzVcmsRiJWT9VyhCaJE4A+ p3eQ== X-Gm-Message-State: AOAM533X8VHEWEXFF4VW47o/j36427meWV1l2ALWYq6hEPaV60HTbbsR 1if/3694SxCg9xZLCPK7XgdXRJ7U+rcytMJvIE4= X-Received: by 2002:a17:906:149:b0:711:fca6:bc2f with SMTP id 9-20020a170906014900b00711fca6bc2fmr3774376ejh.497.1655204338631; Tue, 14 Jun 2022 03:58:58 -0700 (PDT) MIME-Version: 1.0 References: <20220613120534.36991-1-andrea.merello@iit.it> <20220613120534.36991-9-andrea.merello@iit.it> <164f663acbba481a8ea8f45f185aaf83@iit.it> In-Reply-To: <164f663acbba481a8ea8f45f185aaf83@iit.it> From: Andy Shevchenko Date: Tue, 14 Jun 2022 12:58:21 +0200 Message-ID: Subject: Re: [v6 08/14] iio: imu: add Bosch Sensortec BNO055 core driver To: Andrea Merello Cc: Jonathan Cameron , Mauro Carvalho Chehab , linux-iio , Linux Kernel Mailing List , devicetree , Lars-Peter Clausen , Rob Herring , Matt Ranostay , Alexandru Ardelean , jmondi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Jun 14, 2022 at 11:11 AM Andrea Merello wro= te: ... > >> + /* G: 2, 4, 8, 16 */ > > > >Indentation of this comment is a bit off. > > > >> +static int bno055_acc_range_vals[] =3D {1962, 3924, 7848, 15696}; > > > >Perhaps split this to 4 lines and put the comment on top of the third li= ne? > > Not sure what you mean here, sorry. May you elaborate or provide an examp= le, please? static int ... [] =3D { /* Comment goes here */ value1, value2, ..., valueN, }; ... > >> +static void bno055_debugfs_init(struct iio_dev *iio_dev) > >> +{ > >> + struct bno055_priv *priv =3D iio_priv(iio_dev); > >> + > >> + priv->debugfs =3D debugfs_create_file("firmware_version", 0400= , > >> + iio_get_debugfs_dentry(iio= _dev), > >> + priv, &bno055_fw_version_o= ps); > > > >> + devm_add_action_or_reset(priv->dev, bno055_debugfs_remove, pri= v->debugfs); > > > >Shouldn't we report the potential error here? It's not directly > >related to debugfs, but something which is not directly related. > > The error eventually comes out from something that has nothing to do with= debugs per se (i.e. the devm stuff), but it will only affect debugfs indee= d. > > Assuming that we don't want to make the whole driver fail in case debugfs= stuff fails (see last part of the comment above debugfs_create_file() impl= ementation), and given that the devm_add_action_or_reset(), should indeed "= reset" in case of failure (i.e. we should be in a clean situation anyway), = I would say it should be OK not to propagate the error and let things go on= . As I said, it's not directly related to debugfs. Here is the resource leak possible or bad things happen if you probe the driver, that fails to add this call for removal, remove it, and try to insert again, in such case the debugfs will be stale. > However we can add a dev_warn() to report what happened. Not sure if it would suffice, I leave it to Jonathan. --=20 With Best Regards, Andy Shevchenko