Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp336651pxb; Wed, 13 Apr 2022 02:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydbk4pV8xJ4P6fiqHL54uXmFMJF3I8Mpj0UOnElHxs2CMbytL+Z++eHv3isO8b6iw/R80o X-Received: by 2002:a05:6a00:1683:b0:4f7:e497:6a55 with SMTP id k3-20020a056a00168300b004f7e4976a55mr42074485pfc.21.1649840742590; Wed, 13 Apr 2022 02:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649840742; cv=none; d=google.com; s=arc-20160816; b=rx/2mvsswHOJx9aHo7U4CySAjbTqJ7AWZmE52c9jh2/MWLsj1iNjtufB1pnzsA1RH1 nNFGVfdgT0hFfsqomvVbHMDknCYQ/vDYhpph+//QxLYHl9rmfk4Nu4v7149cQKNBVajk 5RFbJnRDTfjdbfzHM3fNvEe4B5c2gb/QucbM2D8soqkMD0UuQbRjMb9Fpd64fJGHisn+ Syi+pDIfyXd8PSGaC7ujsfemK9STq2sdyyaq7SSmbZonkHb8Gs28pvJllyJrlJEmi354 UyrvOW3hHTtzpjwxqU2Xc0TI5C/hddm1FtPubNujOpv+kHLk08OchWmP4H7+vJ7Uwlfe j1qw== 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=Xj3NkHVQDUDdPGRvpYOra85n0Y6fiRtoa7goWufEXwA=; b=ECJMtQCjI+M/SgQO5AdueNHiTE3uoGXLjXJ6rfSCbyYI/XO3d0NHqwzYj0frsQkp1K zORhd+Vkl/aM1t+EWXXxwweCHtr3Sv/TRnF0+wLyV+HIAj8Kif9jIu7Y2WDZ3p93IPqG V2UdVNBCeIliSQPLRV+UbZLbJbGfEv0HUuFcoI62XFtHWzJTYWH36TILLIP2zNGxz2r4 ezAu2PN8v4iL3dmRc6/+BfLIUVpOH7eLah6QX7NamKrseHBXMv0WHsRlz/A6Czqc6+Nb WIIiaiOgxw0/zM6MRfk+DiUYpH3ltgLD/Pz14JooBp2AZhCAD//cxOoasv/IHko9nFoL QbXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IipliNok; 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 y23-20020a631817000000b003829aca2624si5152521pgl.460.2022.04.13.02.05.28; Wed, 13 Apr 2022 02:05:42 -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=IipliNok; 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 S232696AbiDMGiV (ORCPT + 99 others); Wed, 13 Apr 2022 02:38:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232348AbiDMGiU (ORCPT ); Wed, 13 Apr 2022 02:38:20 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED7324D9EB for ; Tue, 12 Apr 2022 23:35:59 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id i27so1864119ejd.9 for ; Tue, 12 Apr 2022 23:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Xj3NkHVQDUDdPGRvpYOra85n0Y6fiRtoa7goWufEXwA=; b=IipliNokdRI0CsxMkUB9sqMWtAmv4DupWgoqxkLCSQ74xweyTK8fAwpOQVUumnb/Ps RbAND6snNPJ7LjU/cKI5mR1LHnBUScPIBtY1b9LdXQZr8nXcWSAg0bah4x94O0YrRguF BlgBtqBl147T4yDft3Oi7PchBTm7tXtUXSSa5S/jJTyk1L5nTAxYZT8i7KWkdZjqe6k1 b7FxseDFhrdniTXrMTxGi/M0yuAxT5BJf4vhhg0uuqugoY/e/ExjL0moavcwzT9WBD+R 0gAON8z7M3iIoccFr1CaYoVF89IfYGaExxy0PMKlakNuyAA2u35aswmnNaQ3TLB3YkpD 9N8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xj3NkHVQDUDdPGRvpYOra85n0Y6fiRtoa7goWufEXwA=; b=KREFPxmTF7be6s/Ld8+fSmmYVg6srQNh2RHYsuAvfbOQky+NrdnqTD34mOrAsoY6qr 1BAyKgRzGyKRS9by9YqRvJER1rPoFUmpuGGznmVxN5tulML75xHqcmoQ2VRj5inJOBOX o9DHjZ99WSUqc4WSbs5VxskB+z1unWyef5YR+BaXDTm2MT7igiKlouObGjvdM0KQsWf7 k+2ag40oMGSaft6nWAz4c/A6ts2bKcqoUQIRW+YtTPOGcLRcMTGcJkC5oxeGTS/KJ2oV Hiso23BBa5EOWsHlGalQTysc+FUlAQlvHkRTBLqST0eWM46mv/UO/fWgC3dHl4aENXNQ eN+g== X-Gm-Message-State: AOAM531RXgEBnThDx7N38doYQAs7AheUZeemFArnEfHzCAu5h57Y1DvC tUBy6N5FPIfbjh6l9gntcNM= X-Received: by 2002:a17:906:1f11:b0:685:d50e:3bf9 with SMTP id w17-20020a1709061f1100b00685d50e3bf9mr39244987ejj.275.1649831758439; Tue, 12 Apr 2022 23:35:58 -0700 (PDT) Received: from leap.localnet (host-79-43-11-75.retail.telecomitalia.it. [79.43.11.75]) by smtp.gmail.com with ESMTPSA id s2-20020a1709066c8200b006e4e1b1f875sm13226169ejr.199.2022.04.12.23.35.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 23:35:57 -0700 (PDT) From: "Fabio M. De Francesco" To: Julia Lawall Cc: johan@kernel.org, Jaehee Park , elder@kernel.org, gregkh@linuxfoundation.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, outreachy@lists.linux.dev Subject: Re: [PATCH v2 2/2] staging: greybus: remove unneeded return Date: Wed, 13 Apr 2022 08:35:55 +0200 Message-ID: <6300782.K2JlShyGXD@leap> In-Reply-To: References: <5792471.alqRGMn8q6@leap> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="ISO-8859-1" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,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 mercoled=EC 13 aprile 2022 08:16:20 CEST Julia Lawall wrote: >=20 > On Tue, 12 Apr 2022, Fabio M. De Francesco wrote: >=20 > > On marted=EC 12 aprile 2022 21:59:15 CEST Jaehee Park wrote: > > > An empty function with void return type does not need an explicit > > > return. Issue found by checkpatch. > > > > > > Signed-off-by: Jaehee Park > > > --- > > > drivers/staging/greybus/audio_codec.c | 1 - > > > 1 file changed, 1 deletion(-) > > > > > > diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/ > > greybus/audio_codec.c > > > index 0f50d1e51e2c..3e3a16568def 100644 > > > --- a/drivers/staging/greybus/audio_codec.c > > > +++ b/drivers/staging/greybus/audio_codec.c > > > @@ -1032,7 +1032,6 @@ static int gbcodec_probe(struct=20 snd_soc_component > > *comp) > > > static void gbcodec_remove(struct snd_soc_component *comp) > > > { > > > /* Empty function for now */ > > > - return; > > > } > > > > > > static int gbcodec_write(struct snd_soc_component *comp, unsigned=20 int > > reg, > > > -- > > > 2.25.1 > > > > > Hi Jaehee, > > > > If I recall it correctly, Dan Carpenter suggested to remove this empty > > function. > > > > When developers remove lines of code from a function which becomes=20 empty > > after the removals, they also remove the resulting empty function and > > delete all the calls (if there are any left) at the same time. >=20 > It's probably not relevant in this case,=20 No, it's relevant :) I should have been more exhaustive :( > but the function could be needed > if it is a branch of an ifdef. Also if it is stored in a structure field > and the user of the structure does not check for NULL. Here we have one of special cases you've mentioned. The pointer to the=20 function is stored in a structure field _but_ we know that the user does=20 check for NULL. Thanks, =46abio > julia