bin/71664: [PATCH] cleanup of the usr.sbin/fwcontrol code

Dan Lukes dan at obluda.cz
Sun Sep 12 10:40:26 PDT 2004


>Number:         71664
>Category:       bin
>Synopsis:       [PATCH] cleanup of the usr.sbin/fwcontrol code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 17:40:24 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD kulesh.obluda.cz 5.3-BETA3 FreeBSD 5.3-BETA3 #8: Sun Sep 5 07:06:40 CEST 2004 dan at kulesh.obluda.cz:/usr/obj/usr/src/sys/Dan i386
sys/dev/firewire/fwcrom.c,v 1.11 2004/05/22 16:14:17 dfr
usr.sbin/fwcontrol/fwdv.c,v 1.5 2003/04/17 03:38:03 simokawa

>Description:
	There are more than 5000 warnings issued during "make buildworld".
Some of them are false positives, but some of them are sign of true errors.

	Nobody is upset by warnings due it's amount, so some errors remain
uncorrected.

	I want to cleanup the code-base from warnings, so warnings will
become "attention mark" again.

usr.sbin/fwcontrol/fwcontrol.c:310: warning: unused variable `i'
usr.sbin/fwcontrol/fwcontrol.c:603: warning: unused variable `i'
usr.sbin/fwcontrol/../../sys/dev/firewire/fwcrom.c:297: warning: unused variable `st'
usr.sbin/fwcontrol/fwdv.c:254: warning: 'cycle_acc' might be used uninitialized in this function
usr.sbin/fwcontrol/fwdv.c:254: warning: 'cycle' might be used uninitialized in this function

>How-To-Repeat:
	N/A
>Fix:
*** usr.sbin/fwcontrol/../../sys/dev/firewire/fwcrom.c.ORIG	Fri May 28 19:21:18 2004
--- usr.sbin/fwcontrol/../../sys/dev/firewire/fwcrom.c	Sun Sep 12 13:58:33 2004
***************
*** 294,300 ****
  {
  	struct csrreg *reg;
  	struct csrdirectory *dir;
! 	char *desc, st;
  	uint16_t crc;
  
  	reg = crom_get(cc);
--- 294,300 ----
  {
  	struct csrreg *reg;
  	struct csrdirectory *dir;
! 	char *desc;
  	uint16_t crc;
  
  	reg = crom_get(cc);
*** usr.sbin/fwcontrol/fwdv.c.ORIG	Sun Apr 20 23:09:31 2003
--- usr.sbin/fwcontrol/fwdv.c	Sun Sep 12 13:57:26 2004
***************
*** 251,257 ****
  	struct dvdbc *dv;
  	struct fw_pkt *pkt;
  	int len, tlen, header, fd, frames, packets, vec, offset, nhdr, i;
! 	int system=-1, pad_acc, cycle_acc, cycle, f_cycle, f_frac; 
  	struct iovec wbuf[TNBUF*2 + NEMPTY];
  	char *pbuf;
  	u_int32_t iso_data, iso_empty, hdr[TNBUF + NEMPTY][3];
--- 251,258 ----
  	struct dvdbc *dv;
  	struct fw_pkt *pkt;
  	int len, tlen, header, fd, frames, packets, vec, offset, nhdr, i;
! 	int system=-1, pad_acc, f_cycle, f_frac; 
! 	int cycle_acc = cycle_acc, cycle=cycle; /* "init" to avoid "might be used uninitialized" warning */ 
  	struct iovec wbuf[TNBUF*2 + NEMPTY];
  	char *pbuf;
  	u_int32_t iso_data, iso_empty, hdr[TNBUF + NEMPTY][3];
*** usr.sbin/fwcontrol/fwcontrol.c.ORIG	Sun Sep 12 14:02:27 2004
--- usr.sbin/fwcontrol/fwcontrol.c	Sun Sep 12 14:03:13 2004
***************
*** 307,313 ****
  static void
  parse_bus_info_block(u_int32_t *p, int info_len)
  {
- 	int i;
  	char addr[EUI64_SIZ];
  	struct bus_info *bi;
  	struct eui64 eui;
--- 307,312 ----
***************
*** 600,606 ****
  {
  	u_int32_t crom_buf[1024/4];
  	char devbase[1024] = "/dev/fw0";
! 	int fd, i, tmp, ch, len=1024;
  
  	fd = -1;
  
--- 599,605 ----
  {
  	u_int32_t crom_buf[1024/4];
  	char devbase[1024] = "/dev/fw0";
! 	int fd, tmp, ch, len=1024;
  
  	fd = -1;
  
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list