Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1652841pxb; Mon, 8 Mar 2021 03:05:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRJai3sLF0fyXOgvI+sMSZvxW3Z/7yBluSjTDjQtvSrJOYMNMAJW0ToceJGhuhCzsvccY4 X-Received: by 2002:a17:907:37a:: with SMTP id rs26mr14417962ejb.336.1615201537996; Mon, 08 Mar 2021 03:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615201537; cv=none; d=google.com; s=arc-20160816; b=03hHmm+LeZm3zYjrw0XeAnndJBquheoVUZ6JLT5JSRiRNneDdTiElKlKNHw7LKOjLt sCFoDJh+JS02sES6+ext8vHBEcENjcy79d5doJQpoasHuIhA1nl4EbfIdJFWhSMRvLhE bnGJE/fV6PaAzP1y/Ytoi9Hk65YtVn1cUBTSPU9YBdjri47iMe1/AR4Xri1Ta6ku9nlE e5gYxWo15/xXNz+hA+BwhfQzAYiVD2KhrlsCyFc1eny/6azt14fBZV5uMMOU1IcnvPLR JoXv4h3/W65wqp/NdJNMqUJ4ISSQz0xdCLgWiGBK/SUDlrjkXN9pYArXjFOGaSZ3Lg3W t1zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=rfybG7WMqbDtBpMMoclawRvqWnh5L6HbhhBTsoDc5YM=; b=OxcrIR1SZGYjIl9H3PVIPAcKV4mJ1WHDWvd61bUt4saNhJQbnQQoygS76l1lD1FFrk GeITfy/fLchgngIAY9ZKTl9vhZKNEDnD5bl9gPUzNrUeNuq3P0UChMXNE0A3BUdL7zY5 8PvpG/mkG7ELx0PrbsezccQypfT9K+MuOVVUx/zeGF4dbvHoY4VBbirIgHDwVx2LBVjD 3svVy+n/BCxieiFi7OiNRBfP2hEZpdNQL7DpCrTq0LiSfn7AUDr6ybbqzxbxfVHrEUvK b8WXps36qylS51nrHpGsRjodTy7BSeAjTfXDo7tsbNJPl/CIVoJCI4w/FJ4MxSdzzaV+ Av0g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si7383126edo.259.2021.03.08.03.05.15; Mon, 08 Mar 2021 03:05:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbhCHLDp (ORCPT + 99 others); Mon, 8 Mar 2021 06:03:45 -0500 Received: from mga07.intel.com ([134.134.136.100]:64817 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbhCHLDd (ORCPT ); Mon, 8 Mar 2021 06:03:33 -0500 IronPort-SDR: SyVzqETPbb74sJTkkiyxuR4UWEfqrnXeIf9hcWufKUT9Dm5akhH4doBqR5Tahb8/gnGUsug00A dV9Uxf8hJb2g== X-IronPort-AV: E=McAfee;i="6000,8403,9916"; a="252034593" X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="252034593" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 03:03:31 -0800 IronPort-SDR: 8qnIpvCzxLlGKtqfgGNsGex/GaOwnLG/jmxhee2H32k5ugSmVQmpS0P3tKgvPwjoDHLqh4hJjX 1qhifclxNi8A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="508891474" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 08 Mar 2021 03:03:29 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 08 Mar 2021 13:03:28 +0200 Date: Mon, 8 Mar 2021 13:03:28 +0200 From: Heikki Krogerus To: Yang Li Cc: linux@roeck-us.net, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] usb: typec: tcpm: turn tcpm_ams_finish into void function Message-ID: References: <1615185330-118246-1-git-send-email-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1615185330-118246-1-git-send-email-yang.lee@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 08, 2021 at 02:35:30PM +0800, 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 Reviewed-by: Heikki Krogerus > --- > > Change in v2: > -remove the unnecessary return statement > > drivers/usb/typec/tcpm/tcpm.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index be0b646..8159229 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) { > @@ -790,8 +788,6 @@ static int tcpm_ams_finish(struct tcpm_port *port) > > port->in_ams = false; > port->ams = NONE_AMS; > - > - return ret; > } > > static int tcpm_pd_transmit(struct tcpm_port *port, > -- > 1.8.3.1 -- heikki