mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] FMC: remove duplicated fru_strlen and unused variable len
@ 2016-06-06 13:30 Colin King
  0 siblings, 0 replies; only message in thread
From: Colin King @ 2016-06-06 13:30 UTC (permalink / raw)
  To: Alessandro Rubini; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The call to fru_strlen on tl is performed twice; remove the duplicate
and the unsed variable len. This fixes the clang warning:

drivers/fmc/fru-parse.c:39:2: warning: Value stored to 'len' is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/fmc/fru-parse.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/fmc/fru-parse.c b/drivers/fmc/fru-parse.c
index cb46263..4094146 100644
--- a/drivers/fmc/fru-parse.c
+++ b/drivers/fmc/fru-parse.c
@@ -31,12 +31,10 @@ static char *__fru_alloc_get_tl(struct fru_common_header *header, int nr)
 {
 	struct fru_type_length *tl;
 	char *res;
-	int len;
 
 	tl = __fru_get_board_tl(header, nr);
 	if (!tl)
 		return NULL;
-	len = fru_strlen(tl);
 	res = fru_alloc(fru_strlen(tl) + 1);
 	if (!res)
 		return NULL;
-- 
2.8.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-06 13:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-06 13:30 [PATCH] FMC: remove duplicated fru_strlen and unused variable len Colin King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®