All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH v2] phy: tegra: Remove self cast in tegra_xusb_port_find_lane
Date: Sun, 1 Apr 2018 04:04:10 -0700	[thread overview]
Message-ID: <20180401110410.GA3405@flashbox> (raw)

Clang warns about casting variables to themselves because it is rarely
necessary. Removing the cast should not change anything regarding the
code and silences the warning.

../drivers/phy/tegra/xusb.c:421:11: warning: explicitly assigning value
of variable of type 'const struct tegra_xusb_lane_map *' to itself
[-Wself-assign]
        for (map = map; map->type; map++) {
             ~~~ ^ ~~~

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
I am not entirely sure if this is the correct solution, especially since
I don't have the hardware and I am not too familiar with this code. If
there is a better solution, please let me know.

Changes from v1 -> v2: Fix spelling error in commit title

 drivers/phy/tegra/xusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index 63e916d4d069..11aa5902a9ac 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -418,7 +418,7 @@ tegra_xusb_port_find_lane(struct tegra_xusb_port *port,
 {
 	struct tegra_xusb_lane *lane, *match = ERR_PTR(-ENODEV);
 
-	for (map = map; map->type; map++) {
+	for (; map->type; map++) {
 		if (port->index != map->port)
 			continue;
 
-- 
2.16.3

             reply	other threads:[~2018-04-01 11:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-01 11:04 Nathan Chancellor [this message]
2018-04-03 10:49 ` [PATCH v2] phy: tegra: Remove self cast in tegra_xusb_port_find_lane Thierry Reding
2018-04-03 12:39   ` Nathan Chancellor

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=20180401110410.GA3405@flashbox \
    --to=natechancellor@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.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 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.