mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Hansjoerg Lipp <hjlipp@web.de>
Cc: Davem@davemloft.net, Karsten Keil <kkeil@suse.de>,
	i4ldeveloper@listserv.isdn4linux.de,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
	Tilman Schmidt <tilman@imap.cc>
Subject: Re: [PATCH 1/7] isdn4linux: Siemens Gigaset drivers - common module
Date: Mon, 27 Feb 2006 09:00:01 +0100	[thread overview]
Message-ID: <1141027201.2992.45.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <gigaset307x.2006.02.27.001.1@hjlipp.my-fqdn.de>

On Mon, 2006-02-27 at 07:23 +0100, Hansjoerg Lipp wrote:

> +	struct semaphore sem;		/* locks this structure:
> +					 *   connected is not changed,
> +					 *   hardware_up is not changed,
> +					 *   MState is not changed to or from
> +					 *   MS_LOCKED */
> +

please turn this into a mutex



> +/* handling routines for sk_buff */
> +/* ============================= */
> +
> +/* private version of __skb_put()
> + * append 'len' bytes to the content of 'skb', already knowing that the
> + * existing buffer can accomodate them
> + * returns a pointer to the location where the new bytes should be copied to
> + * This function does not take any locks so it must be called with the
> + * appropriate locks held only.
> + */
> +static inline unsigned char *gigaset_skb_put_quick(struct sk_buff *skb,
> +						   unsigned int len)
> +{
> +	unsigned char *tmp = skb->tail;
> +	/*SKB_LINEAR_ASSERT(skb);*/		/* not needed here */
> +	skb->tail += len;
> +	skb->len += len;
> +	return tmp;
> +}


this looks truely scary and wrong

> +/* append received bytes to inbuf */
> +static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf,
> +				     const unsigned char *src,
> +				     unsigned numbytes)
> +{
> +	unsigned n, head, tail, bytesleft;
> +
> +	gig_dbg(DEBUG_INTR, "received %u bytes", numbytes);
> +
> +	if (!numbytes)
[snip 30 lines]

isn't this function rather big to be inlined ?
> +
> +/*======================================================================
> +  Prototypes of internal functions
> + */
> +
> +static struct cardstate *alloc_cs(struct gigaset_driver *drv);
> +static void free_cs(struct cardstate *cs);
> +static void make_valid(struct cardstate *cs, unsigned mask);
> +static void make_invalid(struct cardstate *cs, unsigned mask);

most of the time these can just go away by ordering the functions better

> +
> +void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
> +			size_t len, const unsigned char *buf, int from_user)


such "from_user" parameter is highly evil, and also breaks sparse and
friends.. (btw please run sparse on the code and fix all warnings)





  parent reply	other threads:[~2006-02-27  8:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27  6:23 [PATCH 0/7] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX Hansjoerg Lipp
2006-02-27  6:23 ` [PATCH 1/7] isdn4linux: Siemens Gigaset drivers - common module Hansjoerg Lipp
2006-02-27  6:23   ` [PATCH 2/7] isdn4linux: Siemens Gigaset drivers - event layer Hansjoerg Lipp
2006-02-27  6:23     ` [PATCH 3/7] isdn4linux: Siemens Gigaset drivers - subsystem interfaces Hansjoerg Lipp
2006-02-27  6:23       ` [PATCH 4/7] isdn4linux: Siemens Gigaset drivers - direct USB connection Hansjoerg Lipp
2006-02-27  6:23         ` [PATCH 5/7] isdn4linux: Siemens Gigaset drivers - isochronous data handler Hansjoerg Lipp
2006-02-27  6:23           ` [PATCH 6/7] isdn4linux: Siemens Gigaset drivers - M105 USB DECT adapter Hansjoerg Lipp
2006-02-27  6:23             ` [PATCH 7/7] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles Hansjoerg Lipp
2006-02-27  8:01     ` [PATCH 2/7] isdn4linux: Siemens Gigaset drivers - event layer Arjan van de Ven
2006-02-27  8:02     ` Arjan van de Ven
2006-02-27  7:52   ` [PATCH 1/7] isdn4linux: Siemens Gigaset drivers - common module Arjan van de Ven
2006-02-27  8:00   ` Arjan van de Ven [this message]
2006-02-27  9:29 ` [PATCH 0/7] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX Arjan van de Ven
2006-03-02 23:03   ` Tilman Schmidt
2006-03-03  0:58     ` Roland Dreier
2006-03-03  6:53     ` Arjan van de Ven
2006-03-03  9:44       ` Karsten Keil
2006-03-03 14:54       ` Tilman Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1141027201.2992.45.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=Davem@davemloft.net \
    --cc=gregkh@suse.de \
    --cc=hjlipp@web.de \
    --cc=i4ldeveloper@listserv.isdn4linux.de \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=tilman@imap.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®