Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1523520rwa; Sun, 21 Aug 2022 10:13:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR6npd4i82Sb3XdL1gh+3xeK1Be9M6RW7cB0Sf4B6hIZFWxj6/0dJuBhy27CRXLJDUXYsiWl X-Received: by 2002:a65:5889:0:b0:428:90f3:6257 with SMTP id d9-20020a655889000000b0042890f36257mr14323269pgu.590.1661101988611; Sun, 21 Aug 2022 10:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661101988; cv=none; d=google.com; s=arc-20160816; b=VDIw+HjaL1qUOvwDbGPba+PbbZuoilRTID2o6NQZpXtYIEDkrc54wrgQcKDB4+PVyd CH8yUT5vWHKp/zYYo5ajLxp0WefYUeU6behop/Hd4RQ9+CmP+jmSuUUM5Uv5oIoc7F21 DeXoa/bNhIQYz2LrTbscBzZrVuONacJBCQnr0yFs1AA2dwyWZ6qT7TgqXXQ+sKfydne0 5h5qcxvuyMLIzsiqKj+Y1Flvg2feImLZjJN56K1twYKS+VKmORCT7iTOUNUdDdB23zxd 7TCrIhD/u/fjwFhDkf8eHdvGXn5b7mmL6Rx3t7dgXQq4VUQ9DQKH/JxjXAX/Fn90lowL iUVQ== 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=l+nrs4T9MugSCP8g4BHdibqCVaMA5tNDjZR5IbU3cII=; b=zM71iZ3BHx+ZkXjyiP3s+bfIhifD2ix7A3vzG0oCE70VNf0rgPpCd9lU4OZD6ivLdW xMVTLJzzp5lHMCccZmDkBM7kQ/vLktgSKbyJT5RujePZxmKc4AM6herzB6ECmIgs17m+ bzu5zgWOveHcln+isMt/VTzFEBvMN7kEBNB4RmyYAjR3lIBoyztA1V3uaAYDlXDkE/w7 o4xtmdb9ZwexZKtKtYXrvCELJDYaFnHgUX3J2R/Y6m38tw6jv1abe592TMAiy5i7QBLT BfUJ3ff0yZJdFexnI011p6B9sheQbDdbzZpLuBHU/wWEBNU+II0gP5H0mMX9rin28vXE DWcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pGDQAKjw; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t136-20020a63788e000000b0041c6b773d5fsi10867740pgc.854.2022.08.21.10.12.56; Sun, 21 Aug 2022 10:13:08 -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=@kernel.org header.s=k20201202 header.b=pGDQAKjw; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230267AbiHUREE (ORCPT + 99 others); Sun, 21 Aug 2022 13:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiHURED (ORCPT ); Sun, 21 Aug 2022 13:04:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15AE013FA6; Sun, 21 Aug 2022 10:04:02 -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 C4E8FB80A08; Sun, 21 Aug 2022 17:04:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E339C433D6; Sun, 21 Aug 2022 17:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661101439; bh=lmaONrarTYyoSnUieZtTg5QSSZi6JaipEBFE/NQounY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pGDQAKjwVlBFKJvENPzrYPhYN0hSeGlSggZ+IRf4mwFF3sI5/AQoAKnIi/dooYgD6 2e0dJyQh0fSaM67YFXxxR5ZPBiwu9ISBMmW7rKbP4PLSdy5C33ZkqQc7RznzEpGRD/ PNe8hvLJ+t9SJXPBbAvAC3GKvp3HEdCT2ZgOaza/FcDkGkAdBj3EPxz/fw25EdmvKo YKEPUNT10ipfNJT0CGtS/T8LugldK5MpoyQmtO8r1cEX3XG38atRajOeBQPIPgqLe5 Bh/2MaUl1G5RZZDH92GfteF/Y4TUD+zrhBOk/x4IKUpLhTbEDC/OKu3E9x28neMZ9E sBuT8qcc3U5SQ== Date: Sun, 21 Aug 2022 17:29:30 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Antoniu Miclaus , Linux Kernel Mailing List , linux-iio Subject: Re: [PATCH] iio: frequency: admv1014: return -EINVAL directly Message-ID: <20220821172930.29e7a2fa@jic23-huawei> In-Reply-To: References: <20220819104117.4600-1-antoniu.miclaus@analog.com> <20220819180856.5a1d4e5a@jic23-huawei> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; 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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Sat, 20 Aug 2022 18:56:53 +0300 Andy Shevchenko wrote: > On Fri, Aug 19, 2022 at 8:41 PM Jonathan Cameron wrote: > > On Fri, 19 Aug 2022 13:41:17 +0300 > > Antoniu Miclaus wrote: > > > > > Remove extra step where the error code is assigned to the `ret` > > > variable. > > > > > > Return instead error code directly. > > ... > > > Change is fine, but I've dropped the fixes tag. The code before this > > wasn't broken, just longer than it needed to be. We don't want the noise > > of this getting backported because someone sees the fixes tag and thinks > > there is a reason it needs to be. > > > > Applied to the togreg branch of iio.git > > Haven't checked myself if it's possible, but shouldn;'t we go further > and return dev_err_probe()? Good idea, but only as part of a patch doing that throughout the driver. So follow up patch perhaps.. > > > > chip_id = FIELD_GET(ADMV1014_CHIP_ID_MSK, chip_id); > > > if (chip_id != ADMV1014_CHIP_ID) { > > > dev_err(&spi->dev, "Invalid Chip ID.\n"); > > > - ret = -EINVAL; > > > - return ret; > > > + return -EINVAL; > > > } > >