Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1565631pxb; Mon, 12 Apr 2021 00:48:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwalW7sB/pJrmjFctC7SXm/11l9Q0Clau9XBmG9t+46l6iN49Lh+l7mScHqje/piehDtX9l X-Received: by 2002:a17:902:aa8a:b029:e6:64bd:e29d with SMTP id d10-20020a170902aa8ab02900e664bde29dmr25545259plr.24.1618213696346; Mon, 12 Apr 2021 00:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618213696; cv=none; d=google.com; s=arc-20160816; b=GN5ial6kHpjHS7cEjAIRB/Qqkkzuyo71T0cz0rjp4dqVa1twrMeLTOIu8w+HLMhhDT UI6Q8sK0ew07QVzPW0z1AtnIBr/MTFtUMv2ohQFihwswiGcT8ggrbo6SVDG+DXagc4Y8 wfti87NltMMz9BOxmGEkWq0G/6XCwEI4l3k70gbT+ElaI1lqnG3HEuzgcWCU3jAHM9rm iorfHMTSRh/cTnvzUJWWIObHxTbU8bHSmrXcV+37SNH4xYMbk5QTMNNhAN70oIMKqZNx /T7whKwcsJ25LCcuW4DP+6h3j0H0l+dQ47wut704FjUYcqJqQuacTchBD2trBbdRwn9Y /g7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=rYU4gbLeGAQPc5kjLRfVjCz/thSfTR7vClu5eRNAKVs=; b=wXoW8Z9sjUoEUNfMipR8J8A9RGRUTGytDiwJ0+X07SxdHIHnCPtkkHR+KvAyj7q+cE uxZwpSgF2d3T0S989F5x+GwBM7shp77Wd/zQsiNITX7dq7zzG1bBsRi4upHYOdZs52lb c9uRg30zkFUHytE3mYVapsr7ncSbkE+vEIniEa0LEWvIuFBvWCaHY3qpJbQdDwyYHDdV qloc4b9yWQQJnJPdI+MXBJeZYcwExyBnINEp4OT9UE7wCInH5SgokKaZQ6x418IJyZ5b 4vmxWxonG4mWuw+n8Ly130EPJOC5kIYCnmPJag2/TFvBTMRBvTBiQiUMHnJ2LqVShVFF NDYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pyowjiPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 95si13293758pla.43.2021.04.12.00.48.03; Mon, 12 Apr 2021 00:48:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pyowjiPG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236970AbhDLHp7 (ORCPT + 99 others); Mon, 12 Apr 2021 03:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236942AbhDLHp6 (ORCPT ); Mon, 12 Apr 2021 03:45:58 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 323C6C06138C for ; Mon, 12 Apr 2021 00:45:41 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id s16so7219553iog.9 for ; Mon, 12 Apr 2021 00:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rYU4gbLeGAQPc5kjLRfVjCz/thSfTR7vClu5eRNAKVs=; b=pyowjiPGf2w/246JdUtszTOP+JlnvdvqDq1euQF5Y1vDruWC9FrBmDKjHcKz0aphXC uiU+kFZBkeIARVPcGCgxzE6yDzCD5gHhfmU5Z7EHc8RaDcigJYZwk5l7/jIObybPUylL LYwXzn4teL8p7Yadf2nc8K23nVGREAtHfUGsYhU6531A0Ca6hau1Ka/4e+WC9T9BwWhk vT6ajvuSzOxOZK4gd3k+ywzyLch7AZOvcWFwe4BDklJ4/aY/D0SYQm9AAXsRDPyCmphA ctTUeitUfyYLRr0jwryT44bfvTlmPrWhvVt15GlTLguBWFqz0WTtX56sWwZI0tP5Df11 MI9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rYU4gbLeGAQPc5kjLRfVjCz/thSfTR7vClu5eRNAKVs=; b=PxCJeqbNxh6h7dKR425pSfiSb+mdmtKSXOJL/5YpGU0N2sXGNgBtfpbpfJyNXBmWhJ acW4u8l/jOUn6ct08+irsxLUAriQPYgV+kkXy+somAyNXnmy1OiL+uTPvX09ZpIED0Rv TujiKy97WvLHf+2Zjhg9xOcdgU7uEG1GbXoLsp8i8F8rAU+mNu+SwCFxpR2X2xnZe+TJ KWWKYjdt91AyUoA5BrZZKCntLZdhdIZix8WLUHyT93QatAm/17L7ti3fjhkPWUp23hEO 1KPMAGr/3cIzEe/KRvDl1RaQ/+82xeSLEdrnMqMh3YpKqKusHRauacxRcpBzmoeBdNHC wC1w== X-Gm-Message-State: AOAM532Iz93dCBSuHa8arKbCGun+rEjIbLagOFPRu3DRi1BZ9K1bCxtQ VvqClCoICmjLfYLhOdGVTIvovYrgD8j/bU8o X-Received: by 2002:a02:b1ca:: with SMTP id u10mr26782374jah.99.1618213540056; Mon, 12 Apr 2021 00:45:40 -0700 (PDT) Received: from [172.22.22.4] (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.googlemail.com with ESMTPSA id g8sm5174600iln.83.2021.04.12.00.45.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Apr 2021 00:45:39 -0700 (PDT) Subject: Re: [PATCH net-next 4/7] net: ipa: ipa_stop() does not return an error To: Leon Romanovsky Cc: davem@davemloft.net, kuba@kernel.org, bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210409180722.1176868-1-elder@linaro.org> <20210409180722.1176868-5-elder@linaro.org> <1f5c3d2c-f22a-ef5e-f282-fb2dec4479f3@linaro.org> <6e0c08a0-aebd-83b2-26b5-98f7d46d6b2b@linaro.org> From: Alex Elder Message-ID: Date: Mon, 12 Apr 2021 02:45:38 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/12/21 2:26 AM, Leon Romanovsky wrote: > On Sun, Apr 11, 2021 at 08:42:15AM -0500, Alex Elder wrote: >> On 4/11/21 8:28 AM, Leon Romanovsky wrote: >>>> I think *not* checking an available return value is questionable >>>> practice. I'd really rather have a build option for a >>>> "__need_not_check" tag and have "must_check" be the default. >>> __need_not_check == void ??? >> >> I'm not sure I understand your statement here, but... > > We are talking about the same thing. My point was that __need_not_check > is actually void. The API author was supposed to declare that by > declaring that function doesn't return anything. No, we are not. Functions like strcpy() return a value, but that value is almost never checked. The returned value isn't an error, so there is no real need to check that return value. This is the kind of thing I'm talking about that might be tagged __need_not_check. A function that returns a value for no reason should be void, I agree with that. In the ipa_stop() case, the value *must* be returned because it serves as an ->ndo_stop() function and has to adhere to that function prototype. The point of the current patch was to simplify the code (defined privately in the current source file), given knowledge that it never returns an error. The compiler could ensure all calls to functions that return a value actually check the return value. And because I think that's the best practice, I'd like to be able to run such a check in my code. But there are always exceptions, and that would be the purpose of a __need_not_check tag. I don't think this is worthy of any more discussion. -Alex