From: Duncan Sands <duncan.sands@math.u-psud.fr>
To: Simon Arlott <e5d74fcd64729b17de1hc0yh0003aeoo@thunder.lp0.eu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] cxacru: Store all device status information and report it when atm_proc_read is called.
Date: Wed, 31 Jan 2007 15:19:51 +0100 [thread overview]
Message-ID: <200701311519.52023.duncan.sands@math.u-psud.fr> (raw)
In-Reply-To: <45BFB8F5.5010607@simon.arlott.org.uk>
Hi Simon,
> +static int cxacru_proc_read(struct usbatm_data *usbatm_instance,
> + struct atm_dev *atm_dev, loff_t * pos, char *page)
> +{
> + struct cxacru_data *instance = usbatm_instance->driver_data;
> + u32 *cxinf = instance->cxinf_status;
> + int left = *pos;
if there was no successfull call to cxacru_poll_status before this,
then you will output junk. Please initialize cxinf_status to something
sensible in cxacru_bind.
> + if (!left--)
> + return sprintf(page, "MAC=%02x:%02x:%02x:%02x:%02x:%02x\n",
> + atm_dev->esi[0], atm_dev->esi[1],
> + atm_dev->esi[2], atm_dev->esi[3],
> + atm_dev->esi[4], atm_dev->esi[5]);
Rather than duplicating code in usbatm, I think it would be better to
split the various output bits in usbatm_atm_proc_read into their own
functions, and export them, so they can be called from both
usbatm_atm_proc_read and cxacru_proc_read.
Best wishes,
Duncan.
next prev parent reply other threads:[~2007-01-31 14:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-30 21:30 Simon Arlott
2007-01-31 14:19 ` Duncan Sands [this message]
2007-01-31 23:39 ` Andrew Morton
2007-02-01 9:15 ` Duncan Sands
2007-02-11 17:10 ` Simon Arlott
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=200701311519.52023.duncan.sands@math.u-psud.fr \
--to=duncan.sands@math.u-psud.fr \
--cc=e5d74fcd64729b17de1hc0yh0003aeoo@thunder.lp0.eu \
--cc=linux-kernel@vger.kernel.org \
/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®