From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C41EBC00140 for ; Sun, 21 Aug 2022 17:04:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbiHUREE (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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; > > > } > >