From 1c85ed9abde9dcd3100a360c31acb4be21ba2e9c Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 25 Jul 1995 22:18:56 +0000 Subject: [PATCH] Change memcmp() to bcmp(). memcmp() isn't declared or implemented for the kernel, but gcc provides an inline version of it if the kernel is compiled with -O. --- sys/dev/ed/if_ed.c | 10 +++++----- sys/i386/isa/if_ed.c | 10 +++++----- sys/i386/isa/if_ze.c | 10 +++++----- sys/i386/isa/if_zp.c | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 100d8f737582..af61f38495e5 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -13,7 +13,7 @@ * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, * and a variety of similar clones. * - * $Id: if_ed.c,v 1.72 1995/05/14 11:01:20 davidg Exp $ + * $Id: if_ed.c,v 1.73 1995/05/30 08:01:58 rgrimes Exp $ */ #include "ed.h" @@ -1074,12 +1074,12 @@ ed_probe_Novell(isa_dev) /* Search for the start of RAM. */ for (x = 1; x < 256; x++) { ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { + if (bcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { for (i = 0; i < ED_PAGE_SIZE; i++) pbuf[i] = 255 - x; ed_pio_writemem(sc, pbuf, x * 256, ED_PAGE_SIZE); ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) { + if (bcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) { mstart = x * ED_PAGE_SIZE; msize = ED_PAGE_SIZE; break; @@ -1094,12 +1094,12 @@ ed_probe_Novell(isa_dev) /* Search for the start of RAM. */ for (x = (mstart / ED_PAGE_SIZE) + 1; x < 256; x++) { ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { + if (bcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { for (i = 0; i < ED_PAGE_SIZE; i++) pbuf[i] = 255 - x; ed_pio_writemem(sc, pbuf, x * 256, ED_PAGE_SIZE); ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) + if (bcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) msize += ED_PAGE_SIZE; else { break; diff --git a/sys/i386/isa/if_ed.c b/sys/i386/isa/if_ed.c index 100d8f737582..af61f38495e5 100644 --- a/sys/i386/isa/if_ed.c +++ b/sys/i386/isa/if_ed.c @@ -13,7 +13,7 @@ * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, * and a variety of similar clones. * - * $Id: if_ed.c,v 1.72 1995/05/14 11:01:20 davidg Exp $ + * $Id: if_ed.c,v 1.73 1995/05/30 08:01:58 rgrimes Exp $ */ #include "ed.h" @@ -1074,12 +1074,12 @@ ed_probe_Novell(isa_dev) /* Search for the start of RAM. */ for (x = 1; x < 256; x++) { ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { + if (bcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { for (i = 0; i < ED_PAGE_SIZE; i++) pbuf[i] = 255 - x; ed_pio_writemem(sc, pbuf, x * 256, ED_PAGE_SIZE); ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) { + if (bcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) { mstart = x * ED_PAGE_SIZE; msize = ED_PAGE_SIZE; break; @@ -1094,12 +1094,12 @@ ed_probe_Novell(isa_dev) /* Search for the start of RAM. */ for (x = (mstart / ED_PAGE_SIZE) + 1; x < 256; x++) { ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { + if (bcmp(pbuf0, tbuf, ED_PAGE_SIZE) == 0) { for (i = 0; i < ED_PAGE_SIZE; i++) pbuf[i] = 255 - x; ed_pio_writemem(sc, pbuf, x * 256, ED_PAGE_SIZE); ed_pio_readmem(sc, x * 256, tbuf, ED_PAGE_SIZE); - if (memcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) + if (bcmp(pbuf, tbuf, ED_PAGE_SIZE) == 0) msize += ED_PAGE_SIZE; else { break; diff --git a/sys/i386/isa/if_ze.c b/sys/i386/isa/if_ze.c index b1de9e69f5b3..3fede8549523 100644 --- a/sys/i386/isa/if_ze.c +++ b/sys/i386/isa/if_ze.c @@ -47,7 +47,7 @@ */ /* - * $Id: if_ze.c,v 1.16 1995/05/24 20:33:42 davidg Exp $ + * $Id: if_ze.c,v 1.17 1995/05/30 08:02:27 rgrimes Exp $ */ #include "ze.h" @@ -209,11 +209,11 @@ ze_check_cis (unsigned char *scratch) card_info[k++] = scratch[j] == '\0' ? '~' : scratch[j]; card_info[k++] = '\0'; #if 0 - return (memcmp (card_info, CARD_INFO, sizeof(CARD_INFO)-1) == 0); + return (bcmp (card_info, CARD_INFO, sizeof(CARD_INFO)-1) == 0); #else - if ((memcmp (card_info, CARD_INFO, sizeof(CARD_INFO)-1) == 0) || - (memcmp (card_info, CARD2_INFO, sizeof(CARD2_INFO)-1) == 0) || - (memcmp (card_info, CARD3_INFO, sizeof(CARD3_INFO)-1) == 0)) { + if ((bcmp (card_info, CARD_INFO, sizeof(CARD_INFO)-1) == 0) || + (bcmp (card_info, CARD2_INFO, sizeof(CARD2_INFO)-1) == 0) || + (bcmp (card_info, CARD3_INFO, sizeof(CARD3_INFO)-1) == 0)) { return 1; } return 0; diff --git a/sys/i386/isa/if_zp.c b/sys/i386/isa/if_zp.c index 5ac6b08a2e54..e63024a5d37a 100644 --- a/sys/i386/isa/if_zp.c +++ b/sys/i386/isa/if_zp.c @@ -34,7 +34,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * From: if_ep.c,v 1.9 1994/01/25 10:46:29 deraadt Exp $ - * $Id: if_zp.c,v 1.5 1995/04/20 07:22:04 phk Exp $ + * $Id: if_zp.c,v 1.6 1995/05/30 08:02:31 rgrimes Exp $ */ /*- * TODO: @@ -330,9 +330,9 @@ zp_check_cis(unsigned char *scratch) card_info[k++] = '\0'; #ifdef ZP_DEBUG printf("card info = %s\n", card_info); - printf("result = %d\n", memcmp(card_info, CARD_INFO, sizeof(CARD_INFO) - 1) == 0); + printf("result = %d\n", bcmp(card_info, CARD_INFO, sizeof(CARD_INFO) - 1) == 0); #endif - return (memcmp(card_info, CARD_INFO, sizeof(CARD_INFO) - 1) == 0); + return (bcmp(card_info, CARD_INFO, sizeof(CARD_INFO) - 1) == 0); } i += 4 + 2 * link; }