Skip to content

Commit

Permalink
ansi
Browse files Browse the repository at this point in the history
  • Loading branch information
deraadt committed Jul 3, 2002
1 parent 3cea562 commit bc52e26
Show file tree
Hide file tree
Showing 33 changed files with 381 additions and 799 deletions.
91 changes: 24 additions & 67 deletions sbin/atactl/atactl.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: atactl.c,v 1.17 2002/06/15 10:59:06 gluk Exp $ */
/* $OpenBSD: atactl.c,v 1.18 2002/07/03 22:32:32 deraadt Exp $ */
/* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */

/*-
Expand Down Expand Up @@ -314,9 +314,7 @@ struct valinfo ibm_attr_names[] = {
(b4 << 24 | b3 << 16 | b2 << 8 | b1)

int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
struct command *cmdp;
char dvname_store[MAXPATHLEN];
Expand Down Expand Up @@ -368,7 +366,7 @@ main(argc, argv)
}

void
usage()
usage(void)
{

fprintf(stderr, "usage: %s device command [arg [...]]\n",
Expand All @@ -380,8 +378,7 @@ usage()
* Wrapper that calls ATAIOCCOMMAND and checks for errors
*/
void
ata_command(req)
struct atareq *req;
ata_command(struct atareq *req)
{
int error;

Expand Down Expand Up @@ -419,10 +416,7 @@ ata_command(req)
* Print out strings associated with particular bitmasks
*/
void
print_bitinfo(f, bits, binfo)
const char *f;
u_int bits;
struct bitinfo *binfo;
print_bitinfo(const char *f, u_int bits, struct bitinfo *binfo)
{

for (; binfo->bitmask != NULL; binfo++)
Expand All @@ -436,9 +430,7 @@ print_bitinfo(f, bits, binfo)
* if no value found -1 is returned.
*/
int
strtoval(str, vinfo)
const char *str;
struct valinfo *vinfo;
strtoval(const char *str, struct valinfo *vinfo)
{
for (; vinfo->string != NULL; vinfo++)
if (strcmp(str, vinfo->string) == 0)
Expand All @@ -452,9 +444,7 @@ strtoval(str, vinfo)
* if no string found NULL is returned.
*/
const char *
valtostr(val, vinfo)
int val;
struct valinfo *vinfo;
valtostr(int val, struct valinfo *vinfo)
{
for (; vinfo->string != NULL; vinfo++)
if (val == vinfo->value)
Expand All @@ -466,9 +456,7 @@ valtostr(val, vinfo)
* DEVICE COMMANDS
*/
void
device_dump(argc, argv)
int argc;
char *argv[];
device_dump(int argc, char *argv[])
{
unsigned char buf[131072];
int error;
Expand All @@ -491,9 +479,7 @@ device_dump(argc, argv)
* Display the identity of the device
*/
void
device_identify(argc, argv)
int argc;
char *argv[];
device_identify(int argc, char *argv[])
{
struct ataparams *inqbuf;
struct atareq req;
Expand Down Expand Up @@ -608,9 +594,7 @@ device_identify(argc, argv)
* issue the IDLE IMMEDIATE command to the drive
*/
void
device_idle(argc, argv)
int argc;
char *argv[];
device_idle(int argc, char *argv[])
{
struct atareq req;

Expand Down Expand Up @@ -640,9 +624,7 @@ device_idle(argc, argv)
* SMART ENABLE OPERATIONS command
*/
void
device_smart_enable(argc, argv)
int argc;
char *argv[];
device_smart_enable(int argc, char *argv[])
{
struct atareq req;

Expand All @@ -668,9 +650,7 @@ device_smart_enable(argc, argv)
* SMART DISABLE OPERATIONS command
*/
void
device_smart_disable(argc, argv)
int argc;
char *argv[];
device_smart_disable(int argc, char *argv[])
{
struct atareq req;

Expand All @@ -696,9 +676,7 @@ device_smart_disable(argc, argv)
* SMART STATUS command
*/
void
device_smart_status(argc, argv)
int argc;
char *argv[];
device_smart_status(int argc, char *argv[])
{
struct atareq req;

Expand Down Expand Up @@ -734,9 +712,7 @@ device_smart_status(argc, argv)
* SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE command
*/
void
device_smart_autosave(argc, argv)
int argc;
char *argv[];
device_smart_autosave(int argc, char *argv[])
{
struct atareq req;
int val;
Expand Down Expand Up @@ -767,9 +743,7 @@ device_smart_autosave(argc, argv)
* SMART EXECUTE OFF-LINE IMMEDIATE command
*/
void
device_smart_offline(argc, argv)
int argc;
char *argv[];
device_smart_offline(int argc, char *argv[])
{
struct atareq req;
int val;
Expand Down Expand Up @@ -800,9 +774,7 @@ device_smart_offline(argc, argv)
* SMART READ DATA command
*/
void
device_smart_read(argc, argv)
int argc;
char *argv[];
device_smart_read(int argc, char *argv[])
{
struct atareq req;
struct smart_read data;
Expand Down Expand Up @@ -862,9 +834,7 @@ device_smart_read(argc, argv)
* SMART READ LOG command
*/
void
device_smart_readlog(argc, argv)
int argc;
char *argv[];
device_smart_readlog(int argc, char *argv[])
{
struct atareq req;
int val;
Expand Down Expand Up @@ -1042,8 +1012,7 @@ device_smart_readlog(argc, argv)
data->cmd[4].reg)

void
smart_print_errdata(data)
struct smart_log_errdata *data;
smart_print_errdata(struct smart_log_errdata *data)
{
printf(" error register: 0x%x\n", data->err.reg_err);
printf(" sector count register: 0x%x\n", data->err.reg_seccnt);
Expand Down Expand Up @@ -1096,9 +1065,7 @@ smart_cksum(data, len)
* Read device attributes
*/
void
device_attr(argc, argv)
int argc;
char *argv[];
device_attr(int argc, char *argv[])
{
struct atareq req;
struct smart_read attr_val;
Expand Down Expand Up @@ -1173,9 +1140,7 @@ device_attr(argc, argv)
* Set the automatic acoustic management on the disk.
*/
void
device_acoustic(argc, argv)
int argc;
char *argv[];
device_acoustic(int argc, char *argv[])
{
unsigned long acoustic;
struct atareq req;
Expand Down Expand Up @@ -1222,9 +1187,7 @@ device_acoustic(argc, argv)
* to keep a uniform interface to the user.
*/
void
device_apm(argc, argv)
int argc;
char *argv[];
device_apm(int argc, char *argv[])
{
unsigned long power;
struct atareq req;
Expand Down Expand Up @@ -1271,9 +1234,7 @@ device_apm(argc, argv)
* Management) on the disk.
*/
void
device_feature(argc, argv)
int argc;
char *argv[];
device_feature(int argc, char *argv[])
{
struct atareq req;

Expand Down Expand Up @@ -1322,9 +1283,7 @@ device_feature(argc, argv)
* standby mode, depending on how we were invoked.
*/
void
device_setidle(argc, argv)
int argc;
char *argv[];
device_setidle(int argc, char *argv[])
{
unsigned long idle;
struct atareq req;
Expand Down Expand Up @@ -1380,9 +1339,7 @@ device_setidle(argc, argv)
* Query the device for the current power mode
*/
void
device_checkpower(argc, argv)
int argc;
char *argv[];
device_checkpower(int argc, char *argv[])
{
struct atareq req;

Expand Down
17 changes: 5 additions & 12 deletions sbin/badsect/badsect.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: badsect.c,v 1.8 2002/06/09 08:13:05 todd Exp $ */
/* $OpenBSD: badsect.c,v 1.9 2002/07/03 22:32:32 deraadt Exp $ */
/* $NetBSD: badsect.c,v 1.10 1995/03/18 14:54:28 cgd Exp $ */

/*
Expand Down Expand Up @@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)badsect.c 8.1 (Berkeley) 6/5/93";
#else
static char rcsid[] = "$OpenBSD: badsect.c,v 1.8 2002/06/09 08:13:05 todd Exp $";
static char rcsid[] = "$OpenBSD: badsect.c,v 1.9 2002/07/03 22:32:32 deraadt Exp $";
#endif
#endif /* not lint */

Expand Down Expand Up @@ -93,9 +93,7 @@ void rdfs(daddr_t, int, char *);
int chkuse(daddr_t, int);

int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
daddr_t number;
struct stat stbuf, devstat;
Expand Down Expand Up @@ -166,9 +164,7 @@ main(argc, argv)
}

int
chkuse(blkno, cnt)
daddr_t blkno;
int cnt;
chkuse(daddr_t blkno, int cnt)
{
int cg;
daddr_t fsbn, bn;
Expand Down Expand Up @@ -209,10 +205,7 @@ chkuse(blkno, cnt)
* read a block from the file system
*/
void
rdfs(bno, size, bf)
daddr_t bno;
int size;
char *bf;
rdfs(daddr_t bno, int size, char *bf)
{
int n;

Expand Down
Loading

0 comments on commit bc52e26

Please sign in to comment.