diff options
| author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-07-18 18:09:12 -0400 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-07-31 03:45:51 -0400 |
| commit | 760c435e0f85ed19e48a90d746ce1de2cd02def7 (patch) | |
| tree | db479cbf16f6e056c1427b6cbfa54f50c5c8d06b /include/linux/mtd | |
| parent | d166541e9031daff120cac212f1917eff93c07d3 (diff) | |
mtd: rawnand: make subop helpers return unsigned values
A report from Colin Ian King pointed a CoverityScan issue where error
values on these helpers where not checked in the drivers. These
helpers can error out only in case of a software bug in driver code,
not because of a runtime/hardware error. Hence, let's WARN_ON() in this
case and return 0 which is harmless anyway.
Fixes: 8878b126df76 ("mtd: nand: add ->exec_op() implementation")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/rawnand.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index f60fad29eae6..598d356de83f 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h | |||
| @@ -1007,14 +1007,14 @@ struct nand_subop { | |||
| 1007 | unsigned int last_instr_end_off; | 1007 | unsigned int last_instr_end_off; |
| 1008 | }; | 1008 | }; |
| 1009 | 1009 | ||
| 1010 | int nand_subop_get_addr_start_off(const struct nand_subop *subop, | 1010 | unsigned int nand_subop_get_addr_start_off(const struct nand_subop *subop, |
| 1011 | unsigned int op_id); | 1011 | unsigned int op_id); |
| 1012 | int nand_subop_get_num_addr_cyc(const struct nand_subop *subop, | 1012 | unsigned int nand_subop_get_num_addr_cyc(const struct nand_subop *subop, |
| 1013 | unsigned int op_id); | 1013 | unsigned int op_id); |
| 1014 | int nand_subop_get_data_start_off(const struct nand_subop *subop, | 1014 | unsigned int nand_subop_get_data_start_off(const struct nand_subop *subop, |
| 1015 | unsigned int op_id); | 1015 | unsigned int op_id); |
| 1016 | int nand_subop_get_data_len(const struct nand_subop *subop, | 1016 | unsigned int nand_subop_get_data_len(const struct nand_subop *subop, |
| 1017 | unsigned int op_id); | 1017 | unsigned int op_id); |
| 1018 | 1018 | ||
| 1019 | /** | 1019 | /** |
| 1020 | * struct nand_op_parser_addr_constraints - Constraints for address instructions | 1020 | * struct nand_op_parser_addr_constraints - Constraints for address instructions |
