atacontrol WARNS6 cleanup
Chris Pressey
cpressey at catseye.mine.nu
Sat Jan 8 20:46:22 PST 2005
Committed (with some minor style(9)ifying,) thanks!
-Chris
On Sat, 08 Jan 2005 23:10:07 -0500
Larry Lansing <lansil at xxxxxxxxxxxxx> wrote:
> Index: Makefile
> ===================================================================
> RCS file: /home/dcvs/src/sbin/atacontrol/Makefile,v
> retrieving revision 1.2
> diff -u -r1.2 Makefile
> --- Makefile 17 Jun 2003 04:27:32 -0000 1.2
> +++ Makefile 10 Jan 2005 03:42:19 -0000
> @@ -2,7 +2,7 @@
> #$DragonFly: src/sbin/atacontrol/Makefile,v 1.2 2003/06/17 04:27:32 dillon Exp $
>
> PROG= atacontrol
> -WARNS= 0
> +WARNS= 6
> MAN= atacontrol.8
>
> .include <bsd.prog.mk>
> Index: atacontrol.c
> ===================================================================
> RCS file: /home/dcvs/src/sbin/atacontrol/atacontrol.c,v
> retrieving revision 1.3
> diff -u -r1.3 atacontrol.c
> --- atacontrol.c 28 Sep 2003 14:39:16 -0000 1.3
> +++ atacontrol.c 10 Jan 2005 03:42:27 -0000
> @@ -37,7 +37,16 @@
> #include <err.h>
> #include <sys/ata.h>
>
> -char *
> +static const char * mode2str(int mode);
> +static int str2mode(char *str);
> +static void usage(void);
> +static int version(int version);
> +static void param_print(struct ata_params *parm);
> +static void cap_print(struct ata_params *parm);
> +static int ata_cap_print(int fd, int channel, int device);
> +static int info_print(int fd, int channel, int prchan);
> +
> +const char *
> mode2str(int mode)
> {
> switch (mode) {
> @@ -88,14 +97,14 @@
> }
>
> int
> -version(int version)
> +version(int ver)
> {
> int bit;
>
> - if (version == 0xffff)
> + if (ver == 0xffff)
> return 0;
> for (bit = 15; bit >= 0; bit--)
> - if (version & (1<<bit))
> + if (ver & (1<<bit))
> return bit;
> return 0;
> }
>
More information about the Submit
mailing list