[ibsim patch 19/23] sim_cmd.c: Delete unused value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Issue was detected by Coverity.

Error: CLANG_WARNING: [#def3]
ibsim-0.7/ibsim/sim_cmd.c:540:3: warning: Value stored to 'n' is never read
//                n += sprintf(comment+n, "\t# err_attr %d", port->errattr);
//                ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ibsim-0.7/ibsim/sim_cmd.c:540:3: note: Value stored to 'n' is never read
//                n += sprintf(comment+n, "\t# err_attr %d", port->errattr);
//                ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//  538|   		n += sprintf(comment, "\t# err_rate %d", port->errrate);
//  539|   	if (port->errattr)
//  540|-> 		n += sprintf(comment+n, "\t# err_attr %d", port->errattr);
//  541|   }
//  542|

Signed-off-by: Honggang Li <honli@xxxxxxxxxx>
---
 ibsim/sim_cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c
index 0a94c68bdf21..325292103caa 100644
--- a/ibsim/sim_cmd.c
+++ b/ibsim/sim_cmd.c
@@ -537,7 +537,7 @@ static void dump_comment(Port * port, char *comment)
 	if (port->errrate)
 		n += sprintf(comment, "\t# err_rate %d", port->errrate);
 	if (port->errattr)
-		n += sprintf(comment+n, "\t# err_attr %d", port->errattr);
+		sprintf(comment+n, "\t# err_attr %d", port->errattr);
 }
 
 static void dump_port(FILE * f, Port * port, int type)
-- 
2.15.0-rc1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux