tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Porting umb(4) from OpenBSD

Le 03/05/2018 à 04:46, Pierre Pronchery a écrit :
You can obtain the fix(es) and follow my changes as I go here:;a=shortlog;h=refs/heads/khorben/umb

	int		 umb_match(device_t, cfdata_t, void *);

please make all of that static, global symbols are bad

	uint8_t umb_qmi_alloc_cid[] = {

if that's not supposed to move it should be const (and static too), also
take care of the functions that use that, they should use const too

	ifp->if_mtu = 1500;		/* use a common default */
	ifp->if_mtu = sc->sc_maxpktlen;

this doesn't look nice

	sc->sc_resp_buf = kmem_alloc(sc->sc_ctrl_len, M_NOWAIT);

that's the wrong flag

	#if 0
			if ((error = suser(p)) != 0)

kauth, no?

		error = copyout(&sc->sc_info, ifr->ifr_data,
		    sizeof (sc->sc_info));

maybe we should explicitly zero out sc_info in umb_attach, perhaps it
already is though

	m_copydata(m, 0, len, ptr + 1);

can you add a KASSERT please, to make sure 'len' is smaller than the area
on ptr+1

	all the sizeof (x)

please remove the whitespace, sizeof(x)


Home | Main Index | Thread Index | Old Index