]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - lib/ts_fsm.c
i2c: taos-evm: Remove duplicate NULL check
[mirror_ubuntu-bionic-kernel.git] / lib / ts_fsm.c
index af575b61526b97749c31bb65221af72eb457353c..69557c74ef9f8e4dbe1994dce8d1099456717cf2 100644 (file)
@@ -11,7 +11,7 @@
  * ==========================================================================
  *
  *   A finite state machine consists of n states (struct ts_fsm_token)
- *   representing the pattern as a finite automation. The data is read
+ *   representing the pattern as a finite automaton. The data is read
  *   sequentially on an octet basis. Every state token specifies the number
  *   of recurrences and the type of value accepted which can be either a
  *   specific character or ctype based set of characters. The available
@@ -257,7 +257,7 @@ found_match:
 }
 
 static struct ts_config *fsm_init(const void *pattern, unsigned int len,
-                                    gfp_t gfp_mask)
+                                   gfp_t gfp_mask, int flags)
 {
        int i, err = -EINVAL;
        struct ts_config *conf;
@@ -269,6 +269,9 @@ static struct ts_config *fsm_init(const void *pattern, unsigned int len,
        if (len  % sizeof(struct ts_fsm_token) || ntokens < 1)
                goto errout;
 
+       if (flags & TS_IGNORECASE)
+               goto errout;
+
        for (i = 0; i < ntokens; i++) {
                struct ts_fsm_token *t = &tokens[i];
 
@@ -284,6 +287,7 @@ static struct ts_config *fsm_init(const void *pattern, unsigned int len,
        if (IS_ERR(conf))
                return conf;
 
+       conf->flags = flags;
        fsm = ts_config_priv(conf);
        fsm->ntokens = ntokens;
        memcpy(fsm->tokens, pattern, len);