Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1068714rdb; Wed, 6 Dec 2023 07:49:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IF48x1sbbIAJ4dF+b7ZuNcO5gYo9EN0nPRkiy35ZULz92KqhTa+snrPHE3qmsKtcBa2DA7I X-Received: by 2002:a17:902:ea95:b0:1d0:965f:b003 with SMTP id x21-20020a170902ea9500b001d0965fb003mr872135plb.67.1701877774129; Wed, 06 Dec 2023 07:49:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701877774; cv=none; d=google.com; s=arc-20160816; b=F5jRUvj79DWflkR9diD262M5dhntNzJaBU4I6yv4LWgbvUKbNfhLn+gAoiW3vlmZ6Z d+vmFxNcurW+wultkfgY5YscHNFY8lcd8lJsbxSchqxVdKxd14PhXH6k7hlJXXSGJi7+ Z6rwduj3p7khZX1fTO3Gynx3MapaH8y9qF+aS/Xfibx161nuKTBITKHMs4etByCOBdtY hDSWWv23yFWWB6FBdoSbIHS/F/P+YR0MGhuxbbVCcVfpyToR3cehpTXHtyn5G9txJFQT GuA2Bq+Wb+uNLFKVwdf9gl7qwmlzbrCy1StrDhC7c04A9JE227vmyhm9sTyUyzc0pxwy mvqg== 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:date:subject:cc:to:from :dkim-signature; bh=gVQToqdhWJOfZmUYfgfrwmU7QizOSdf3rIlznTBJ0d4=; fh=DZ8zZa57YLgNX1uf1qsX/YdNOFxy2cw5gQMDuToJlls=; b=WapVn/QbX6zrKWz+iWY+LgyK10Me2FQC7r/DvopSf4Ql3wfkxgbltulwdr1bOh+NJZ qYcpR4fNaSJPKH5FT5kYO/7Ko3Vr0udXWWzXTte07EoIKGnbah8VaJpcGFlzrYrh2mpR Utdl90GSvBQy1PjP8yVJl9GLoZkFb5SX9rJrtOJw4SF0YxBO0kjuibztzQ3S6nkvhJOi NiBcitq8f8nmlhfpMy/6L/xX+oDfYelnwsy7oYWMvACly8EhxUboDA4IgOHGu41nRB+m +PGNRrbWE39Bgp8tAI+MTyNI7uPwRsrhcr7kwuK+L/G0fTBNBBFUxjuTBB2Ql+YcfiKK wmIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B2d41aRp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id h18-20020a170902f55200b001d0916275d6si6424117plf.418.2023.12.06.07.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:49:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B2d41aRp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AF320826F7EA; Wed, 6 Dec 2023 07:49:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379416AbjLFPtS (ORCPT + 99 others); Wed, 6 Dec 2023 10:49:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379121AbjLFPtR (ORCPT ); Wed, 6 Dec 2023 10:49:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFE459C for ; Wed, 6 Dec 2023 07:49:23 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50267C433C8; Wed, 6 Dec 2023 15:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701877763; bh=+J1QdopcvWpX9zfxJIE8u/JzSE7fFRVzBYM2a7CKdXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2d41aRpP78BtGO5A+ZqppqUNq24L9RxjSDmHvlgFX2vgeXyTyAZHVXUESWvLQiGj 7NyrI9V4FwSH2s14/MJWFedHMoU8y8K+2UZB3v6aRlgMcwfRlvtzd0cY3UkU9J4Fzj uCES3fjJnxyMNRLgFXZG78O42SFZXr2MK49uzZrLlbxd0XxRbLu/ZFIuN5QhAWqP8I 3j+JmeZddkPH4Yp1VMn6eRvw+7hZa0AiB9HqEEXD3z3sguH1jPKaVH1GWkRMSszpMV zWStW2xd8YsZtKHuQIzE3SaoN2PrUzDX3pnXVmFtEZdSUhBVYp3mzoqvgHaB7FbFoU AKkwkO5aIka0w== From: Robert Foss To: Dan Carpenter Cc: Robert Foss , linux-kernel@vger.kernel.org, Thomas Zimmermann , Jernej Skrabec , David Airlie , Neil Armstrong , Daniel Vetter , Maarten Lankhorst , kernel-janitors@vger.kernel.org, Jonas Karlman , Maxime Ripard , dri-devel@lists.freedesktop.org, Laurent Pinchart , Andrzej Hajda Subject: Re: [PATCH] drm/bridge: nxp-ptn3460: simplify some error checking Date: Wed, 6 Dec 2023 16:49:16 +0100 Message-ID: <170187770273.918857.2541227849014994026.b4-ty@kernel.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <04242630-42d8-4920-8c67-24ac9db6b3c9@moroto.mountain> References: <04242630-42d8-4920-8c67-24ac9db6b3c9@moroto.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 07:49:31 -0800 (PST) On Wed, 6 Dec 2023 18:05:15 +0300, Dan Carpenter wrote: > The i2c_master_send/recv() functions return negative error codes or > they return "len" on success. So the error handling here can be written > as just normal checks for "if (ret < 0) return ret;". No need to > complicate things. > > Btw, in this code the "len" parameter can never be zero, but even if > it were, then I feel like this would still be the best way to write it. > > [...] Added suggested by tag, to reflect Neils feedback. Applied, thanks! [1/1] drm/bridge: nxp-ptn3460: simplify some error checking https://cgit.freedesktop.org/drm/drm-misc/commit/?id=28d3d0696688 Rob