Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1820042rdb; Mon, 8 Jan 2024 11:10:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsh+EaWrQt79WZRwcw97NVTH2jAEsoDVZCAzyUzE86lkak586eJTnWvUD5dsRmyD4zJHZh X-Received: by 2002:a05:6a20:1581:b0:199:3e85:73ab with SMTP id h1-20020a056a20158100b001993e8573abmr1858541pzj.93.1704741012515; Mon, 08 Jan 2024 11:10:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704741012; cv=none; d=google.com; s=arc-20160816; b=sp4cYl+wukPfwDgAmHeE1IOf3JUT/U00oz1z/CnSNu+JYimckTayOVJPQq1DUlzoDQ Ek/NPe/XMK6pXsTJo6LxVcGEhaSkHfAaaQv03JU/ltcv8tRkJ4umk0e6C98p08rSraKw lFMgjl6/D+nr1WrX/B5zj0uS+zM3uqylQzlogzpt7moJIIWRidGz2mM/WH0TU73TII75 O4WdJCmgBvtZos/8WHL//uKVUQVn70aLudxoxAR/Fb3c7IohH2g6P/dVkUGBBadIJ3mZ 4Ol/eTvuRN0A14A4cAz66mtLpjI8NKoQXIdaSY4Ps1uARjuFOLPqnMjqAxfpfbgyhwfW WeTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=mOq/aKB2RTzPjMbrAxOC/iSJc+GWMvTeSluIfsIsb6o=; fh=GBkRxgs7+9UQkiz04ISD5Y2bdPMPShPTSoDcIDaE7P8=; b=UzSZ+b+ppc0hxbZ3p3NBRKWCegXV+yv8GlPuUMc2N63U6M+E/hYVQgzMb1jxtWa3T5 3r9o0bCH14J51xLfjgtfqN8UBXX9XXzgecVXfaAHdptHyX6R4OhKhoa0hQ1xK1DTc0qM 1G9+mcsDCOoENMaR1hhchGr0m/E3Xa/r9eh7bkBcoTvJIyc2evn/zfiFFPGDvovpg4sF 5hXDpU0lA+XpAUBWdjXjX+2w9qbD0uwEq/iqXTZ8mGtTL98OUwVcIylMHcBuZBzuYZw+ yN90lGBvGAkm2YEhN7w0sCggmsMw3bMxsVFGJRhlIUouTpAANrSQksxEE/jdmdj7B+Oc cJ/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=KKlWThMR; spf=pass (google.com: domain of linux-kernel+bounces-20008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u33-20020a056a0009a100b006da25c2400dsi241817pfg.365.2024.01.08.11.10.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 11:10:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=KKlWThMR; spf=pass (google.com: domain of linux-kernel+bounces-20008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 10E9DB22A05 for ; Mon, 8 Jan 2024 19:09:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC0D65576C; Mon, 8 Jan 2024 19:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="KKlWThMR" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92DF554FB1; Mon, 8 Jan 2024 19:09:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from [192.168.1.18] ([92.140.202.140]) by smtp.orange.fr with ESMTPA id MuztrSdK7BraWMuztrazTF; Mon, 08 Jan 2024 20:09:19 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1704740959; bh=mOq/aKB2RTzPjMbrAxOC/iSJc+GWMvTeSluIfsIsb6o=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=KKlWThMRAPRjkJn4Ivdow6dfqTZiVCQ0zlnfp90JaqUuNlVZcWMa7BLViw92ukxMI /S4N+a2Eymwst8/TEZRPC0pd9kZM2JPDLayP6h+TCys51+UBWjGUsQMM+KwJPQdZy9 L+0GjFYbDHvs2MmuXHEJx1kGmJAWITSe8qaBGyuF0ul5ktoAJLrxD5Ojb9UFVthW3S ZlEdrEmZvP13fkfnYmsZYLF11moq7bFHRJepQ3m5/oUMemnWmOYRNuOtPNLXunxsx2 pQ4Hs5pCSFOphZaeoQLTnT8v2VpZLNeK0Y0kxk+1Wql7O/SyM6S1i9tpUYBmvyOIsr 7iMmxvGofr2yQ== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 08 Jan 2024 20:09:19 +0100 X-ME-IP: 92.140.202.140 Message-ID: <4c6b12c9-0502-400a-b2ba-dad89ef4f652@wanadoo.fr> Date: Mon, 8 Jan 2024 20:09:17 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/3] cifs: make cifs_chan_update_iface() a void function To: Dan Carpenter , Steve French Cc: Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: Content-Language: fr From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 08/01/2024 à 10:08, Dan Carpenter a écrit : > The return values for cifs_chan_update_iface() didn't match what the > documentation said and nothing was checking them anyway. Just make it > a void function. > > Signed-off-by: Dan Carpenter > --- > fs/smb/client/cifsproto.h | 2 +- > fs/smb/client/sess.c | 17 +++++++---------- > 2 files changed, 8 insertions(+), 11 deletions(-) > > diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h > index afbab86331a1..a841bf4967fa 100644 > --- a/fs/smb/client/cifsproto.h > +++ b/fs/smb/client/cifsproto.h > @@ -656,7 +656,7 @@ cifs_chan_is_iface_active(struct cifs_ses *ses, > struct TCP_Server_Info *server); > void > cifs_disable_secondary_channels(struct cifs_ses *ses); > -int > +void > cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server); > int > SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon, bool in_mount); > diff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c > index 775c6a4a2f4b..f7b216dd06b2 100644 > --- a/fs/smb/client/sess.c > +++ b/fs/smb/client/sess.c > @@ -356,10 +356,9 @@ cifs_disable_secondary_channels(struct cifs_ses *ses) > > /* > * update the iface for the channel if necessary. > - * will return 0 when iface is updated, 1 if removed, 2 otherwise > * Must be called with chan_lock held. > */ > -int > +void > cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) > { > unsigned int chan_index; > @@ -368,20 +367,19 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) > struct cifs_server_iface *old_iface = NULL; > struct cifs_server_iface *last_iface = NULL; > struct sockaddr_storage ss; > - int rc = 0; > > spin_lock(&ses->chan_lock); > chan_index = cifs_ses_get_chan_index(ses, server); > if (chan_index == CIFS_INVAL_CHAN_INDEX) { > spin_unlock(&ses->chan_lock); > - return 0; > + return; > } > > if (ses->chans[chan_index].iface) { > old_iface = ses->chans[chan_index].iface; > if (old_iface->is_active) { > spin_unlock(&ses->chan_lock); > - return 1; > + return; > } > } > spin_unlock(&ses->chan_lock); > @@ -394,7 +392,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) > if (!ses->iface_count) { > spin_unlock(&ses->iface_lock); > cifs_dbg(VFS, "server %s does not advertise interfaces\n", ses->server->hostname); > - return 0; > + return; > } > > last_iface = list_last_entry(&ses->iface_list, struct cifs_server_iface, > @@ -434,7 +432,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) > } > > if (list_entry_is_head(iface, &ses->iface_list, iface_head)) { > - rc = 1; > iface = NULL; > cifs_dbg(FYI, "unable to find a suitable iface\n"); > } > @@ -449,7 +446,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) > } > > spin_unlock(&ses->iface_lock); > - return 0; > + return; > } > > /* now drop the ref to the current iface */ > @@ -478,13 +475,13 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server) > chan_index = cifs_ses_get_chan_index(ses, server); > if (chan_index == CIFS_INVAL_CHAN_INDEX) { > spin_unlock(&ses->chan_lock); > - return 0; > + return; > } > > ses->chans[chan_index].iface = iface; > spin_unlock(&ses->chan_lock); > > - return rc; > + return; just remove this one? CJ > } > > /*