Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Sep 2004 19:37:05 +0200 (CEST)
From:      Dan Lukes <dan@obluda.cz>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/71672: [PATCH] cleanup of the usr.sbin/acpi code
Message-ID:  <200409121737.i8CHb5hR010925@kulesh.obluda.cz>
Resent-Message-ID: <200409121740.i8CHeSus009196@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         71672
>Category:       bin
>Synopsis:       [PATCH] cleanup of the usr.sbin/acpi 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:28 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD 5.3-BETA3 #8: Sun Sep 5 07:06:40 CEST 2004 i386
usr.sbin/acpi/acpidb/acpidb.c,v 1.1 2003/08/07 16:51:50 njl

>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/acpi/acpidb/acpidb.c:162: warning: unsigned int format, different type arg (arg 2)
usr.sbin/acpi/acpidb/acpidb.c:163: warning: unsigned int format, different type arg (arg 2)
usr.sbin/acpi/acpidb/acpidb.c:242: warning: unsigned int format, different type arg (arg 4)
usr.sbin/acpi/acpidb/acpidb.c:286: warning: unsigned int format, different type arg (arg 5)
usr.sbin/acpi/acpidb/acpidb.c:300: warning: unsigned int format, different type arg (arg 5)
usr.sbin/acpi/acpidb/acpidb.c:350: warning: unused variable `amlptr'
usr.sbin/acpi/acpidb/acpidb.c:354: warning: unused variable `tableptr'

>How-To-Repeat:
	N/A
>Fix:
*** usr.sbin/acpi/acpidb/acpidb.c.ORIG	Thu Aug  7 18:51:50 2003
--- usr.sbin/acpi/acpidb/acpidb.c	Sun Sep 12 18:43:38 2004
***************
*** 159,166 ****
  	if (msg != NULL) {
  		printf("%s", msg);
  	}
! 	printf("(default: 0x%x ", val);
! 	printf(" / %u) >>", val);
  	fflush(stdout);
  
  	bzero(buf, sizeof buf);
--- 159,166 ----
  	if (msg != NULL) {
  		printf("%s", msg);
  	}
! 	printf("(default: 0x%lx ", (unsigned long)val);
! 	printf(" / %lu) >>", (unsigned long)val);
  	fflush(stdout);
  
  	bzero(buf, sizeof buf);
***************
*** 238,245 ****
  	}
  	while (!TAILQ_EMPTY(&RegionContentList)) {
  		rc = TAILQ_FIRST(&RegionContentList);
! 		fprintf(fp, "%d	0x%x	0x%x\n",
! 		    rc->regtype, rc->addr, rc->value);
  		TAILQ_REMOVE(&RegionContentList, rc, links);
  		free(rc);
  	}
--- 238,245 ----
  	}
  	while (!TAILQ_EMPTY(&RegionContentList)) {
  		rc = TAILQ_FIRST(&RegionContentList);
! 		fprintf(fp, "%d	0x%lx	0x%x\n",
! 		    rc->regtype, (unsigned long)rc->addr, rc->value);
  		TAILQ_REMOVE(&RegionContentList, rc, links);
  		free(rc);
  	}
***************
*** 282,289 ****
  		}
  		*Value = value;
  		if (Prompt) {
! 			sprintf(msg, "[read (%s, %2d, 0x%x)]",
! 				space_names[SpaceID], BitWidth, Address);
  			*Value = aml_simulate_prompt(msg, value);
  			if (*Value != value) {
  				return(aml_vm_space_handler(SpaceID,
--- 282,289 ----
  		}
  		*Value = value;
  		if (Prompt) {
! 			sprintf(msg, "[read (%s, %2d, 0x%lx)]",
! 				space_names[SpaceID], BitWidth, (unsigned long)Address);
  			*Value = aml_simulate_prompt(msg, value);
  			if (*Value != value) {
  				return(aml_vm_space_handler(SpaceID,
***************
*** 296,303 ****
  	case ACPI_WRITE:
  		value = *Value;
  		if (Prompt) {
! 			sprintf(msg, "[write(%s, %2d, 0x%x)]",
! 				space_names[SpaceID], BitWidth, Address);
  			value = aml_simulate_prompt(msg, *Value);
  		}
  		*Value = value;
--- 296,303 ----
  	case ACPI_WRITE:
  		value = *Value;
  		if (Prompt) {
! 			sprintf(msg, "[write(%s, %2d, 0x%lx)]",
! 				space_names[SpaceID], BitWidth, (unsigned long)Address);
  			value = aml_simulate_prompt(msg, *Value);
  		}
  		*Value = value;
***************
*** 347,357 ****
  load_dsdt(const char *dsdtfile)
  {
  	char			filetmp[PATH_MAX];
! 	u_int8_t		*code, *amlptr;
  	struct stat		 sb;
  	int			 fd, fd2;
  	int			 error;
- 	ACPI_TABLE_HEADER	*tableptr;
  
  	fd = open(dsdtfile, O_RDONLY, 0);
  	if (fd == -1) {
--- 347,356 ----
  load_dsdt(const char *dsdtfile)
  {
  	char			filetmp[PATH_MAX];
! 	u_int8_t		*code;
  	struct stat		 sb;
  	int			 fd, fd2;
  	int			 error;
  
  	fd = open(dsdtfile, O_RDONLY, 0);
  	if (fd == -1) {
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200409121737.i8CHb5hR010925>