All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: ceph: fix ->monmap and err initialization
@ 2021-10-11  6:45 Jεan Sacren
  2021-10-11 11:31 ` Ilya Dryomov
  0 siblings, 1 reply; 2+ messages in thread
From: Jεan Sacren @ 2021-10-11  6:45 UTC (permalink / raw)
  To: Ilya Dryomov; +Cc: jlayton, davem, kuba, ceph-devel, netdev

From: Jean Sacren <sakiwit@gmail.com>

Call to build_initial_monmap() is one stone two birds.  Explicitly it
initializes err variable. Implicitly it initializes ->monmap via call to
kzalloc().  We should only declare err and ->monmap is taken care of by
ceph_monc_init() prototype.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
 net/ceph/mon_client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
index 013cbdb6cfe2..6a6898ee4049 100644
--- a/net/ceph/mon_client.c
+++ b/net/ceph/mon_client.c
@@ -1153,12 +1153,11 @@ static int build_initial_monmap(struct ceph_mon_client *monc)
 
 int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl)
 {
-	int err = 0;
+	int err;
 
 	dout("init\n");
 	memset(monc, 0, sizeof(*monc));
 	monc->client = cl;
-	monc->monmap = NULL;
 	mutex_init(&monc->mutex);
 
 	err = build_initial_monmap(monc);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: ceph: fix ->monmap and err initialization
  2021-10-11  6:45 [PATCH net-next] net: ceph: fix ->monmap and err initialization Jεan Sacren
@ 2021-10-11 11:31 ` Ilya Dryomov
  0 siblings, 0 replies; 2+ messages in thread
From: Ilya Dryomov @ 2021-10-11 11:31 UTC (permalink / raw)
  To: Jεan Sacren
  Cc: Jeff Layton, David S. Miller, Jakub Kicinski, Ceph Development, netdev

On Mon, Oct 11, 2021 at 8:45 AM Jεan Sacren <sakiwit@gmail.com> wrote:
>
> From: Jean Sacren <sakiwit@gmail.com>
>
> Call to build_initial_monmap() is one stone two birds.  Explicitly it
> initializes err variable. Implicitly it initializes ->monmap via call to
> kzalloc().  We should only declare err and ->monmap is taken care of by
> ceph_monc_init() prototype.
>
> Signed-off-by: Jean Sacren <sakiwit@gmail.com>
> ---
>  net/ceph/mon_client.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
> index 013cbdb6cfe2..6a6898ee4049 100644
> --- a/net/ceph/mon_client.c
> +++ b/net/ceph/mon_client.c
> @@ -1153,12 +1153,11 @@ static int build_initial_monmap(struct ceph_mon_client *monc)
>
>  int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl)
>  {
> -       int err = 0;
> +       int err;
>
>         dout("init\n");
>         memset(monc, 0, sizeof(*monc));
>         monc->client = cl;
> -       monc->monmap = NULL;
>         mutex_init(&monc->mutex);
>
>         err = build_initial_monmap(monc);

Applied.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-11 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  6:45 [PATCH net-next] net: ceph: fix ->monmap and err initialization Jεan Sacren
2021-10-11 11:31 ` Ilya Dryomov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.