W dniu 2015-01-14 o 13:08, Fabio Estevam pisze:
From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
There is no need to explicitly zero the 'ret' variable.
Compiler will do this automatically and there is also an assignment of 'ret' a
few lines below.
Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
---
drivers/tty/serial/mxs-auart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index b54b6a2..d1298b6 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1226,7 +1226,7 @@ static int mxs_auart_probe(struct platform_device *pdev)
of_match_device(mxs_auart_dt_ids, &pdev->dev);
struct mxs_auart_port *s;
u32 version;
- int ret = 0, irq;
+ int ret, irq;
As I know compiler does not initialize variable if it is placed on stack
like here.
It is done if BSS section is used (eg. static variable in a function).
Likely you will get also warning about.
If there is an assignment of 'ret' before it is read the patch is OK,
only "automatically assignment"
is wrong in the description.
best regards
Janusz
struct resource *r;
s = devm_kzalloc(&pdev->dev, sizeof(*s), GFP_KERNEL);
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html