linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Luke Yang <luke.adi@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ADI Blackfin porting for kernel-2.6.13
Date: Sun, 25 Sep 2005 05:09:25 +0200	[thread overview]
Message-ID: <200509250509.26186.jesper.juhl@gmail.com> (raw)
In-Reply-To: <489ecd0c050922223736cf1548@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4179 bytes --]

On Friday 23 September 2005 07:37, Luke Yang wrote:
> Hi all,
> 
>    This is the ADI Blackfin patch for kernel 2.6.13.  I know this
> patch doesn' meet the kernel patch submission format, but this patch
> is only for reviewing, shows the changes we made.  And I'll send new
> patch for kernel 2.6.14 for you to merge into kernel.
> 
>    This patch mainly includes the arch/bfinnommu architecture files
> and some blackfin specific drivers.  The only change to the common
> files is that we change binfmt.c and related header file, added one
> flat binary format for blackfin. We are considering removing this
> change in next release.
> 
>   The patch is too big to put here , url is
> http://blackfin.uclinux.org/frs/download.php/570/bfinnonnu-linux-2.6.13.patch
> 

Ok, I went through the files in arch/bfinnommu/kernel/ and I have some
comments (I don't have the time to look at the rest of it).
I think you need to do some work before merging this.

I've attached a patch (compressed due to its size) that contain all the 
changes I refer to below. It's just one big patch with all the changes I 
made while I went through the files. It's not split out into logically 
seperate changes - sorry. I just made different types of changes along the 
way, and the attached patch is the result.


You need to clean this stuff up with respect to CodingStyle. Currently the 
files are quite inconsistent in the style(s) they use, and they don't follow
the kernels CodingStyle very closely either.

You have a lot of very deeply nested code (especially in dma.c) that is quite 
hard to follow and also violates the 80column rule. Try to reduce the nesting
depth.
I've made most of the code fit in 80 columns, but I've probably missed a few 
spots.

the *_interrupt functions in dma.c are just begging for a few helper functions
to share common code and reduce complexity. I've reordered them a bit to make 
them more readable, but there's lots more that could be done.

There's *lots* of trailing whitespace all over the place. Please get rid of 
that prior to merging.

There's *lots* of cases of mixing of spaces and tabs for indentation. Indent 
with tabs only please, and certainly don't have lines like 
"<space><tab><space><space><space><space><tab>code" 
like you have at the moment.
I've cleaned up all the trailing whitespace, and some of the other space+tab
braindamage, but there's probably still something left to do.

There are quite a lot of casts in the code, and some of them are completely 
pointless. There's no need to cast the return value of kmalloc(), there's no
need to cast assignments to/from void pointers, there's no need to cast 
assignments between types where normal C promotion rules obtain the same
result.
Such unnesesary casting is harmful. It defeats what limited typechecking C 
has, so the compiler can't help and warn when you do something bad, it also 
lessens the usefullnes of tools such as sparse.
I've cleaned up some of this, but not everything.

You seem to be quite fond of MixingCapsAndLowercaseChars in variable names.
Please don't unless you really have to. Stick to purely lowercase for variable
names as much as possible.
I've renamed a few vars, just as examples.

I stumbled across some unused variables as well that I removed, but there may 
be more.

I've cleaned up a lot of other CodingStyle issues as well. Check the attached 
patch and you'll see.

In dma.c :
  DMA_RESULT set_dma_transfer_size(unsigned int channel, char size)
  DMA_RESULT get_dma_transfer_size(unsigned int channel, unsigned short *size)
Seems inconsistent. Why "char size" for set_dma_transfer_size(), but
"unsigned short *size" for get_dma_transfer_size() ??
An if char is what you want to use for size in set_dma_transfer_size(), then 
shouldn't that be "unsigned char" ?


I think that's all, read the patch (or apply it and look at the results) to 
get all the details. Now I'll go get some sleep...


Ohh, before I leave, one more note:  I have no way at all to test this code, 
so it's quite possible I've made mistakes in the patch I'm attaching, so do 
review it carefully before applying bits from it.


-- 
Jesper Juhl <jesper.juhl@gmail.com>


[-- Attachment #2: blackfin-arch_bfinnommu_kernel.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 37761 bytes --]

  parent reply	other threads:[~2005-09-25  3:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-20  6:33 ADI Blackfin porting for kernel-2.6.13 Luke Yang
2005-09-20  7:15 ` Deepak Saxena
2005-09-23  5:37   ` Luke Yang
2005-09-24 14:51     ` Robert Schwebel
2005-09-27  1:37       ` Luke Yang
2005-09-27  5:05         ` Robert Schwebel
2005-09-24 19:41     ` Jesper Juhl
2005-09-25  3:09     ` Jesper Juhl [this message]
2005-10-22 15:08 Jacques Moreau
2005-11-01 15:48 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=200509250509.26186.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).