reg = (struct csrreg *)(void *)&i;
reg->key = key;
reg->val = val;
- return(crom_add_quad(chunk, (u_int32_t) i));
+ return(crom_add_quad(chunk, i));
}
int
if ((addr & 1) == 0) {
/* is device writable? */
- if (!iicbus_start(dev, (u_char)addr, 0)) {
+ if (!iicbus_start(dev, addr, 0)) {
iicbus_stop(dev);
return (1);
}
} else {
/* is device readable? */
- if (!iicbus_block_read(dev, (u_char)addr, &byte, 1, &count))
+ if (!iicbus_block_read(dev, addr, &byte, 1, &count))
return (1);
}
/* $NetBSD: ehci.c,v 1.91 2005/02/27 00:27:51 perry Exp $ */
/* $FreeBSD: src/sys/dev/usb/ehci.c,v 1.36.2.3 2006/09/24 13:39:04 iedowse Exp $ */
-/* $DragonFly: src/sys/bus/usb/ehci.c,v 1.36 2008/08/14 20:55:53 hasso Exp $ */
/*
* Copyright (c) 2004 The NetBSD Foundation, Inc.
#ifdef EHCI_DEBUG
char sbuf[128];
- bitmask_snprintf((u_int32_t)status,
+ bitmask_snprintf(status,
"\20\7HALTED\6BUFERR\5BABBLE\4XACTERR"
"\3MISSED\2SPLIT\1PING", sbuf, sizeof(sbuf));
#ifdef USB_DEBUG
char sbuf[128];
- bitmask_snprintf((u_int32_t)status,
+ bitmask_snprintf(status,
"\20\22BITSTUFF\23CRCTO\24NAK\25"
"BABBLE\26DBUFFER\27STALLED\30ACTIVE",
sbuf, sizeof(sbuf));
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/acpica/Osd/OsdHardware.c,v 1.13 2004/04/14 03:39:08 njl Exp $
- * $DragonFly: src/sys/dev/acpica5/Osd/OsdHardware.c,v 1.5 2008/08/02 01:14:42 dillon Exp $
*/
/*
if (!pci_cfgregopen())
return (AE_NOT_EXIST);
- *(UINT64 *)Value = pci_cfgregread(PciId->Bus, PciId->Device,
+ *Value = pci_cfgregread(PciId->Bus, PciId->Device,
PciId->Function, Register, bytes);
*Value &= (1 << (bytes * 8)) - 1;
get_mplock();
for (;;) {
at = (void *)lwkt_waitport(&curthread->td_msgport, 0);
- func = (ACPI_OSD_EXEC_CALLBACK)at->at_function;
- func((void *)at->at_context);
+ func = at->at_function;
+ func(at->at_context);
lwkt_replymsg(&at->at_msg, 0);
}
rel_mplock();
*
* Name: acfreebsd.h - OS specific defines, etc.
* $Revision: 11 $
- * $DragonFly: src/sys/dev/acpica5/acdragonfly.h,v 1.3 2007/01/17 17:31:19 y0netan1 Exp $
*
*****************************************************************************/
} while (strncmp(s, find, len) != 0);
s--;
}
- return ((char *)s);
+ return (s);
}
#endif /* _KERNEL */
*(ACPI_HANDLE *)result = ad->ad_handle;
break;
case ACPI_IVAR_MAGIC:
- *(uintptr_t *)result = ad->ad_magic;
+ *result = ad->ad_magic;
break;
case ACPI_IVAR_PRIVATE:
*(void **)result = ad->ad_private;
ad->ad_handle = (ACPI_HANDLE)value;
break;
case ACPI_IVAR_MAGIC:
- ad->ad_magic = (uintptr_t)value;
+ ad->ad_magic = value;
break;
case ACPI_IVAR_PRIVATE:
ad->ad_private = (void *)value;
/* Currently, ID and minimum clock tick info is unused. */
- status = AcpiGetTable(ACPI_SIG_HPET, 1, (ACPI_TABLE_HEADER **)&hdr);
+ status = AcpiGetTable(ACPI_SIG_HPET, 1, &hdr);
if (ACPI_FAILURE(status))
return ENXIO;
case ACPI_READ:
status = ACPI_EC_READ(sc->ec_dev, ec_addr, &ec_data, 1);
if (ACPI_SUCCESS(status))
- *value |= ((UINT64)ec_data) << i;
+ *value |= ec_data << i;
break;
case ACPI_WRITE:
ec_data = (UINT8)((*value) >> i);
for (info = RB_MIN(drawable_tree, &dev->drw_head);
info != NULL ; info = next) {
next = RB_NEXT(drawable_tree, &dev->drw_head, info);
- RB_REMOVE(drawable_tree, &dev->drw_head,
- (struct bsd_drm_drawable_info *)info);
+ RB_REMOVE(drawable_tree, &dev->drw_head, info);
DRM_SPINUNLOCK(&dev->drw_lock);
free(info->info.rects, DRM_MEM_DRAWABLE);
free(info, DRM_MEM_DRAWABLE);
length = sndbuf_getready(ch->buffer) / 2;
dmabuf = ch->parent->pbuf;
- data = (u_int8_t *)ch->data;
+ data = ch->data;
src = sndbuf_getreadyptr(ch->buffer);
dst = src / 2 + ch->offset;
ssize = ch->size;
length = sndbuf_getready(ch->buffer) / 2;
dmabuf = ch->parent->pbuf;
- data = (u_int8_t *)ch->data;
+ data = ch->data;
src = sndbuf_getreadyptr(ch->buffer);
dst = src / 2 + ch->offset;
ssize = ch->size;
} while (strncmp(s, find, len) != 0);
s--;
}
- return ((char *)s);
+ return (s);
}
/* Taken from libc */
}
windrv_wrap((funcptr)usbd_ioinvalid,
- (funcptr *)&usbd_ioinvalid_wrap, 2, WINDRV_WRAP_STDCALL);
+ &usbd_ioinvalid_wrap, 2, WINDRV_WRAP_STDCALL);
windrv_wrap((funcptr)usbd_iodispatch,
- (funcptr *)&usbd_iodispatch_wrap, 2, WINDRV_WRAP_STDCALL);
+ &usbd_iodispatch_wrap, 2, WINDRV_WRAP_STDCALL);
windrv_wrap((funcptr)usbd_pnp,
- (funcptr *)&usbd_pnp_wrap, 2, WINDRV_WRAP_STDCALL);
+ &usbd_pnp_wrap, 2, WINDRV_WRAP_STDCALL);
windrv_wrap((funcptr)usbd_power,
- (funcptr *)&usbd_power_wrap, 2, WINDRV_WRAP_STDCALL);
+ &usbd_power_wrap, 2, WINDRV_WRAP_STDCALL);
windrv_wrap((funcptr)usbd_irpcancel,
- (funcptr *)&usbd_irpcancel_wrap, 2, WINDRV_WRAP_STDCALL);
+ &usbd_irpcancel_wrap, 2, WINDRV_WRAP_STDCALL);
windrv_wrap((funcptr)usbd_xfertask,
- (funcptr *)&usbd_xfertask_wrap, 2, WINDRV_WRAP_STDCALL);
+ &usbd_xfertask_wrap, 2, WINDRV_WRAP_STDCALL);
/* Create a fake USB driver instance. */
} else {
/* Godmar thinks: this shouldn't happen w/o fragments */
kprintf("nsize %d(%d) > osize %d(%d) nb %d\n",
- (int)nsize, (int)size, (int)osize,
+ nsize, size, osize,
(int)ip->i_size, (int)nb);
panic(
"ext2_balloc: Something is terribly wrong");
if (size < xfersize)
xfersize = size;
- error = uiomove((char *)bp->b_data + blkoffset,
- (int)xfersize, uio);
+ error = uiomove((char *)bp->b_data + blkoffset, xfersize, uio);
if ((ioflag & IO_VMIO) &&
LIST_FIRST(&bp->b_dep) == NULL) /* in ext2fs? */
bp->b_flags |= B_RELBUF;
*/
if ((cred->cr_uid != ip->i_uid || uid != ip->i_uid ||
(gid != ip->i_gid && !(cred->cr_gid == gid ||
- groupmember((gid_t)gid, cred)))) &&
+ groupmember(gid, cred)))) &&
(error = priv_check_cred(cred, PRIV_VFS_CHOWN, 0)))
return (error);
ogid = ip->i_gid;
SPP_FMT "cisco input: %d bytes "
"<0x%lx 0x%lx 0x%lx 0x%x 0x%x-0x%x>\n",
SPP_ARGS(ifp), m->m_pkthdr.len,
- (u_long)ntohl (h->type), (u_long)h->par1, (u_long)h->par2, (u_int)h->rel,
+ (u_long)ntohl (h->type), h->par1, h->par2, (u_int)h->rel,
(u_int)h->time0, (u_int)h->time1);
switch (ntohl (h->type)) {
default:
if (debug)
log(LOG_DEBUG,
SPP_FMT "cisco output: <0x%lx 0x%lx 0x%lx 0x%x 0x%x-0x%x>\n",
- SPP_ARGS(ifp), (u_long)ntohl (ch->type), (u_long)ch->par1,
- (u_long)ch->par2, (u_int)ch->rel, (u_int)ch->time0, (u_int)ch->time1);
+ SPP_ARGS(ifp), (u_long)ntohl (ch->type), ch->par1,
+ ch->par2, (u_int)ch->rel, (u_int)ch->time0, (u_int)ch->time1);
if (IF_QFULL (&sp->pp_cpq)) {
IF_DROP (&sp->pp_fastq);
sp->neg->numtags = count;
break; /* XXX chop off what's too long */
}
- bcopy(*tag, (char *)dp, tlen);
+ bcopy(*tag, dp, tlen);
length += tlen;
dp += tlen;
}
* Authors: Archie Cobbs <archie@freebsd.org>, Alexander Motin <mav@alkar.net>
*
* $FreeBSD: src/sys/netgraph/ng_ppp.c,v 1.75 2008/02/06 20:37:34 mav Exp $
- * $DragonFly: src/sys/netgraph7/ng_ppp.c,v 1.2 2008/06/26 23:05:35 dillon Exp $
* $Whistle: ng_ppp.c,v 1.24 1999/11/01 09:24:52 julian Exp $
*/
return ng_ppp_prepend(m, &pbyte, 1);
} else {
- uint16_t pword = htons((uint16_t)proto);
+ uint16_t pword = htons(proto);
return ng_ppp_prepend(m, &pword, 2);
}
* Author: Julian Elischer <julian@freebsd.org>
*
* $FreeBSD: src/sys/netgraph/ng_pppoe.c,v 1.94 2008/03/03 19:36:03 mav Exp $
- * $DragonFly: src/sys/netgraph7/ng_pppoe.c,v 1.2 2008/06/26 23:05:35 dillon Exp $
* $Whistle: ng_pppoe.c,v 1.10 1999/11/01 09:24:52 julian Exp $
*/
sp->neg->numtags = count;
break; /* XXX chop off what's too long */
}
- bcopy(*tag, (char *)dp, tlen);
+ bcopy(*tag, dp, tlen);
length += tlen;
dp += tlen;
}
/* Time to sign the cookie */
sctp_hash_digest_m((char *)inp->sctp_ep.secret_key[
(int)(inp->sctp_ep.current_secret_number)],
- SCTP_SECRET_SIZE, mret, sizeof(struct sctp_paramhdr),
- (uint8_t *)signature);
+ SCTP_SECRET_SIZE, mret, sizeof(struct sctp_paramhdr), signature);
sig->m_len += SCTP_SIGNATURE_SIZE;
cookie_sz += SCTP_SIGNATURE_SIZE;
else {
#ifdef SCTP_DEBUG
if (sctp_debug_on & SCTP_DEBUG_OUTPUT1) {
- kprintf("Unknown protocol (TSNH) type %d\n", ((struct sockaddr *)to)->sa_family);
+ kprintf("Unknown protocol (TSNH) type %d\n",
+ to->sa_family);
}
#endif
sctp_m_freem(m);
#ifdef SCTP_DEBUG
if (sctp_debug_on & SCTP_DEBUG_OUTPUT3) {
kprintf("Ok we have done the fillup no_data_chunk=%d tf=%d prw:%d\n",
- (int)no_data_chunks,
+ no_data_chunks,
(int)asoc->total_flight, (int)asoc->peers_rwnd);
}
#endif
ph++;
mm->m_pkthdr.len = tot_out + sizeof(struct sctp_paramhdr);
mm->m_len = mm->m_pkthdr.len;
- error = uiomove((caddr_t)ph, (int)tot_out, uio);
+ error = uiomove((caddr_t)ph, tot_out, uio);
if (error) {
/*
* Here if we can't get his data we
m_notify->m_len = sizeof(struct sctp_paddr_change);
m_notify->m_next = NULL;
- to = (struct sockaddr *)(struct sockaddr *)
+ to = (struct sockaddr *)
&stcb->asoc.primary_destination->ro._l_addr;
if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4) &&
to->sa_family == AF_INET) {
/* Steal off the mbuf */
chk->data = NULL;
- to = (struct sockaddr *)(struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
+ to = (struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4) &&
to->sa_family == AF_INET) {
struct sockaddr_in *sin;
m_notify->m_len = sizeof(struct sctp_adaption_event);
m_notify->m_next = NULL;
- to = (struct sockaddr *)(struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
+ to = (struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4) &&
(to->sa_family == AF_INET)) {
struct sockaddr_in *sin;
m_notify->m_len = sizeof(struct sctp_pdapi_event);
m_notify->m_next = NULL;
- to = (struct sockaddr *)(struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
+ to = (struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4) &&
(to->sa_family == AF_INET)) {
struct sockaddr_in *sin;
m_notify->m_len = sizeof(struct sctp_shutdown_event);
m_notify->m_next = NULL;
- to = (struct sockaddr *)(struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
+ to = (struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4) &&
to->sa_family == AF_INET) {
struct sockaddr_in *sin;
sctp_m_freem(m_notify);
return;
}
- to = (struct sockaddr *)(struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
+ to = (struct sockaddr *)&stcb->asoc.primary_destination->ro._l_addr;
if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_NEEDS_MAPPED_V4) &&
to->sa_family == AF_INET) {
struct sockaddr_in *sin;
/* $FreeBSD: src/sys/netinet6/ah_core.c,v 1.2.2.5 2002/04/28 05:40:26 suz Exp $ */
-/* $DragonFly: src/sys/netinet6/ah_core.c,v 1.11 2008/01/05 14:02:40 swildner Exp $ */
/* $KAME: ah_core.c,v 1.44 2001/03/12 11:24:39 itojun Exp $ */
/*
panic("ah_keyed_sha1_loop: what?");
ctxt = (SHA1_CTX *)state->foo;
- SHA1Update(ctxt, (caddr_t)addr, (size_t)len);
+ SHA1Update(ctxt, addr, len);
}
static void
panic("ah_hmac_sha1_loop: what?");
ctxt = (SHA1_CTX *)(((u_char *)state->foo) + 128);
- SHA1Update(ctxt, (caddr_t)addr, (size_t)len);
+ SHA1Update(ctxt, addr, len);
}
static void
panic("ah_hmac_sha2_256_loop: what?");
ctxt = (SHA256_CTX *)(((u_char *)state->foo) + 128);
- SHA256_Update(ctxt, (caddr_t)addr, (size_t)len);
+ SHA256_Update(ctxt, addr, len);
}
static void
panic("ah_hmac_sha2_384_loop: what?");
ctxt = (SHA384_CTX *)(((u_char *)state->foo) + 128);
- SHA384_Update(ctxt, (caddr_t)addr, (size_t)len);
+ SHA384_Update(ctxt, addr, len);
}
static void
panic("ah_hmac_sha2_512_loop: what?");
ctxt = (SHA512_CTX *)(((u_char *)state->foo) + 128);
- SHA512_Update(ctxt, (caddr_t)addr, (size_t)len);
+ SHA512_Update(ctxt, addr, len);
}
static void
}
so_pru_ctlinput(
- (struct protosw *)&inet6sw[ip6_protox[nxt]],
+ &inet6sw[ip6_protox[nxt]],
code, (struct sockaddr *)&icmp6dst, &ip6cp);
}
return (0);
/* $FreeBSD: src/sys/netinet6/in6_gif.c,v 1.2.2.7 2003/01/23 21:06:47 sam Exp $ */
-/* $DragonFly: src/sys/netinet6/in6_gif.c,v 1.18 2008/10/27 02:56:30 sephe Exp $ */
/* $KAME: in6_gif.c,v 1.49 2001/05/14 14:02:17 itojun Exp $ */
/*
in6_gif_attach(struct gif_softc *sc)
{
sc->encap_cookie6 = encap_attach_func(AF_INET6, -1, gif_encapcheck,
- (struct protosw *)&in6_gif_protosw, sc);
+ &in6_gif_protosw, sc);
if (sc->encap_cookie6 == NULL)
return EEXIST;
return 0;
struct domain inet6domain = {
AF_INET6, "internet6", NULL, NULL, NULL,
(struct protosw *)inet6sw,
- (struct protosw *)&inet6sw[NELEM(inet6sw)],
+ &inet6sw[NELEM(inet6sw)],
SLIST_ENTRY_INITIALIZER,
in6_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3,
sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach
/* $FreeBSD: src/sys/netinet6/nd6_nbr.c,v 1.4.2.6 2003/01/23 21:06:47 sam Exp $ */
-/* $DragonFly: src/sys/netinet6/nd6_nbr.c,v 1.24 2008/10/03 07:59:20 hasso Exp $ */
/* $KAME: nd6_nbr.c,v 1.86 2002/01/21 02:33:04 jinmei Exp $ */
/*
return;
}
callout_init(&dp->dad_timer_ch);
- TAILQ_INSERT_TAIL(&dadq, (struct dadq *)dp, dad_list);
+ TAILQ_INSERT_TAIL(&dadq, dp, dad_list);
nd6log((LOG_DEBUG, "%s: starting DAD for %s\n", if_name(ifa->ifa_ifp),
ip6_sprintf(&ia->ia_addr.sin6_addr)));
nd6_dad_stoptimer(dp);
- TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
+ TAILQ_REMOVE(&dadq, dp, dad_list);
kfree(dp, M_IP6NDP);
dp = NULL;
_IFAFREE(ifa, 0);
nd6log((LOG_INFO, "%s: could not run DAD, driver problem?\n",
if_name(ifa->ifa_ifp)));
- TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
+ TAILQ_REMOVE(&dadq, dp, dad_list);
kfree(dp, M_IP6NDP);
dp = NULL;
_IFAFREE(ifa, 0);
if_name(ifa->ifa_ifp),
ip6_sprintf(&ia->ia_addr.sin6_addr)));
- TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
+ TAILQ_REMOVE(&dadq, dp, dad_list);
kfree(dp, M_IP6NDP);
dp = NULL;
_IFAFREE(ifa, 0);
log(LOG_ERR, "%s: manual intervention required\n",
if_name(ifa->ifa_ifp));
- TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
+ TAILQ_REMOVE(&dadq, dp, dad_list);
kfree(dp, M_IP6NDP);
dp = NULL;
_IFAFREE(ifa, 0);
/* in6p's ref-count increased && stcb locked */
if ((in6p) && (stcb)) {
sctp_send_packet_dropped(stcb, net, m, iphlen, 1);
- sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, 2);
+ sctp_chunk_output(in6p, stcb, 2);
} else if ((in6p != NULL) && (stcb == NULL)) {
refcount_up = 1;
}
error = EISCONN;
goto release;
}
- if (!prison_remote_ip(td, (struct sockaddr *)addr6)) {
+ if (!prison_remote_ip(td, addr6)) {
error = EAFNOSUPPORT; /* IPv4 only jail */
goto release;
}
* notice must be reproduced on all copies.
*
* @(#) $FreeBSD: src/sys/netatm/spans/spans_subr.c,v 1.4 1999/08/28 00:48:52 peter Exp $
- * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_subr.c,v 1.6 2006/01/14 13:36:39 swildner Exp $
*/
/*
* Close the SVC and notify the owner
*/
outstate = vcp->vc_sstate;
- SPANS_VC_CANCEL((struct vccb *) vcp);
+ SPANS_VC_CANCEL(vcp);
vcp->vc_ustate = VCCU_CLOSED;
vcp->vc_sstate = SPANS_VC_FREE;
if (outstate == SPANS_VC_OPEN ||
pfkeystat.in_msgtype[pmsg->sadb_msg_type]++;
}
- if (!ssb_appendaddr(&rp->rcb_socket->so_rcv, (struct sockaddr *)&key_src,
- m, NULL)) {
+ if (!ssb_appendaddr(&rp->rcb_socket->so_rcv, &key_src, m, NULL)) {
pfkeystat.in_nomem++;
m_freem(m);
error = ENOBUFS;
}
/* Restore the Next Protocol field */
- m_copyback(m, protoff, sizeof (u_int8_t), (u_int8_t *) &nproto);
+ m_copyback(m, protoff, sizeof (u_int8_t), &nproto);
IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, NULL);
/* attach to encapsulation framework */
/* XXX save return cookie for detach on module remove */
encap_attach_func(AF_INET, -1,
- ipe4_encapcheck, (struct protosw*) &ipe4_protosw[0], NULL);
+ ipe4_encapcheck, &ipe4_protosw[0], NULL);
#ifdef INET6
encap_attach_func(AF_INET6, -1,
- ipe4_encapcheck, (struct protosw*) &ipe4_protosw[1], NULL);
+ ipe4_encapcheck, &ipe4_protosw[1], NULL);
#endif
}
SYSINIT(ipe4_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipe4_attach, NULL);
}
lwkt_gettoken(&key_token);
- if (!ssb_appendaddr(&rp->rcb_socket->so_rcv,
- (struct sockaddr *)&key_src, m, NULL)) {
+ if (!ssb_appendaddr(&rp->rcb_socket->so_rcv, &key_src, m, NULL)) {
pfkeystat.in_nomem++;
m_freem(m);
error = ENOBUFS;
ncp_soconnect(struct socket *so,struct sockaddr *target, struct thread *td) {
int error;
- error = soconnect(so, (struct sockaddr*)target, td);
+ error = soconnect(so, target, td);
if (error)
return error;
/*
if (error==0) {
if (sa) {
len = min(len, sa->sa_len);
- bcopy(sa, (caddr_t)asa, (u_int)len);
+ bcopy(sa, asa, (u_int)len);
}
*alen=len;
}
so = conn->wdg_so;
sbinit(&sio, 1000000);
flags = MSG_DONTWAIT;
- error = so_pru_soreceive(so, (struct sockaddr**)&sa,
- NULL, &sio, NULL, &flags);
+ error = so_pru_soreceive(so, &sa, NULL, &sio, NULL, &flags);
if (error)
break;
len = sio.sb_cc;
if (len > 0) {
plen = len % GMAC_BLOCK_LEN;
if (len >= GMAC_BLOCK_LEN)
- ghash_update(&ctx->ghash, (uint8_t *)data, len - plen);
+ ghash_update(&ctx->ghash, data, len - plen);
if (plen) {
- bcopy((uint8_t *)data + (len - plen), (uint8_t *)blk,
- plen);
+ bcopy(data + (len - plen), (uint8_t *)blk, plen);
ghash_update(&ctx->ghash, (uint8_t *)blk,
GMAC_BLOCK_LEN);
}
static void
twofish128_encrypt(caddr_t key, u_int8_t *blk, u_int8_t *iv)
{
- twofish_encrypt((twofish_ctx *) key, (u_int8_t *) blk,
- (u_int8_t *) blk);
+ twofish_encrypt((twofish_ctx *) key, blk, blk);
}
static void
twofish128_decrypt(caddr_t key, u_int8_t *blk, u_int8_t *iv)
{
- twofish_decrypt(((twofish_ctx *) key), (u_int8_t *) blk,
- (u_int8_t *) blk);
+ twofish_decrypt(((twofish_ctx *) key), blk, blk);
}
static int
*sched = kmalloc(sizeof(twofish_ctx), M_CRYPTO_DATA,
M_INTWAIT | M_ZERO);
if (*sched != NULL) {
- twofish_set_key((twofish_ctx *) *sched, (u_int8_t *) key,
- len * 8);
+ twofish_set_key((twofish_ctx *) *sched, key, len * 8);
err = 0;
} else
err = ENOMEM;
static void
serpent128_encrypt(caddr_t key, u_int8_t *blk, u_int8_t *iv)
{
- serpent_encrypt((serpent_ctx *) key, (u_int8_t *) blk,
- (u_int8_t *) blk);
+ serpent_encrypt((serpent_ctx *) key, blk, blk);
}
static void
serpent128_decrypt(caddr_t key, u_int8_t *blk, u_int8_t *iv)
{
- serpent_decrypt(((serpent_ctx *) key), (u_int8_t *) blk,
- (u_int8_t *) blk);
+ serpent_decrypt(((serpent_ctx *) key), blk, blk);
}
static int
*sched = kmalloc(sizeof(serpent_ctx), M_CRYPTO_DATA,
M_INTWAIT | M_ZERO);
if (*sched != NULL) {
- serpent_set_key((serpent_ctx *) *sched, (u_int8_t *) key,
- len * 8);
+ serpent_set_key((serpent_ctx *) *sched, key, len * 8);
err = 0;
} else
err = ENOMEM;