public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com,
	 maennich@google.com
Subject: [PATCH 2/3] Fix readability-redundant-smartptr-get warnings
Date: Thu,  3 Sep 2020 14:22:04 +0100	[thread overview]
Message-ID: <20200903132205.589136-3-gprocida@google.com> (raw)
In-Reply-To: <20200903132205.589136-1-gprocida@google.com>

clang-tidy's readability-redundant-smartptr-get warning is triggered
when it detects a redundant "get" of various smart pointer types in
boolean context. This commit fixes these warnings.

	* tools/kmidiff.cc (main): Remove redundant .get() when
	testing smart pointers.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 tools/kmidiff.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc
index 2840eb086..41584d3ae 100644
--- a/tools/kmidiff.cc
+++ b/tools/kmidiff.cc
@@ -416,7 +416,7 @@ main(int argc, char* argv[])
       file_type ftype = guess_file_type(opts.kernel_dist_root1);
       if (ftype == FILE_TYPE_DIR)
 	{
-	  debug_info_root_dir = opts.di_root_path1.get()
+	  debug_info_root_dir = opts.di_root_path1
 	    ? opts.di_root_path1.get()
 	    : "";
 
@@ -443,7 +443,7 @@ main(int argc, char* argv[])
       file_type ftype = guess_file_type(opts.kernel_dist_root2);
       if (ftype == FILE_TYPE_DIR)
 	{
-	  debug_info_root_dir = opts.di_root_path2.get()
+	  debug_info_root_dir = opts.di_root_path2
 	    ? opts.di_root_path2.get()
 	    : "";
 	  group2 =
-- 
2.28.0.402.g5ffc5be6b7-goog


  parent reply	other threads:[~2020-09-03 13:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03 13:22 [PATCH 0/3] clang-tidy error and warning fixes Giuliano Procida
2020-09-03 13:22 ` [PATCH 1/3] abg-corpus-priv.h: include abg-corpus.h Giuliano Procida
2020-09-03 13:22 ` Giuliano Procida [this message]
2020-09-03 13:22 ` [PATCH 3/3] Fix performance-unnecessary-copy-initialization warnings Giuliano Procida

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=20200903132205.589136-3-gprocida@google.com \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    --cc=maennich@google.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 read-only IMAP folder(s) and NNTP newsgroup(s).