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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DE844C433F5 for ; Wed, 24 Nov 2021 04:02:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DCDA182F9D; Wed, 24 Nov 2021 05:02:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Oelpkk8i"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0521082FA3; Wed, 24 Nov 2021 05:02:04 +0100 (CET) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7EE2881918 for ; Wed, 24 Nov 2021 05:02:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x736.google.com with SMTP id t83so1443691qke.8 for ; Tue, 23 Nov 2021 20:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1cuVrHoWGGsxbR+b053j8JgplEehufQI6qk/sgzBrjE=; b=Oelpkk8i+s2sItwSxalb0jsDtcohLNaHiSXTztr72FdrpBKHuBGYlCnU+T2BMBroXI ocjE/brjCGhTbtbkOxW9cXUzLq5xOTRZ6ctlyDEvbAHudvUnTcrfTSEz5dt5r/VEZBTp hcLfQ6TXNBsb9UTA7fPyp9ugVCHW5M6yaMjBl1Fx6ElFGTOOR1iOoU318EFt3ojIE9IP Kc3wpgdwiWDCjzsZcaM4JdVQUdaQ5+CT93/6DgqaIwDeQjTv3YlydAZbYlW/qUuiQhD3 Rt0/Tv8nfrJPQxqC0VwG+JZRRpfc2U7E5cwQlWH8g1zFgaUpavq2mkPs/tsrZoz7XOzR MLbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=1cuVrHoWGGsxbR+b053j8JgplEehufQI6qk/sgzBrjE=; b=uVaI9/+2+0u249rIPISZA3WySUxgAXUZeHXPvP+s99Ww5ndkQwrQ5NQc/rrCwYp3gx 7wfRCbODnzRVxRvthNrc1hPn4bxCiiHpBvInTLCXge42x7U5mDTmWIw4lalrijc0hwjR 2yVotQp87knVtwUTbWp+zAGTlsTtW2OLy54nycja6zLoZYNALvlMU44v7cXPtZXd61vK 0jnOibyTMphEzzUvud7STUOL2Q0L/TMElshznIPPuYuRH6Wpd0V8NJaWz+l2BLHKzfhr J74zcXtDSs/byYVYa4vXANNJvQhU9Gd6z44ZzASnuMeBqmkoyLGb13SJbfDo9SpsRGe5 JZxQ== X-Gm-Message-State: AOAM531AJ0MDMSXlsl1aQOgs2BT6giV9oa500XJIM3dBr7RAYX5xRE4n 1W+uSP1Ph1UsmSezK65cWWM= X-Google-Smtp-Source: ABdhPJwfLMzC6qtfKtYC3R+tKJcECJFGcDC1vfmLMvfHyo2eDCKpVuVjPfNTDv/IhxgXKQcZ1ly+dA== X-Received: by 2002:a05:620a:5e4:: with SMTP id z4mr2639706qkg.496.1637726519061; Tue, 23 Nov 2021 20:01:59 -0800 (PST) Received: from [192.168.1.201] (pool-108-18-207-184.washdc.fios.verizon.net. [108.18.207.184]) by smtp.googlemail.com with ESMTPSA id d13sm7579708qkn.100.2021.11.23.20.01.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Nov 2021 20:01:58 -0800 (PST) Subject: Re: [PATCH v2] clk: fix clk_get_rate() documentation To: Giulio Benetti , Simon Glass Cc: Walter Lozano , Patrick Delaunay , Dario Binacchi , Jagan Teki , U-Boot Mailing List , Jesse T References: <20210214021718.2235342-1-giulio.benetti@benettiengineering.com> From: Sean Anderson Message-ID: <20e951e0-fee0-e2da-9e15-9a35c9ec4181@gmail.com> Date: Tue, 23 Nov 2021 23:01:57 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20210214021718.2235342-1-giulio.benetti@benettiengineering.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 2/13/21 9:17 PM, Giulio Benetti wrote: > Improve clk_get_rate() @return documentation that otherwise is a bit > ambiguous. At the moment I expect to return 0 as error since the return > type is 'ulong', instead the function really returns negative value in > case the corresponding function pointer is null and returns 0 if the clock > is invalid. > > Signed-off-by: Giulio Benetti > --- > V1->V2: > * previous comment was wrong, this function returns negative value, so let's > improve it's @return documentation as suggested by Simon Glass > --- > include/clk.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/clk.h b/include/clk.h > index ca6b85fa6f..5a8c7244d0 100644 > --- a/include/clk.h > +++ b/include/clk.h > @@ -344,7 +344,8 @@ int clk_free(struct clk *clk); > * > * @clk: A clock struct that was previously successfully requested by > * clk_request/get_by_*(). > - * @return clock rate in Hz, or -ve error code. > + * @return clock rate in Hz on success, 0 for invalid clock, or -ve error code > + * for other errors. > */ > ulong clk_get_rate(struct clk *clk); > > Reviewed-by: Sean Anderson