Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function

2015-07-06 Thread Dan Carpenter
Since this is turning into a long thread, the correct thing is to copy 3eb141511bd5 ('staging: dgap: get rid of nasty DGAP_VERIFY_BOARD macro'). regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverprojec

Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function

2015-07-06 Thread Valdis . Kletnieks
On Mon, 06 Jul 2015 18:50:12 +0530, Ravi Teja Darbha said: > Why would you use a macro to avoid code duplication? The macro does end up putting code in each place it's used. However, the actual code is in one place rather than open-coded in multiple places that can diverge over time (somebody patc

Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function

2015-07-06 Thread Ravi Teja Darbha
Why would you use a macro to avoid code duplication? Regards, Ravi Teja On Mon, Jul 06, 2015 at 05:57:06PM +0530, Sudip Mukherjee wrote: > That is why the macro is there, to avoid the duplication of code. ___ devel mailing list de...@linuxdriverproject.

Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function

2015-07-06 Thread Sudip Mukherjee
On Mon, Jul 06, 2015 at 05:45:24PM +0530, Ravi Teja Darbha wrote: > What you need to do is to replace all DGNC_VERIFY_BOARD() macro calls with > its definition. And repeating the same code 12 times?? That is why the macro is there, to avoid the duplication of code. regards sudip _

Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function

2015-07-06 Thread Ravi Teja Darbha
What you need to do is to replace all DGNC_VERIFY_BOARD() macro calls with its definition. Regards, Ravi Teja On Sun, Jul 05, 2015 at 11:46:28PM +0530, Arjun Krishna Babu wrote: > This patch fixes the checkpatch.pl warning: > > WARNING: Macros with flow control statements should be avoided > >

Re: [PATCH] staging: dgnc: Replace macro with flow control statement by a function

2015-07-06 Thread Dan Carpenter
On Sun, Jul 05, 2015 at 11:46:28PM +0530, Arjun Krishna Babu wrote: > This patch fixes the checkpatch.pl warning: > > WARNING: Macros with flow control statements should be avoided > > Replace the macro with a function doing the exact same task as the > macro. > No. You haven't understood what

[PATCH] staging: dgnc: Replace macro with flow control statement by a function

2015-07-05 Thread Arjun Krishna Babu
This patch fixes the checkpatch.pl warning: WARNING: Macros with flow control statements should be avoided Replace the macro with a function doing the exact same task as the macro. Signed-off-by: Arjun Krishna Babu --- drivers/staging/dgnc/dgnc_sysfs.c | 22 ++ 1 file chang