mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Luke Yang" <luke.adi@gmail.com>,
	linux-kernel@vger.kernel.org, "Andrew Morton" <akpm@osdl.org>
Subject: Re: [PATCH 1/4] Blackfin: arch patch for 2.6.18
Date: Fri, 22 Sep 2006 18:18:26 -0700	[thread overview]
Message-ID: <20060922181826.3b209d1d.rdunlap@xenotime.net> (raw)
In-Reply-To: <200609230218.36894.arnd@arndb.de>

On Sat, 23 Sep 2006 02:18:36 +0200 Arnd Bergmann wrote:

> I've done a brief review. Overall, it looks fine, but you have lots of
> code duplication between your specific machines. It would be good
> to generalize that further.

Yes, I noticed that too.


> It would be good if you can get your code to build cleanly when using
> C=1 with sparse, right now that clearly won't work.

See Documentation/SubmitChecklist.

> Detailed comments follow
> 
> > +/*#define IRQ_DEBUG*/
> > +#undef IRQ_DEBUG
> > +
> > +#ifdef IRQ_DEBUG
> > +#define IRQ_DPRINTK(x...)	printk(x)
> > +#else
> > +#define IRQ_DPRINTK(x...)	do { } while (0)
> > +#endif
> 
> Use pr_debug here instead of making up your own macros

I saw 3 versions/variants of debug printk macros.  :(
(maybe I missed a few :)

[lots of other good comments snipped :]


> > +static char *cplb_print_entry(char *buf, int type)
> > +{
> > +	unsigned long *p_addr = dpdt_table;
> > +	unsigned long *p_data = dpdt_table + 1;
> > +	unsigned long *p_icount = dpdt_swapcount_table;
> > +	unsigned long *p_ocount = dpdt_swapcount_table + 1;
> > +	unsigned long *cplb_addr = (unsigned long *)DCPLB_ADDR0;
> > +	unsigned long *cplb_data = (unsigned long *)DCPLB_DATA0;
> > +	int entry, used_cplb = 0;
> > +
> > +	if (type == CPLB_I) {
> > +		buf += sprintf(buf, "Instrction CPLB entry:\n");
> > +		p_addr = ipdt_table;
> > +		p_data = ipdt_table + 1;
> > +		p_icount = ipdt_swapcount_table;
> > +		p_ocount = ipdt_swapcount_table + 1;
> > +		cplb_addr = (unsigned long *)ICPLB_ADDR0;
> > +		cplb_data = (unsigned long *)ICPLB_DATA0;
> > +	} else
> > +		buf += sprintf(buf, "Data CPLB entry:\n");
> > +
> > +	buf += sprintf(buf, "Address\t\tData\tSize\tValid\tLocked\tSwapin\
> > +\tiCount\toCount\n");
> > +
> > +	while (*p_addr != 0xffffffff) {
> > +		entry = cplb_find_entry(cplb_addr, cplb_data, *p_addr);
> > +		if (entry >= 0 && *p_data == cplb_data[entry])
> > +			used_cplb |= 1 << entry;
> > +
> > +		buf +=
> > +		    sprintf(buf,
> > +			    "0x%08lx\t0x%05lx\t%s\t%c\t%c\t%2d\t%ld\t%ld\n",
> > +			    *p_addr, *p_data,
> > +			    page_size_string_table[(*p_data & 0x30000) >> 16],
> > +			    (*p_data & CPLB_VALID) ? 'Y' : 'N',
> > +			    (*p_data & CPLB_LOCK) ? 'Y' : 'N', entry, *p_icount,
> > +			    *p_ocount);
> > +
> > +		p_addr += 2;
> > +		p_data += 2;
> > +		p_icount += 2;
> > +		p_ocount += 2;
> > +	}
> > +
> > +	if (used_cplb != 0xffff) {
> > +		buf += sprintf(buf, "Unused/mismatched CPLBs:\n");
> > +
> > +		for (entry = 0; entry < 16; entry++)
> > +			if (0 == ((1 << entry) & used_cplb)) {
> > +				int flags = cplb_data[entry];
> > +				buf +=
> > +				    sprintf(buf,
> > +					    "%2d: 0x%08lx\t0x%05x\t%s\t%c\t%c\n",
> > +					    entry, cplb_addr[entry], flags,
> > +					    page_size_string_table[(flags &
> > +								    0x30000) >>
> > +								   16],
> > +					    (flags & CPLB_VALID) ? 'Y' : 'N',
> > +					    (flags & CPLB_LOCK) ? 'Y' : 'N');
> > +			}
> > +	}
> > +
> > +	buf += sprintf(buf, "\n");
> > +
> > +	return buf;
> > +}
> 
> Another one of those files that just don't belong in procfs. Find some other
> interface for this.

examples of acceptable interfaces?

---
~Randy

  reply	other threads:[~2006-09-23  1:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-21  3:32 Luke Yang
2006-09-21  9:59 ` Luke Yang
2006-09-23  0:18 ` Arnd Bergmann
2006-09-23  1:18   ` Randy.Dunlap [this message]
2006-09-23  1:24     ` Roland Dreier
2006-09-23  1:58       ` Mike Frysinger
2006-09-23  6:50   ` Mike Frysinger
2006-09-23 11:03     ` Arnd Bergmann
2006-09-23 11:15       ` Mike Frysinger
2006-09-23 11:29         ` Arnd Bergmann
2006-09-23 13:07         ` Arnd Bergmann
2006-09-23 11:28     ` Matthieu CASTET
2006-09-23 11:35       ` Mike Frysinger
2006-09-23 19:43     ` Arnd Bergmann
2006-09-24  3:49       ` Luke Yang
2006-09-24  3:35   ` Aubrey
2006-09-24  3:50     ` Randy Dunlap
2006-09-24  4:28       ` Aubrey
2006-09-25  6:54     ` Arnd Bergmann
2006-09-25  7:49       ` Aubrey
2006-09-25  9:26         ` Arnd Bergmann
2006-09-25  9:39           ` Luke Yang
2006-09-25  9:45           ` Aubrey
2006-09-25 15:39           ` Aubrey
2006-09-25 17:05             ` Arnd Bergmann
2006-09-26  3:42               ` Aubrey
2006-09-26  9:43                 ` Arnd Bergmann
2006-09-27 10:04               ` Aubrey
2006-09-27 11:37                 ` Arnd Bergmann
2006-09-23 21:27 ` David Woodhouse
2006-09-25 16:52 ` Randy Dunlap
2006-09-25 18:05   ` Mike Frysinger
2006-09-23 16:29 Robin Getz
2006-09-23 18:10 ` Arnd Bergmann
2006-09-23 17:57 Robin Getz
2006-09-23 23:25 Robin Getz
2006-09-24  7:29 ` David Woodhouse
2006-09-25 23:21 Robin Getz
2006-09-27 16:25 Robin Getz
2006-09-27 16:36 ` Randy Dunlap
2006-09-27 16:41 ` Arnd Bergmann
2006-09-27 17:19 ` Robin Getz
2006-09-27 20:57   ` Arnd Bergmann
2006-09-28  9:31     ` Bernd Schmidt
2006-09-28 11:04       ` Arnd Bergmann
2006-09-28 11:39         ` Bernd Schmidt
2006-09-28 12:35           ` Arnd Bergmann
2006-09-27 17:47 Robin Getz
2006-09-27 19:19 ` Jörn Engel
2006-09-27 21:22 Robin Getz
2006-09-27 21:36 ` Arnd Bergmann
2006-09-27 22:56 Robin Getz
2006-09-27 23:01 Robin Getz

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=20060922181826.3b209d1d.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@osdl.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke.adi@gmail.com \
    /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®