public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: michal.simek@petalogix.com
Cc: ltp-list@lists.sourceforge.net, naresh.kernel@gmail.com,
	Jyoti <jyotiv@linux.vnet.ibm.com>,
	Mike Frysinger <vapier.adi@gmail.com>
Subject: Re: [LTP] Submitting patch
Date: Tue, 04 Aug 2009 15:41:47 +0530	[thread overview]
Message-ID: <1249380712.15587.3.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <4A77F359.40901@petalogix.com>

Hi Michal/Garret/all,

On Tue, 2009-08-04 at 10:37 +0200, Michal Simek wrote:
> Garrett Cooper wrote:
> > On Mon, Aug 3, 2009 at 7:46 AM, Michal Simek<michal.simek@petalogix.com> wrote:
> >   
> >> Cyril Hrubis wrote:
> >>     
> >>> Hi!
> >>>
> >>>       
> >>>>> What's wrong with linux kernel coding style? Most of the decent text editors
> >>>>> that are used these days (vim, emacs...) just helps format code like this. (Eg.
> >>>>> default intendation is done by tabs and so on...) I don't like the idea
> >>>>> changing tabs to spaces before sending a patch.
> >>>>>
> >>>>>           
> >>>> There is only one thing which is IMHO not good - it is 80 char line size.
> >>>> I would prefer longer lines (maybe 120 chars).
> >>>> This is for C code not for any other.
> >>>> Are you ok with it?
> >>>>
> >>>>         
> >>> Well, I'm not happy with very long lines, but there are indeed circumstances
> >>> where long lines are best solution.
> >>>
> >>>       
> >> I am not happy with it too but there are some cases where is really ugly
> >> to have 80chars lines.
> >>     
> >
> > IMHO 95% of the time you can get away with shorter lines with
> > different constructs or more clever indentation. 
> I don't want to do any clever indentation. This discuss is again and
> again the same!!!
> 
> I vote for standard linux indentation - tab (size 8 chars) for whole C code.
> Follow linux kernel coding style for whole C code. As we discussed in
> this thread 80 chars line are strongly recommended.
> For checking C source code use checkpatch.pl script which is in linux
> kernel before sending patches to mailing list
> and of course checking patches before applying.
> 

Yes, checkpatch.pl for C code patches.

> Cyril, Mike, Subrata and others: Can you send us your opinion? I don't
> want to spend my time with discuss about it.
> 
> I am not interested in any other code that's why I don't write any
> comment to it.
> You can choose what you want. Of course if is similar utility like
> checkpatch.pl it will be good to use it and not to check
> it by hand.
> 
> Subrata can we please write output from this discussion to web / doc
> somewhere?
> 

I will do that soon.

> Thanks,
> Michal
> 
> 
> > Take for example what
> > I just did with delete_module* -- now that was a mess to cleanup, but
> > quick nonetheless and necessary:
> > http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/module/delete_module/delete_module01.c?view=log&pathrev=makefile_infra_rework
> > , http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/module/delete_module/delete_module02.c?view=log&pathrev=makefile_infra_rework
> > , http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/module/delete_module/delete_module03.c?view=log&pathrev=makefile_infra_rework
> >
> > We should aim for 80 column lines wherever possible because it's the
> > defacto standard, and where we can't do that (and there are a handful
> > of areas with shell code and Makefile code where I couldn't without
> > changing the meaning of the message I was trying to convey), we should
> > go over 80 cols.
> >
> > At least that's how every project I know has done it.
> >
> > General rules of thumb for shell / python / perl code (from dealing
> > with other projects) was 4 space indents. Perl tends to go whacky
> > though because of all of the different ways to express constructs
> > though xD.

Again, checkpatch.pl for non-C code as well. But, need to carefully
review the errors it will generate for non-C code like the Makefiles,
perl, shell, python, etc.

Garret,

Can you please come up with a list of exceptions for
     1. line length,
     2. tab length,
     3. etc

for non-C code like the perl, Makefiles, etc. I would then document them
all.

Regards--
Subrata

> >
> > Thanks!
> > -Garrett
> >   
> 
> 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  parent reply	other threads:[~2009-08-04 10:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24 11:00 [LTP] Submitting patch jyotiv
2009-07-25  6:15 ` Michal Simek
2009-07-25 16:48   ` Garrett Cooper
2009-07-27  9:29     ` Michal Simek
2009-07-30 18:29       ` Subrata Modak
2009-08-03 10:47         ` Cyril Hrubis
     [not found]           ` <4A76EA47.7070209@petalogix.com>
2009-08-03 13:54             ` Cyril Hrubis
     [not found]               ` <4A76F856.6030307@petalogix.com>
     [not found]                 ` <364299f40908030944n74d79509r716dcbcc8875677b@mail.gmail.com>
     [not found]                   ` <4A77F359.40901@petalogix.com>
2009-08-04 10:11                     ` Subrata Modak [this message]
2009-07-30 18:50       ` Garrett Cooper
  -- strict thread matches above, loose matches on Subject: below --
2009-08-05  9:00 Jyoti
2009-08-05  9:10 ` Subrata Modak

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=1249380712.15587.3.camel@subratamodak.linux.ibm.com \
    --to=subrata@linux.vnet.ibm.com \
    --cc=jyotiv@linux.vnet.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=michal.simek@petalogix.com \
    --cc=naresh.kernel@gmail.com \
    --cc=vapier.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