* [PATCH 0/2] staging: olpc_dcon: fix sparse warnings and compile errors
@ 2015-01-16 1:54 Murilo Opsfelder Araujo
2015-01-16 1:54 ` [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least() Murilo Opsfelder Araujo
2015-01-16 1:55 ` [PATCH 2/2] staging: olpc_dcon: fix sparse symbol not declared warning Murilo Opsfelder Araujo
0 siblings, 2 replies; 4+ messages in thread
From: Murilo Opsfelder Araujo @ 2015-01-16 1:54 UTC (permalink / raw)
To: linux-kernel
Cc: devel, gregkh, jon.nettleton, dsd, jfrederich,
Murilo Opsfelder Araujo
These two patches fix sparse warnings and make olpc_dcon.c build again
when CONFIG_OLPC is not set.
Murilo Opsfelder Araujo (2):
staging: olpc_dcon: check for CONFIG_OLPC before calling
olpc_board_at_least()
staging: olpc_dcon: fix sparse symbol not declared warning
drivers/staging/olpc_dcon/olpc_dcon.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--
2.1.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least()
2015-01-16 1:54 [PATCH 0/2] staging: olpc_dcon: fix sparse warnings and compile errors Murilo Opsfelder Araujo
@ 2015-01-16 1:54 ` Murilo Opsfelder Araujo
2015-01-16 10:20 ` Dan Carpenter
2015-01-16 1:55 ` [PATCH 2/2] staging: olpc_dcon: fix sparse symbol not declared warning Murilo Opsfelder Araujo
1 sibling, 1 reply; 4+ messages in thread
From: Murilo Opsfelder Araujo @ 2015-01-16 1:54 UTC (permalink / raw)
To: linux-kernel
Cc: devel, gregkh, jon.nettleton, dsd, jfrederich,
Murilo Opsfelder Araujo
The following error messages are thrown by sparse when CONFIG_OLPC is
not defined:
drivers/staging/olpc_dcon/olpc_dcon.c:147:17: error: undefined identifier 'olpc_board_at_least'
drivers/staging/olpc_dcon/olpc_dcon.c:208:14: error: undefined identifier 'olpc_board_at_least'
This patch fixes these errors.
Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
---
drivers/staging/olpc_dcon/olpc_dcon.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 6a9a881..3708f1e 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -144,7 +144,9 @@ power_up:
}
if (x < 0) {
pr_err("unable to stabilize dcon's smbus, reasserting power and praying.\n");
+#ifdef CONFIG_OLPC
BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
+#endif
pm = 0;
olpc_ec_cmd(EC_DCON_POWER_MODE, &pm, 1, NULL, 0);
msleep(100);
@@ -205,8 +207,10 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
if (dcon->asleep == sleep)
return;
+#ifdef CONFIG_OLPC
if (!olpc_board_at_least(olpc_board(0xc2)))
return;
+#endif
if (sleep) {
u8 pm = 0;
@@ -795,11 +799,14 @@ struct i2c_driver dcon_driver = {
static int __init olpc_dcon_init(void)
{
+#ifdef CONFIG_OLPC
#ifdef CONFIG_FB_OLPC_DCON_1_5
/* XO-1.5 */
if (olpc_board_at_least(olpc_board(0xd0)))
pdata = &dcon_pdata_xo_1_5;
#endif
+#endif
+
#ifdef CONFIG_FB_OLPC_DCON_1
if (!pdata)
pdata = &dcon_pdata_xo_1;
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] staging: olpc_dcon: fix sparse symbol not declared warning
2015-01-16 1:54 [PATCH 0/2] staging: olpc_dcon: fix sparse warnings and compile errors Murilo Opsfelder Araujo
2015-01-16 1:54 ` [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least() Murilo Opsfelder Araujo
@ 2015-01-16 1:55 ` Murilo Opsfelder Araujo
1 sibling, 0 replies; 4+ messages in thread
From: Murilo Opsfelder Araujo @ 2015-01-16 1:55 UTC (permalink / raw)
To: linux-kernel
Cc: devel, gregkh, jon.nettleton, dsd, jfrederich,
Murilo Opsfelder Araujo
This patch gets rid of the following sparse warning:
drivers/staging/olpc_dcon/olpc_dcon.c:787:19: warning: symbol 'dcon_driver' was not declared. Should it be static?
Signed-off-by: Murilo Opsfelder Araujo <mopsfelder@gmail.com>
---
drivers/staging/olpc_dcon/olpc_dcon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 3708f1e..4ec2a9c 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -784,7 +784,7 @@ static const struct i2c_device_id dcon_idtable[] = {
};
MODULE_DEVICE_TABLE(i2c, dcon_idtable);
-struct i2c_driver dcon_driver = {
+static struct i2c_driver dcon_driver = {
.driver = {
.name = "olpc_dcon",
.pm = &dcon_pm_ops,
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least()
2015-01-16 1:54 ` [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least() Murilo Opsfelder Araujo
@ 2015-01-16 10:20 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-01-16 10:20 UTC (permalink / raw)
To: Murilo Opsfelder Araujo
Cc: linux-kernel, devel, dsd, jfrederich, gregkh, jon.nettleton
On Thu, Jan 15, 2015 at 11:54:59PM -0200, Murilo Opsfelder Araujo wrote:
> The following error messages are thrown by sparse when CONFIG_OLPC is
> not defined:
>
> drivers/staging/olpc_dcon/olpc_dcon.c:147:17: error: undefined identifier 'olpc_board_at_least'
> drivers/staging/olpc_dcon/olpc_dcon.c:208:14: error: undefined identifier 'olpc_board_at_least'
>
> This patch fixes these errors.
Don't add ifdefs to a .c file. Don't call BUG_ON() in a driver.
Figure out a better way to fix these.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-16 10:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-16 1:54 [PATCH 0/2] staging: olpc_dcon: fix sparse warnings and compile errors Murilo Opsfelder Araujo
2015-01-16 1:54 ` [PATCH 1/2] staging: olpc_dcon: check for CONFIG_OLPC before calling olpc_board_at_least() Murilo Opsfelder Araujo
2015-01-16 10:20 ` Dan Carpenter
2015-01-16 1:55 ` [PATCH 2/2] staging: olpc_dcon: fix sparse symbol not declared warning Murilo Opsfelder Araujo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.