Skip to contentSkip to conversation

mtd: mchp48l640: silence some uninitialized variable warnings

PATCH Applied Dan Carpenter 5 participants 6 messages Jun 18, 2021 – Jul 15, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: mchp48l640: silence some uninitialized variable warnings

Smatch complains that zero length read/writes will lead to an uninitalized return value. I don't know if that's possible, but it's nicer to return a zero literal anyway so let's do that.

Fixes 88d125026753 ("mtd: devices: add support for microchip 48l640 EERAM")

---
People, when we add a new driver can we make sure the first commit uses the new prefered subsystem prefix? For example,

"mtd: mchp48l640: add support for microchip 48l640 EERAM"

      ^^^^^^^^^^

Otherwise it's not clear to me what I should use as a patch prefix.

 drivers/mtd/devices/mchp48l640.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/devices/mchp48l640.c +2 -2
index efc2003bd13a..ad66b5aaf4e9 100644
@@ -229,7 +229,7 @@ static int mchp48l640_write(struct mtd_info *mtd, loff_t to, size_t len,
 		woff += ws;
 	}
 
-	return ret;
+	return 0;
 }
 
 static int mchp48l640_read_page(struct mtd_info *mtd, loff_t from, size_t len,
@@ -286,7 +286,7 @@ static int mchp48l640_read(struct mtd_info *mtd, loff_t from, size_t len,
 		woff += ws;
 	}
 
-	return ret;
+	return 0;
 };
 
 static const struct mchp48_caps mchp48l640_caps = {
Signature · 1 line
2.30.2
#1 lore raw

Hello Dan,

Quoted 6 lines · Dan Carpenter

Smatch complains that zero length read/writes will lead to an uninitalized return value. I don't know if that's possible, but it's nicer to return a zero literal anyway so let's do that.

Fixes 88d125026753 ("mtd: devices: add support for microchip 48l640 EERAM")
Quoted 7 lines

---
People, when we add a new driver can we make sure the first commit uses the new prefered subsystem prefix? For example,

"mtd: mchp48l640: add support for microchip 48l640 EERAM"

      ^^^^^^^^^^

Otherwise it's not clear to me what I should use as a patch prefix.

Ok, sorry...

Hmm... Colin already sent a fix for this, see:

https://lists.infradead.org/pipermail/linux-mtd/2021-June/087140.html

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
Reviewed-by
#2 lore raw
Quoted 18 lines · Heiko Schocher

Hello Dan,

Quoted 6 lines · Dan Carpenter

Smatch complains that zero length read/writes will lead to an uninitalized return value. I don't know if that's possible, but it's nicer to return a zero literal anyway so let's do that.

Fixes 88d125026753 ("mtd: devices: add support for microchip 48l640 EERAM")
Quoted 7 lines

---
People, when we add a new driver can we make sure the first commit uses the new prefered subsystem prefix? For example,

"mtd: mchp48l640: add support for microchip 48l640 EERAM"

      ^^^^^^^^^^

Otherwise it's not clear to me what I should use as a patch prefix.

Quoted 5 lines

Ok, sorry...

Hmm... Colin already sent a fix for this, see:

https://lists.infradead.org/pipermail/linux-mtd/2021-June/087140.html

Yes, both patches work, but I think Dan's solution is a bit clearer, so:

Thanks

#3 lore raw
Quoted 23 lines · Fabio Estevam
Quoted 22 lines · Heiko Schocher

Hello Dan,

Quoted 6 lines · Dan Carpenter

Smatch complains that zero length read/writes will lead to an uninitalized return value. I don't know if that's possible, but it's nicer to return a zero literal anyway so let's do that.

Fixes 88d125026753 ("mtd: devices: add support for microchip 48l640 EERAM")
Quoted 7 lines

---
People, when we add a new driver can we make sure the first commit uses the new prefered subsystem prefix? For example,

"mtd: mchp48l640: add support for microchip 48l640 EERAM"

      ^^^^^^^^^^

Otherwise it's not clear to me what I should use as a patch prefix.

Ok, sorry...

Hmm... Colin already sent a fix for this, see:

Quoted 8 lines
Quoted 1 line

https://lists.infradead.org/pipermail/linux-mtd/2021-June/087140.html

Yes, both patches work, but I think Dan's solution is a bit clearer, so:

Thanks

Yep, I'm good with that.

Reviewed-by
#4 lore raw

Hello Colin, Dan,

Quoted 26 lines · Colin Ian King
Quoted 25 lines · Fabio Estevam
Quoted 23 lines · Heiko Schocher

Hello Dan,

Quoted 6 lines · Dan Carpenter

Smatch complains that zero length read/writes will lead to an uninitalized return value. I don't know if that's possible, but it's nicer to return a zero literal anyway so let's do that.

Fixes 88d125026753 ("mtd: devices: add support for microchip 48l640 EERAM")
Quoted 7 lines

---
People, when we add a new driver can we make sure the first commit uses the new prefered subsystem prefix? For example,

"mtd: mchp48l640: add support for microchip 48l640 EERAM"

      ^^^^^^^^^^

Otherwise it's not clear to me what I should use as a patch prefix.

Ok, sorry...

Hmm... Colin already sent a fix for this, see:

https://lists.infradead.org/pipermail/linux-mtd/2021-June/087140.html

Quoted 7 lines
Quoted 6 lines

Yes, both patches work, but I think Dan's solution is a bit clearer, so:

Thanks

Yep, I'm good with that.

+1

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: [email protected]
maintainer Applied
#5 lore raw
In reply to Dan Carpenter
Quoted 8 lines · Dan Carpenter

Smatch complains that zero length read/writes will lead to an uninitalized return value. I don't know if that's possible, but it's nicer to return a zero literal anyway so let's do that.

Fixes 88d125026753 ("mtd: devices: add support for microchip 48l640 EERAM")

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.

Miquel