@@ -4375,24 +4375,6 @@ static void nand_set_defaults(struct nand_chip *chip)
chip->buf_align = 1;
}
-/* Sanitize ONFI strings so we can safely print them */
-void sanitize_string(uint8_t *s, size_t len)
-{
- ssize_t i;
-
- /* Null terminate */
- s[len - 1] = 0;
-
- /* Remove non printable chars */
- for (i = 0; i < len - 1; i++) {
- if (s[i] < ' ' || s[i] > 127)
- s[i] = '?';
- }
-
- /* Remove trailing spaces */
- strim(s);
-}
-
/*
* nand_id_has_period - Check if an ID string has a given wraparound period
* @id_data: the ID string
@@ -135,6 +135,24 @@ void nand_bit_wise_majority(const void **srcbufs,
}
}
+/* Sanitize ONFI strings so we can safely print them */
+void sanitize_string(u8 *s, size_t len)
+{
+ ssize_t i;
+
+ /* Null terminate */
+ s[len - 1] = 0;
+
+ /* Remove non printable chars */
+ for (i = 0; i < len - 1; i++) {
+ if (s[i] < ' ' || s[i] > 127)
+ s[i] = '?';
+ }
+
+ /* Remove trailing spaces */
+ strim(s);
+}
+
/*
* Check if the NAND chip is ONFI compliant, returns 1 if it is, 0 otherwise.
*/
sanitize_strings is not used in nand_base.c but used in nand_onfi.c. It is better to move sanitize_strings definition to nand_onfi.c, with this all ONFI related functions will be in the same file. Signed-off-by: Shivamurthy Shastri <sshivamurthy@micron.com> --- drivers/mtd/nand/raw/nand_base.c | 18 ------------------ drivers/mtd/nand/raw/nand_onfi.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-)