Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp114964rdd; Mon, 8 Jan 2024 20:50:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEll8Qfb/Ywdn7v0s25XX0dC2snIE6q9Ae3mcL5uHuBRPyr1HPYZFehs5FQa9pDoYvFv/lb X-Received: by 2002:a05:6e02:1786:b0:35f:f59d:f334 with SMTP id y6-20020a056e02178600b0035ff59df334mr8784367ilu.35.1704775802327; Mon, 08 Jan 2024 20:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704775802; cv=none; d=google.com; s=arc-20160816; b=Wr/XVECaYfUej/3VdUmCzpCRQ23gB08CtgahvJsQdAc84t6qAfhQeGFBwCiX975iWV /VNJKAFF1aOOvgMjsCp2SFfCarWGUWFLJy8kDPIvUeQGXQH2N3mDzh4ddTzHEKC+PgEU 1XiRO8oinS3/kZaZpENg5w7wLaKFoTeUdzd+GRg96Kx+rnWwhmeMu3IlrLQhXH3RD0jg Bs93+aDi8Lz0i6NAuoCSwvsFC97q9QSQpvzxcDtstpwYhZ92N4fxsIGZ0IcETTWfQdZJ cMYuoaa1DuT2QGOVQs6BAWZShaM/h4D/4jOXkUXBtY1NW5qGcxW7m6dE34p/lW6pDiA6 y9zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=I63vcM6VvyO1LXNd6PYP30FAKknBe/hWRBhtNWHXuu0=; fh=JFDHx8fiWOP0qRVRlKtRftusler/6Apx+azxduXio04=; b=Kor37EhzcZt+ICA6O184S/AfkybADxaM0xozCfB1ul9GZrDVMAII73QDfzuuRB2m8/ jfwhcSwYq4DQiUiK1YfU4H5YKVya+tWnxjuF8qswDUTTwLXUoLVs2EkVsITYGURn8qEY jzvcK9BAhVk6DVZhGNRI3Gdf9dKbIvxF50ruGwD0d3Rv5YeJts72xvLvb/+dmqmhaHDS V07flb5RvC82EfP26HdHzSe+pcpSlCqt/llm6G/sfDA+lTRoF9rJxsajgYT4Px2nm6nv UGDIjVDWvynNQ/ykQRfeHYkFtQ7wHVVvPJAz23K6cdwzMSfk0tcEbmUdS4kQblEt5L9l LeKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=anM0WCK6; spf=pass (google.com: domain of linux-kernel+bounces-20381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20381-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t20-20020a656094000000b005c278210f82si860414pgu.544.2024.01.08.20.50.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 20:50:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=anM0WCK6; spf=pass (google.com: domain of linux-kernel+bounces-20381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20381-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D36E0286C69 for ; Tue, 9 Jan 2024 04:42:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 469D0185D; Tue, 9 Jan 2024 04:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="anM0WCK6" Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 D1D0C631; Tue, 9 Jan 2024 04:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2cd0f4797aaso26855241fa.0; Mon, 08 Jan 2024 20:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704775342; x=1705380142; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=I63vcM6VvyO1LXNd6PYP30FAKknBe/hWRBhtNWHXuu0=; b=anM0WCK6YJMw9YjX5ZeeA5i1d8aH+yxf+cTmX4kGuGPDFBnQGwubavXZac8Id+feU+ NFpfbvuHcgKueGUHlFKgj1AipXG0nUJSXXg/jwgaoz+7k7nnuVjMw0Ia8lHd8onUCRYF Y6+YyQDn21MLdPiV9Hw6zxREakp9c3t9T3fgyIMpKKqRwgLyrcxE4R7BOwozNZU3//kL B8lZak/qadzJETpFZB/HU7jQJwussDKB62USaKV6Jz84l+7xvUPvN9WPMxu0/yQa8N2n Wn+TxfDmj8E7LElp1f16r/k952dHMDl+vf/1dsKKagkSOgonimFt4LRYaYFGf+Qi4ZZo JzUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704775342; x=1705380142; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I63vcM6VvyO1LXNd6PYP30FAKknBe/hWRBhtNWHXuu0=; b=dls4HtXNPgIJpSsrpqBi9APlofwFIGuUeG6ZTDUDlPRHJ951cjfJPp7/Gy/o+1gHLz RAE80qA8YDpYRZl7Ocj9/hi4cCdwag4DZP3sXho6zPzDYfgrH5TlKUsvcXaamXA8VhEO 0clU1ESPCHiNxXdQRSA4ZlXdd7POeYZodtFKFj5jBt4bVFb5U4YcI3kc3G8n8uLh524A X94BAURxt99YHh/J19CeuPQzZdL0keRJmo85AK4gZYxW9Ofm4Y+bRXYx4nWZkedTr3k0 Ro9jv9zd+GvHH1UEIzl7ypfJtcMbPY5fyqoo+xTLSs8VVXjecCkX1b43U8aT3vYTGC+i zTXA== X-Gm-Message-State: AOJu0Yy1zBT1eiBimqtyh9vVOX/R3hpB1p8xIEhz4sdAmy5WDx5cucqs kBeRncQNGD8rlP5KoEfE/g9r/7aM+yvkuGvK9fk= X-Received: by 2002:a2e:b88c:0:b0:2cd:494b:b4b4 with SMTP id r12-20020a2eb88c000000b002cd494bb4b4mr1626422ljp.16.1704775341837; Mon, 08 Jan 2024 20:42:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Steve French Date: Mon, 8 Jan 2024 22:42:10 -0600 Message-ID: Subject: Re: [PATCH 2/3] cifs: make cifs_chan_update_iface() a void function To: Dan Carpenter Cc: Steve French , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable merged into cifs-2.6.git for-next On Mon, Jan 8, 2024 at 3:08=E2=80=AFAM Dan Carpenter wrote: > > 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 *ser= ver); > 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 *ser= ver) > { > 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 =3D NULL; > struct cifs_server_iface *last_iface =3D NULL; > struct sockaddr_storage ss; > - int rc =3D 0; > > spin_lock(&ses->chan_lock); > chan_index =3D cifs_ses_get_chan_index(ses, server); > if (chan_index =3D=3D CIFS_INVAL_CHAN_INDEX) { > spin_unlock(&ses->chan_lock); > - return 0; > + return; > } > > if (ses->chans[chan_index].iface) { > old_iface =3D 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 T= CP_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 =3D list_last_entry(&ses->iface_list, struct cifs_serv= er_iface, > @@ -434,7 +432,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct T= CP_Server_Info *server) > } > > if (list_entry_is_head(iface, &ses->iface_list, iface_head)) { > - rc =3D 1; > iface =3D NULL; > cifs_dbg(FYI, "unable to find a suitable iface\n"); > } > @@ -449,7 +446,7 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct T= CP_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 =3D cifs_ses_get_chan_index(ses, server); > if (chan_index =3D=3D CIFS_INVAL_CHAN_INDEX) { > spin_unlock(&ses->chan_lock); > - return 0; > + return; > } > > ses->chans[chan_index].iface =3D iface; > spin_unlock(&ses->chan_lock); > > - return rc; > + return; > } > > /* > -- > 2.42.0 > > --=20 Thanks, Steve