Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp215595rdb; Tue, 5 Dec 2023 03:34:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFv4rMZXGsJBwmksQK7sHdMvJegyJnM1FeCrxEIeNpVWnG0fOfqECJ/dEdTgqV3peA7Dw2R X-Received: by 2002:a17:902:8ec5:b0:1d0:6ffd:e2e0 with SMTP id x5-20020a1709028ec500b001d06ffde2e0mr4711328plo.122.1701776085870; Tue, 05 Dec 2023 03:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701776085; cv=none; d=google.com; s=arc-20160816; b=xtxKeUBNJ35j6ZK2MXIFDvkcV8P9hyl8pdA156F46RYhCcX68t5PKCFtDVFpuDeizo iWr+aMU14SpuH0/CdHNK2bxsh8Uut/T6cFLH38QcyA60JtTe42AvIqHtuxadGd6uuAl+ xVpVorjYF2kvYRDF9hkXWvwD14hOjQauYbp9xolXz3r0qQ9EzQJGW/y2C7v7PlndLZdq 8dZl5NJsAdRwoMm0eyk9blM3r+uvMnDDBtbYK7MHd/yj9Stf76GU0uq4PDWyZQYbBdzr QZ6GnAQ39fCZG7ovfYJhb3x+oy/hvCHf5qOeIkZVqMybcxp9ZlJarHxq1wK4KX9z0cxT 3yWQ== 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; bh=04okbTBxerRPWPhJAtj+aIooST7hVdcytoeU6FYNOaI=; fh=soyrWpEe5dDqPnzkgqsZCwVQv1ACuM20V7vEXQn0cxI=; b=IwCibDM3lqqaCPkRkJMz5/dBxdTQS+mCi816dvGT1+OrtrfMICVRF2pS0KTBXSohVc pcBs6InAUago5StY8fXbE7QNx0BbcMQR8GmjTksOkdVlIAH34lqclCmke/Vhc+1GbnUT 89CYVmlDfT7qdTA4dg3Ayn69OCbFB1rxJ2v8KYnGzmLKMAu+0sDDfI/w6rvn2OWYlf4k H8Y9pzR3DPOcvQx1D8Epm4OqWrY5iaHD1fTSyR0v6ZPMo6I5dRcJCaTWg0J5YNIlzCUh LeOhGhPVzNqf8sYLKQrU2FDVPZ8G4jnWijJXchS/ks8CQYKocto9gy6yMjnl1h1eAP7K ORLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id i4-20020a170902c94400b001cfb52101e3si1994242pla.413.2023.12.05.03.34.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:34:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3380B803BAA8; Tue, 5 Dec 2023 03:34:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347062AbjLELeN convert rfc822-to-8bit (ORCPT + 99 others); Tue, 5 Dec 2023 06:34:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442108AbjLELd5 (ORCPT ); Tue, 5 Dec 2023 06:33:57 -0500 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F211AE for ; Tue, 5 Dec 2023 03:33:27 -0800 (PST) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-5cece20f006so64426877b3.3 for ; Tue, 05 Dec 2023 03:33:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701776006; x=1702380806; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FK8pG1Ch209D8ULQ7meBK4Xhko4HHTTJW9BjU1JAjGs=; b=UJmsH1WymDukqN13X6HVQeCSHJgy81PZoLIpPp01PQa2+IaSa3YMJyHv3RDGQefohb CszMfONFMtlPrN3eH3yc/bHyUc5MOBm4Al/c/akeHH0vXLV3MpZMt+Oflarei73spkRb qQfUIEQHDRhav4BEJJchINpimhLFDKpjdgNf5Hnte4frRsXYlTnjTTc78NKirDd58B62 OkkBgBOlfALE4Q5eB1V4ipeBIKuhnRFokt3T2uNNo7ppZrjUjGqlgu/o8uZAGWBg6bdJ HB5DtbsLh0fOKcGZYy3gJUV85XaG46OgZVRvawxmPfAtwfL19Wu/f9m8G4XmdhBvYrah vQRw== X-Gm-Message-State: AOJu0YwFba7jEEp6YNzcu/7Jib41pMWmgF1gCdg59cx3QrsTbRjTzuGf kyIEgwM6ZzCBB5Da9f6QJJE2SSDE8K2Xww== X-Received: by 2002:a81:79cd:0:b0:5d7:1940:f3fa with SMTP id u196-20020a8179cd000000b005d71940f3famr4437648ywc.98.1701776006568; Tue, 05 Dec 2023 03:33:26 -0800 (PST) Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com. [209.85.219.179]) by smtp.gmail.com with ESMTPSA id r20-20020a0de814000000b005d39c874019sm3790951ywe.66.2023.12.05.03.33.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Dec 2023 03:33:26 -0800 (PST) Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-db544987c79so3890444276.2 for ; Tue, 05 Dec 2023 03:33:25 -0800 (PST) X-Received: by 2002:a05:6902:1008:b0:db7:dacf:6fd4 with SMTP id w8-20020a056902100800b00db7dacf6fd4mr5436314ybt.92.1701776005540; Tue, 05 Dec 2023 03:33:25 -0800 (PST) MIME-Version: 1.0 References: <20231203052125.37334-1-liuhaoran14@163.com> In-Reply-To: <20231203052125.37334-1-liuhaoran14@163.com> From: Geert Uytterhoeven Date: Tue, 5 Dec 2023 12:33:14 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] [mfd] da9052: Add error handling for spi_setup in da9052_spi_probe To: Haoran Liu Cc: support.opensource@diasemi.com, lee@kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:34:43 -0800 (PST) On Sun, Dec 3, 2023 at 6:22 AM Haoran Liu wrote: > This patch adds error handling for the spi_setup call. The need for this > error handling was identified through static analysis, which highlighted > the lack of proper handling for potential failures of spi_setup. > Previously, a failure in spi_setup could lead to unstable behavior of > the DA9052 device. > > Although the error addressed by this patch may not occur in the current > environment, I still suggest implementing these error handling routines > if the function is not highly time-sensitive. As the environment evolves > or the code gets reused in different contexts, there's a possibility that > these errors might occur. In case you find this addition unnecessary, I > completely understand and respect your perspective. My intention was to > enhance the robustness of the code, but I acknowledge that practical > considerations and current functionality might not warrant this change > at this point. > > Signed-off-by: Haoran Liu > --- > drivers/mfd/da9052-spi.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c > index be5f2b34e18a..c32d5025a18f 100644 > --- a/drivers/mfd/da9052-spi.c > +++ b/drivers/mfd/da9052-spi.c > @@ -22,6 +22,7 @@ static int da9052_spi_probe(struct spi_device *spi) > int ret; > const struct spi_device_id *id = spi_get_device_id(spi); > struct da9052 *da9052; > + int ret; As reported by the kernel test robot: error: redeclaration of 'ret' with no linkage your patch fails to build (again!). Please stop submitting completely untested patches. Thank you! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds