Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1580352pxb; Mon, 8 Mar 2021 00:44:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5ZUxiD4reozQuGXbBYUF8S/ReyiJNN1H4vTMaS4T40uqX3e56zXp9M7kE8owLXBeRrrRM X-Received: by 2002:a17:906:3801:: with SMTP id v1mr14215458ejc.353.1615193057281; Mon, 08 Mar 2021 00:44:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615193057; cv=none; d=google.com; s=arc-20160816; b=Eavf6ig9sGtwozI0XcpRhu4WSKjSTGvm2JNM1rwhEqh7RQPnrgVbVKKoIo5Gg7dj74 +zlW4/zaXPU54uDbLdIXH8an31qcsJ1sFwlHssBx4/3/i8JSVfH9mO5qBvq5xDkihbr8 Yjg6bfeYHS3RGZOGvhokAVnjhRoSMGf/SOx3FwrpZ7TqHviSlHLPUQdUZnTj9IbrkLzO azSzjQF0rrDHSekLPJWpjwGgymQPR4CK21cd39vj9ozaFV2WJwvMu0oGAXBFno87ggsc 7t/cHY2nhYX0jsai64stsFQg0PDe/SHBpivS5t4HVS39GwDTnjHRyma8mKza8zLXUjSP 1wEw== 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:autocrypt:from :references:cc:to:subject:sender:dkim-signature; bh=Oo6n5coh1Ux7gva9+ucMVI4jLDO3YMSvAii17So5ccc=; b=eErBaNi8nT64uJ8/FdhBf9HqjLebHeMH690lRQFZxA+PoSzMdSfHnzalvO9n8c30Ih DAiXcDfhMUuQ325Fh8FjDFkVL56E+95dmcJ1AR1LZ3ITNsjKhNphtTADW0ANwPGEXQY4 xIiwWY9SVIhDxroJ1kE6McK5TS1VpFQkR/V1Z7Y2J4DwnnZuRBG3DQIo4GxJO9h1GqG1 B9Q4S7PyIv1LfIupuK97UyzCtzK6k5eoSp1TGzz39h9XvLoXy2DBpsKpAdDLJ70luOGr yyIH2KlRaA0KqJlY8xg7fU6zrpt22T5xZInpPuQAyjmhGpwGfPVV8n6sBp4G8wniqoB9 V7WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="J9qjIpL/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg1si6393570edb.610.2021.03.08.00.43.54; Mon, 08 Mar 2021 00:44:17 -0800 (PST) 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=@gmail.com header.s=20161025 header.b="J9qjIpL/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234895AbhCHGai (ORCPT + 99 others); Mon, 8 Mar 2021 01:30:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234885AbhCHGa1 (ORCPT ); Mon, 8 Mar 2021 01:30:27 -0500 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00CCFC06174A; Sun, 7 Mar 2021 22:30:26 -0800 (PST) Received: by mail-ot1-x32f.google.com with SMTP id f8so3145940otp.8; Sun, 07 Mar 2021 22:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Oo6n5coh1Ux7gva9+ucMVI4jLDO3YMSvAii17So5ccc=; b=J9qjIpL/jq+80WxU/W3OmH+VEHe6mG3ue5/39+J0vn9fR5VN4zDF/O2iHtnrBhlEJO AUnENV94Dk4bZ+qWLcTqYFv3ss7rlwX0ZMO3Wh3wUwt+oopHDDA8TnZfndaBQXNjp8Yi qVWfSlWT0LdUlKNzq/J7ul5dXOhFqVfStpCp4qeo7CJ1FlrCBDQK0klznQShw+a8C1Lc 09dz77HTaaZfFlmsSLAou+tlOPjijwr3z02pHQeu/4bu0caco55pfjyB3hUY6Vj2Fyd6 SZDm8hP/nSlLuueTyotNBRydwN2BQ84D73c2QEq0Q0AWsWEr864ZmnEP8aC/6cNgWTEb 5aHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Oo6n5coh1Ux7gva9+ucMVI4jLDO3YMSvAii17So5ccc=; b=e4llhhGdpmPAMH4xCZujdHJNFB4dxbHshMSsze9Asqo3gYEBV00LBDeLRMsGJRWQmL q1kxhF44UdCM13jCbVIKg75PZ2PzEJFx0DI9geN50ctQP9dV6+xod0PiRbP2hBhnMoMV adyQmk8UmSf3DI100ufKXfx55PlzfG9pxNVI04ocRuwfeNAxMXBq+pJy6SYGmRcUkeiO g5O7lrHJKjx2TpfWsvO6NgCMrT6PLtXPMpL5SmXq1mmtBmSEcbMVykDruPDvK3DxgBZ2 9VsQPsk+3JYmEuoZHFyYCDxSpPioLYLJkJaSAL5gdaUg9OCMxMuYDlhOEOtbcCqHwuGO w76w== X-Gm-Message-State: AOAM5323TFIUYAlrBznCoLY1kgvYK9B6p+RwoMQGEScO8DLS/EG6Emrb D8Cl1sxGV/QLYGR5qes+BsHX5KwiH6k= X-Received: by 2002:a9d:53c5:: with SMTP id i5mr17723895oth.159.1615185025918; Sun, 07 Mar 2021 22:30:25 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id m34sm2527774otc.25.2021.03.07.22.30.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Mar 2021 22:30:25 -0800 (PST) Sender: Guenter Roeck Subject: Re: [PATCH] usb: typec: tcpm: turn tcpm_ams_finish into void function To: Yang Li Cc: heikki.krogerus@linux.intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <1615184481-102148-1-git-send-email-yang.lee@linux.alibaba.com> From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d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Mg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= Message-ID: <385d74e5-6b75-f20b-d589-0fb77e233c52@roeck-us.net> Date: Sun, 7 Mar 2021 22:30:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1615184481-102148-1-git-send-email-yang.lee@linux.alibaba.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/7/21 10:21 PM, Yang Li wrote: > This function always return '0' and no callers use the return value. > So make it a void function. > > This eliminates the following coccicheck warning: > ./drivers/usb/typec/tcpm/tcpm.c:778:5-8: Unneeded variable: "ret". > Return "0" on line 794 > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > drivers/usb/typec/tcpm/tcpm.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index be0b646..6ee984e 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -773,10 +773,8 @@ static enum typec_cc_status tcpm_rp_cc(struct tcpm_port *port) > return TYPEC_CC_RP_DEF; > } > > -static int tcpm_ams_finish(struct tcpm_port *port) > +static void tcpm_ams_finish(struct tcpm_port *port) > { > - int ret = 0; > - > tcpm_log(port, "AMS %s finished", tcpm_ams_str[port->ams]); > > if (port->pd_capable && port->pwr_role == TYPEC_SOURCE) { > @@ -791,7 +789,7 @@ static int tcpm_ams_finish(struct tcpm_port *port) > port->in_ams = false; > port->ams = NONE_AMS; > > - return ret; > + return; Unnecessary return statement Guenter > } > > static int tcpm_pd_transmit(struct tcpm_port *port, >