From: Leon Romanovsky <leon@kernel.org>
To: Gal Pressman <galpress@amazon.com>
Cc: Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@mellanox.com>,
kernel test robot <lkp@intel.com>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next 1/2] RDMA/uverbs: Remove redundant assignments
Date: Sun, 19 Jul 2020 16:27:33 +0300 [thread overview]
Message-ID: <20200719132733.GE127306@unreal> (raw)
In-Reply-To: <ea42d404-45eb-ec83-b42a-4a3acf659d26@amazon.com>
On Sun, Jul 19, 2020 at 04:21:04PM +0300, Gal Pressman wrote:
> On 19/07/2020 9:03, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > The kbuild reported the following warning, so clean whole uverbs_cmd.c file.
> >
> > drivers/infiniband/core/uverbs_cmd.c:1066:6: warning: Variable 'ret'
> > is reassigned a value before the old one has
> > been used. [redundantAssignment]
> > ret = uverbs_request(attrs, &cmd, sizeof(cmd));
> > ^
> > drivers/infiniband/core/uverbs_cmd.c:1064:0: note: Variable 'ret' is
> > reassigned a value before the old one has been
> > used.
> > int ret = -EINVAL;
> > ^
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > ---
> > drivers/infiniband/core/uverbs_cmd.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
> > index a66fc3e37a74..7d2b4258f573 100644
> > --- a/drivers/infiniband/core/uverbs_cmd.c
> > +++ b/drivers/infiniband/core/uverbs_cmd.c
> > @@ -558,9 +558,9 @@ static int ib_uverbs_open_xrcd(struct uverbs_attr_bundle *attrs)
> > struct ib_uverbs_open_xrcd cmd;
> > struct ib_uxrcd_object *obj;
> > struct ib_xrcd *xrcd = NULL;
> > - struct fd f = {NULL, 0};
> > + struct fd f = {};
> > struct inode *inode = NULL;
> > - int ret = 0;
> > + int ret;
> > int new_xrcd = 0;
> > struct ib_device *ib_dev;
>
> I don't mind removing the whitespace, but changing it for just some of the
> variables makes it harder to read the code IMO.
I wanted to remove for all variables in the same patch but was afraid to hear
opposition and waste my time on redoing it.
Once we decide that this should be done, we will change. It will take less than
ten seconds with clang-formatter.
Thanks
next prev parent reply other threads:[~2020-07-19 13:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-19 6:03 [PATCH rdma-next 0/2] Fix warnings reported by kbuild Leon Romanovsky
2020-07-19 6:03 ` [PATCH rdma-next 1/2] RDMA/uverbs: Remove redundant assignments Leon Romanovsky
2020-07-19 12:51 ` leon
2020-07-19 13:21 ` Gal Pressman
2020-07-19 13:27 ` Leon Romanovsky [this message]
2020-07-20 14:27 ` Jason Gunthorpe
2020-07-20 16:57 ` Leon Romanovsky
2020-07-19 6:03 ` [PATCH rdma-next 2/2] RDMA/uverbs: Silence shiftTooManyBitsSigned warning Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200719132733.GE127306@unreal \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=galpress@amazon.com \
--cc=jgg@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=lkp@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).