public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Joonyoung Shim <jy0922.shim@samsung.com>
To: Alexey Klimov <klimov.linux@gmail.com>
Cc: linux-media@vger.kernel.org, mchehab@infradead.org,
	tobias.lorenz@gmx.net, kyungmin.park@samsung.com
Subject: Re: [PATCH 2/2] radio-si470x: add i2c driver for si470x
Date: Tue, 14 Jul 2009 09:15:21 +0900	[thread overview]
Message-ID: <4A5BCE19.9090502@samsung.com> (raw)
In-Reply-To: <208cbae30907131326t7cf9494bq9c28fed81cffa777@mail.gmail.com>

Hi, Alexey.

<snip>

>> diff --git a/linux/drivers/media/radio/si470x/radio-si470x-common.c
>> b/linux/drivers/media/radio/si470x/radio-si470x-common.c
>> index d2dc1ff..77f79e7 100644
>> --- a/linux/drivers/media/radio/si470x/radio-si470x-common.c
>> +++ b/linux/drivers/media/radio/si470x/radio-si470x-common.c
>> @@ -473,11 +473,13 @@ static int si470x_vidioc_g_ctrl(struct file *file,
>> void *priv,
>>  	struct si470x_device *radio = video_drvdata(file);
>>  	int retval = 0;
>>
>> +#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)
>>  	/* safety checks */
>>  	if (radio->disconnected) {
>>  		retval = -EIO;
>>  		goto done;
>>  	}
>> +#endif
> 
> I'm sorry for asking but is it possible to turn this into separate macro?
> Something like this for example:
> 
> /* comment about macro */
> #if defined (CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)
> #define safety_check() if() {
> ... checks ...
> }
> #elseif
> #define safety_check()
> #endif
> 
> to run away from many #if defined-#endif constructions in source code.
> Is it really good to redesign this or am i wrong here?
> 

I think your example is better, i will try it.


<snip>

>> +static int __init si470x_i2c_init(void)
>> +{
>> +	return i2c_add_driver(&si470x_i2c_driver);
>> +}
>> +module_init(si470x_i2c_init);
>> +
>> +static void __exit si470x_i2c_exit(void)
>> +{
>> +	i2c_del_driver(&si470x_i2c_driver);
>> +}
>> +module_exit(si470x_i2c_exit);
>> +
>> +MODULE_DESCRIPTION("i2c radio driver for si470x fm radio receivers");
>> +MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
>> +MODULE_LICENSE("GPL");
> 
> Please, move this information to the top of file to see this
> information fast when you suddenly open source file.

I'm not sure about this because many linux drivers have the module
information at the bottom of file.

      reply	other threads:[~2009-07-14  0:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13 11:24 [PATCH 2/2] radio-si470x: add i2c driver for si470x Joonyoung Shim
2009-07-13 20:26 ` Alexey Klimov
2009-07-14  0:15   ` Joonyoung Shim [this message]

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=4A5BCE19.9090502@samsung.com \
    --to=jy0922.shim@samsung.com \
    --cc=klimov.linux@gmail.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=tobias.lorenz@gmx.net \
    /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