Fix typos
cover Fix typos
Fix typos in documentation, comments, etc.
Via codespell.
Feel free to squash / request a more granular per-file commits.
Andrew Kreimer (2):
smatch: fix typos
smatch: fix typos
README | 2 +- cgcc | 2 +- check_host_input.c | 12 ++++++------ check_preempt.c | 2 +- cse.c | 4 ++-- cwchash/hashtable.c | 2 +- evaluate.c | 4 ++-- expand.c | 2 +- flow.c | 4 ++-- lib.c | 2 +- linearize.c | 2 +- opcode.def | 2 +- pre-process.c | 4 ++-- simplify.c | 4 ++-- smatch_annotate.c | 4 ++-- smatch_comparison.c | 2 +- smatch_extra.c | 6 +++--- smatch_implied.c | 2 +- smatch_locking.c | 2 +- smatch_math.c | 2 +- smatch_param_compare_limit.c | 2 +- smatch_parsed_conditions.c | 2 +- smatch_ssa.c | 2 +- smatch_strlen.c | 2 +- smatch_struct_assignment.c | 2 +- unssa.c | 2 +- utils.h | 2 +- validation/bool-array.c | 2 +- 28 files changed, 41 insertions(+), 41 deletions(-)
Signature · 1 line
2.39.5
PATCH 1/2 smatch: fix typos
Fix typos in documentation, comments, etc.
Via codespell.
--- smatch_annotate.c | 4 ++-- smatch_comparison.c | 2 +- smatch_extra.c | 6 +++--- smatch_implied.c | 2 +- smatch_locking.c | 2 +- smatch_math.c | 2 +- smatch_param_compare_limit.c | 2 +- smatch_parsed_conditions.c | 2 +- smatch_ssa.c | 2 +- smatch_strlen.c | 2 +- smatch_struct_assignment.c | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-)
smatch_annotate.c +2 -2
@@ -41,8 +41,8 @@ void register_annotate(int id) {/* * Technically snprintf() returns the number of bytes which *would* have -* been printed. I do try caclulating that in check_snprintf(). But -* it probably works better to assume the limitter is accurate. +* been printed. I do try calculating that in check_snprintf(). But +* it probably works better to assume the limiter is accurate. */ add_implied_return_hook ("snprintf" , ¶m_caps_return,INT_PTR (1 ));
smatch_comparison.c +1 -1
@@ -1185,7 +1185,7 @@ static void handle_for_loops(struct expression *expr, char *state_name, struct sreturn ; } -/* Second time checking the condtion */ +/* Second time checking the condition */ if (__prev_stmt != __cur_stmt->iterator_post_statement)return ;
smatch_extra.c +3 -3
@@ -1327,7 +1327,7 @@ static void clear_pointed_at_state(struct expression *expr)struct symbol *type;/* -* ALERT: This is sort of a mess. If it's is a struct assigment like +* ALERT: This is sort of a mess. If it's is a struct assignment like * "foo = bar;", then that's handled by smatch_struct_assignment.c. * the same thing for p++ where "p" is a struct. Most modifications * are handled by the assignment hook or the db. Smatch_extra.c doesn't
@@ -1549,7 +1549,7 @@ static int handle_postop_inc(struct expression *left, int op, struct expression false_state =alloc_estate_range (add_one (limit),add_one (limit));/* Currently we just discard the false state but when two passes is -* implimented correctly then it will use it. +* implemented correctly then it will use it. */ set_extra_expr_true_false (left->unop, true_state, false_state);
@@ -2544,7 +2544,7 @@ struct range_list *intersect_with_real_abs_var_sym(const char *name, struct symb* with the real absolute to say that actually it's 0-8. * * We are combining it here. But now that I think about it, this is -* probably not the ideal place to combine it because it should proably +* probably not the ideal place to combine it because it should probably * be done earlier. Oh well, this is an improvement on what was there * before so I'm going to commit this code. *
smatch_implied.c +1 -1
@@ -90,7 +90,7 @@ static bool implications_turned_off(int owner)/* * tmp_range_list(): -* It messes things up to free range list allocations. This helper fuction +* It messes things up to free range list allocations. This helper function * lets us reuse memory instead of doing new allocations. */ static struct range_list *tmp_range_list (struct symbol *type,long long num)
smatch_locking.c +1 -1
@@ -755,7 +755,7 @@ static void match_class_destructor(const char *fn, struct expression *expr, void* as well because sometimes it's like the assignment is: * * scope = class_mutex_constructor(®ister_mutex); -* but other times because we do a fake parameter assignement or +* but other times because we do a fake parameter assignment or * something the assignment is more direct: * scope = ®ister_mutex; *
smatch_math.c +1 -1
@@ -339,7 +339,7 @@ static bool handle_container_of(struct expression *expr, int implied, int *recur* p = container_of(foo, struct my_struct, member); * Then if the offset is non-zero we can assume that p is a valid * pointer. Mathematically, that's not necessarily true, but in -* pratical terms if p isn't valid then we're already in deep trouble +* practical terms if p isn't valid then we're already in deep trouble * to the point where printing more warnings now won't help. * * There are places were the author knows that container_of() is a
smatch_param_compare_limit.c +1 -1
@@ -119,7 +119,7 @@ static void add_comparison_limit_var_sym(const char *left_name, }/* -* This is quite a bit more limitted, less ambitious, simpler compared to +* This is quite a bit more limited, less ambitious, simpler compared to * smatch_camparison.c. */ void __compare_param_limit_hook(struct expression *left_expr, struct expression *right_expr,
smatch_parsed_conditions.c +1 -1
@@ -30,7 +30,7 @@* implications. * * So what this module does is it ties the implications to the expression -* pointer so that we can retreive them easily. It's similar to Smatch stored +* pointer so that we can retrieve them easily. It's similar to Smatch stored * implications but it doesn't save condition, it saves the pointer. * * We ignore pre loop conditions which Smatch parses twice.
smatch_ssa.c +1 -1
@@ -151,7 +151,7 @@ static void match_assign(struct expression *expr)if (!orig || orig->state == &undefined) orig =set_state (my_id, right_name, right_sym,alloc_ssa_new (right_name)); -/* This can happen in unreachable code or outside of functions I gess */ +/* This can happen in unreachable code or outside of functions I guess */ if (!orig)return ;
smatch_strlen.c +1 -1
@@ -415,7 +415,7 @@ void register_strlen(int id)add_function_hook ("strcpy" , &match_strcpy,NULL );/* * I would have made strchr only apply for success returns but some -* arches (arm64) impliment strchr outside the kernel so we don't know +* arches (arm64) implement strchr outside the kernel so we don't know * the return values. Having a NULL with a strlen is fine because if * someone uses the NULL then we're already in trouble. */
smatch_struct_assignment.c +1 -1
@@ -50,7 +50,7 @@* p1->x->y. * * I don't have a proper solution for this problem right now. I just copy one -* level and don't nest. It should handle limitted nesting but intelligently. +* level and don't nest. It should handle limited nesting but intelligently. * * The other thing is that you end up with a lot of garbage assignments where * we record "x could be anything. x->y could be anything. x->y->z->a->b->c
Signature · 1 line
2.39.5
PATCH 2/2 smatch: fix typos
In reply to Andrew KreimerFix typos in documentation, comments, etc.
Via codespell.
--- README | 2 +- cgcc | 2 +- check_host_input.c | 12 ++++++------ check_preempt.c | 2 +- cse.c | 4 ++-- cwchash/hashtable.c | 2 +- evaluate.c | 4 ++-- expand.c | 2 +- flow.c | 4 ++-- lib.c | 2 +- linearize.c | 2 +- opcode.def | 2 +- pre-process.c | 4 ++-- simplify.c | 4 ++-- unssa.c | 2 +- utils.h | 2 +- validation/bool-array.c | 2 +- 17 files changed, 27 insertions(+), 27 deletions(-)
README +1 -1
@@ -63,7 +63,7 @@ more requirements. The user is free to do whatever he wants with the parse tree that got built up, and needs not worry about the library ever again. There is no extra state, there are no parser callbacks, there is only the parse tree that is described by the header files. The action -funtion takes a pointer to a symbol_list and does whatever it likes with it. +function takes a pointer to a symbol_list and does whatever it likes with it. The library also contains (as an example user) a few clients that do the preprocessing, parsing and type evaluation and just print out the
cgcc +1 -1
@@ -37,7 +37,7 @@ while (@ARGV) { if (/^-(o|MF|MT|MQ)$/) { # Need to be checked explicitly since otherwise # the argument would be processed as a - # (non-existant) source file or as an option. + # (non-existent) source file or as an option. die ("$0: missing argument for $_") if !@ARGV; $nargs = 1; }
check_host_input.c +6 -6
@@ -7,7 +7,7 @@* sure the code that handles processing of such values is hardened, * free of memory safety issues and other potential security issues. * -* This smatch pattern helps to indentify such places. +* This smatch pattern helps to identify such places. * Currently it covers most of MSR, portIO, MMIO, PCI config space * and cpuid reading primitives. * The full list of covered functions is stored in host_input_funcs array.
@@ -77,9 +77,9 @@ unsigned long produce_expression_hash(struct expression *expr)int line_offset =get_lineno () -get_func_start_lineno (get_function ());const char *str =expr_to_str (expr); -/* for non-parsable exressions and expressions -* contatining temp variables (like __UNIQUE_ID_*, $expr_), it is -* more stable to use a fix string for hasing together +/* for non-parsable expressions and expressions +* containing temp variables (like __UNIQUE_ID_*, $expr_), it is +* more stable to use a fix string for hashing together * with line offset to avoid many results that do not * automatically transfer between the audits on different * versions */
@@ -196,7 +196,7 @@ bool is_tmp_expression(struct expression *expr)return false; } -/* Checks assigment expressions */ +/* Checks assignment expressions */ static void match_assign (struct expression *expr) {struct expression *current = expr;
@@ -213,7 +213,7 @@ static void match_assign(struct expression *expr)return ;if (current->type !=EXPR_ASSIGNMENT ) { -sm_error ("'%s' Strange EXPR in assigment;" , pattern_name); +sm_error ("'%s' Strange EXPR in assignment;" , pattern_name);return ; }
check_preempt.c +1 -1
@@ -31,7 +31,7 @@* If during the course of parsing the call, the preempt count gets out of * sync on one side of a branch statement, then we assume the lower preempt * count is correct. (In other words, we choose to miss some bugs rather -* than add false postives). +* than add false positives). */ #include "smatch.h"
cse.c +2 -2
@@ -246,11 +246,11 @@ static int insn_compare(const void *_i1, const void *_i2)if (i1->src != i2->src)return i1->src < i2->src ?-1 :1 ; -// Note: if it can be guaranted that identical ->src +// Note: if it can be guaranteed that identical ->src // implies identical orig_type->bit_size, then this // test and the hashing of the original size in // cse_collect() are not needed. -// It must be generaly true but it isn't guaranted (yet). +// It must be generally true but it isn't guaranteed (yet). size1 = i1->orig_type->bit_size; size2 = i2->orig_type->bit_size;if (size1 != size2)
cwchash/hashtable.c +1 -1
@@ -70,7 +70,7 @@ hash(struct hashtable *h, void *k)static int hashtable_expand (struct hashtable *h) { -/* Double the size of the table to accomodate more entries */ +/* Double the size of the table to accommodate more entries */ struct entry **newtable;struct entry *e;struct entry **pE;
evaluate.c +2 -2
@@ -583,7 +583,7 @@ static struct symbol *evaluate_ptr_add(struct expression *expr, struct symbol *ireturn NULL ; }if (is_function (base)) { -expression_error (expr,"arithmetics on pointers to functions" ); +expression_error (expr,"arithmetic on pointers to functions" );return NULL ; }
@@ -1166,7 +1166,7 @@ static struct symbol *evaluate_conditional_expression(struct expression *expr)* Consider a conditional expression with a constant condition * as having the same constantness as the argument corresponding * to the truth value (including in the case of address constants -* which are defined more stricly [6.6(9)]). +* which are defined more strictly [6.6(9)]). */ if (expr->conditional->flags & (CEF_ACE |CEF_ADDR )) {int is_true =expr_truth_value (expr->conditional);
expand.c +1 -1
@@ -608,7 +608,7 @@ static int expand_addressof(struct expression *expr) }/// -// lookup the type of a struct's memeber at the requested offset +// lookup the type of a struct's member at the requested offset static struct symbol *find_member (struct symbol *sym,int offset) {struct ptr_list *head, *list;
flow.c +2 -2
@@ -484,7 +484,7 @@ int dominates(struct instruction *insn, struct instruction *dom, int local)// * the stores are only needed by others functions which would do some // loads via the escaped address // We start by the terminating BB (normal exit BB + no-return/unreachable) -// We walkup the BB' intruction backward +// We walkup the BB' instruction backward // * we're only concerned by loads, stores & calls // * if we reach a call -> we have to stop if var is non-local // * if we reach a load of our var -> we have to stop
@@ -815,7 +815,7 @@ int convert_to_jump(struct instruction *insn, struct basic_block *target) FOR_EACH_PTR(bb->children, child) {if (child == target) { - target =NULL ;// leave first occurence + target =NULL ;// leave first occurrence continue ; }DELETE_CURRENT_PTR (child);
lib.c +1 -1
@@ -444,7 +444,7 @@ struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list* Evaluate the complete symbol list * Note: This is not needed for normal cases. * These symbols should only be predefined defines and -* declaratons which will be evaluated later, when needed. +* declarations which will be evaluated later, when needed. * This is also the case when a file is directly included via * '-include <file>' on the command line *AND* the file only * contains defines, declarations and inline definitions.
linearize.c +1 -1
@@ -1969,7 +1969,7 @@ static pseudo_t linearize_one_symbol(struct entrypoint *ep, struct symbol *sym)// FIXME: this init the whole aggregate while // only the existing fields need to be initialized. // FIXME: this init the whole aggregate even if -// all fields arelater explicitely initialized. +// all fields are later explicitly initialized. ad.type = sym; ad.address =symbol_pseudo (ep, sym);linearize_store_gen (ep,value_pseudo (0 ), &ad);
opcode.def +1 -1
@@ -1,4 +1,4 @@ -// OPCODE negated swaped sign float arity, flags +// OPCODE negated swapped sign float arity, flags OPCODE(BADOP, BADOP, BADOP, BADOP, BADOP, 0, OPF_NONE)
pre-process.c +2 -2
@@ -1536,7 +1536,7 @@ out:// @weak: 0/1 for a normal or a weak define // @fmt: the printf format followed by it's arguments. // -// The type of the value is automatically infered: +// The type of the value is automatically inferred: // TOKEN_NUMBER if it starts by a digit, TOKEN_IDENT otherwise. // If @fmt is null or empty, the macro is defined with an empty definition. void predefine (const char *name,int weak,const char *fmt, ...)
@@ -1930,7 +1930,7 @@ static inline void update_inc_ptrs(const char ***where) }/* angle_includepath is actually never updated, since we -* don't suppport -iquote rught now. May change some day. */ +* don't support -iquote rught now. May change some day. */ if (*where <= angle_includepath) { angle_includepath++;if (where == &angle_includepath)
simplify.c +2 -2
@@ -10,7 +10,7 @@// // Notation // ^^^^^^^^ -// The following conventions are used to describe the simplications: +// The following conventions are used to describe the simplifications: // * Uppercase letters are reserved for constants: // * `M` for a constant mask, // * `S` for a constant shift,
@@ -31,7 +31,7 @@// * `ZEXT(x, N)` is used for a zero-extension *from* a size of `N` bits // * `OP(x, C)` is used to represent some generic operation using a constant, // including when the constant is implicit (e.g. `TRUNC(x, N)`). -// * `MASK(x, M)` is used to respresent a 'masking' instruction: +// * `MASK(x, M)` is used to represent a 'masking' instruction: // - `AND(x, M)` // - `LSR(x, S)`, with `M` = (-1 << S) // - `SHL(x, S)`, with `M` = (-1 >> S)
unssa.c +1 -1
@@ -11,7 +11,7 @@* This is similar to the "Sreedhar method I" except that the copies to the * temporaries are not placed at the end of the predecessor basic blocks, but * at the place where the phi-node operands are defined. -* This is particulary easy since these copies are essentialy already present +* This is particularly easy since these copies are essentially already present * as the corresponding OP_PHISOURCE. * * While very simple this method create a lot more copies that really necessary.
utils.h +1 -1
@@ -9,7 +9,7 @@#include <stdarg.h> /// -// return the value coresponding to an hexadecimal digit +// return the value corresponding to an hexadecimal digit unsigned int hexval (unsigned int c);///
validation/bool-array.c +1 -1
@@ -19,7 +19,7 @@ static int nl2 = sizeof(longarray_u2);* Used to get "warning: excessive elements in array initializer" * for all elements but the first one. * Note: only occurs if nbr of elements is a multiple of 8 -* (if not, theer was another problem) +* (if not, there was another problem) */ static _Bool boolarray_u8[] = {0 ,
Signature · 1 line
2.39.5
Re: [PATCH 2/2] smatch: fix typos
Quoted 16 lines · Andrew Kreimer
Fix typos in documentation, comments, etc.
Via codespell.
Signed-off-by Andrew Kreimer <[email protected]>--- README | 2 +- cgcc | 2 +- check_host_input.c | 12 ++++++------ check_preempt.c | 2 +- cse.c | 4 ++-- cwchash/hashtable.c | 2 +- evaluate.c | 4 ++-- expand.c | 2 +- flow.c | 4 ++-- lib.c | 2 +-
Quoted 8 lines
linearize.c | 2 +- opcode.def | 2 +- pre-process.c | 4 ++-- simplify.c | 4 ++-- unssa.c | 2 +- utils.h | 2 +- validation/bool-array.c | 2 +- 17 files changed, 27 insertions(+), 27 deletions(-)
Thanks, Andrew.
I've merged patch 1 but it's a tricky thing to merge patch 2. Most of these files come from Sparse and not Smatch. Smatch files basically start with smatch_, check_ or validation/sm_. So these changes should be sent to [email protected]. There are two problems with me merging this:
1) The license for Sparse is MIT and the license for Smatch is GPLv2+. Merging spelling fixes doesn't really count in terms of copyrights, but I don't want to deal with that. I'd prefer if it we not mix code with different licenses and the Sparse code was sent to the Sparse list.
2) When I merge updated code from Sparse it causes conflicts because they will have the wrong spellings and I'll have to fix it up by hand.
regards,
dan carpenter
Re: [PATCH 2/2] smatch: fix typos
Quoted 12 lines · Dan Carpenter
Thanks, Andrew.
I've merged patch 1 but it's a tricky thing to merge patch 2. Most of these files come from Sparse and not Smatch. Smatch files basically start with
smatch_,check_or validation/sm_. So these changes should be sent to [email protected]. There are two problems with me merging this:1) The license for Sparse is MIT and the license for Smatch is GPLv2+. Merging spelling fixes doesn't really count in terms of copyrights, but I don't want to deal with that. I'd prefer if it we not mix code with different licenses and the Sparse code was sent to the Sparse list.
Quoted 6 lines
2) When I merge updated code from Sparse it causes conflicts because they will have the wrong spellings and I'll have to fix it up by hand.
regards,
dan carpenter
Understood, thank you!