| .. | .. |
|---|
| 11 | 11 | |
|---|
| 12 | 12 | int _braille_console_setup(char **str, char **brl_options) |
|---|
| 13 | 13 | { |
|---|
| 14 | | - if (!strncmp(*str, "brl,", 4)) { |
|---|
| 14 | + size_t len; |
|---|
| 15 | + |
|---|
| 16 | + len = str_has_prefix(*str, "brl,"); |
|---|
| 17 | + if (len) { |
|---|
| 15 | 18 | *brl_options = ""; |
|---|
| 16 | | - *str += 4; |
|---|
| 17 | | - } else if (!strncmp(*str, "brl=", 4)) { |
|---|
| 18 | | - *brl_options = *str + 4; |
|---|
| 19 | + *str += len; |
|---|
| 20 | + return 0; |
|---|
| 21 | + } |
|---|
| 22 | + |
|---|
| 23 | + len = str_has_prefix(*str, "brl="); |
|---|
| 24 | + if (len) { |
|---|
| 25 | + *brl_options = *str + len; |
|---|
| 19 | 26 | *str = strchr(*brl_options, ','); |
|---|
| 20 | 27 | if (!*str) { |
|---|
| 21 | 28 | pr_err("need port name after brl=\n"); |
|---|