Lines Matching refs:poly

113 	struct gf_poly poly;
342 static inline int deg(unsigned int poly)
345 return fls(poly)-1;
409 uint32_t poly;
422 poly = *ecc++;
424 while (poly) {
425 i = deg(poly);
429 poly ^= (1 << i);
612 static int find_poly_deg1_roots(struct bch_control *bch, struct gf_poly *poly,
617 if (poly->c[0])
618 /* poly[X] = bX+c with c!=0, root=c/b */
619 roots[n++] = mod_s(bch, GF_N(bch)-bch->a_log_tab[poly->c[0]]+
620 bch->a_log_tab[poly->c[1]]);
627 static int find_poly_deg2_roots(struct bch_control *bch, struct gf_poly *poly,
633 if (poly->c[0] && poly->c[1]) {
635 l0 = bch->a_log_tab[poly->c[0]];
636 l1 = bch->a_log_tab[poly->c[1]];
637 l2 = bch->a_log_tab[poly->c[2]];
669 static int find_poly_deg3_roots(struct bch_control *bch, struct gf_poly *poly,
675 if (poly->c[0]) {
677 e3 = poly->c[3];
678 c2 = gf_div(bch, poly->c[0], e3);
679 b2 = gf_div(bch, poly->c[1], e3);
680 a2 = gf_div(bch, poly->c[2], e3);
702 static int find_poly_deg4_roots(struct bch_control *bch, struct gf_poly *poly,
708 if (poly->c[0] == 0)
712 e4 = poly->c[4];
713 d = gf_div(bch, poly->c[0], e4);
714 c = gf_div(bch, poly->c[1], e4);
715 b = gf_div(bch, poly->c[2], e4);
716 a = gf_div(bch, poly->c[3], e4);
930 *h = &((struct gf_poly_deg1 *)f)[gcd->deg].poly;
942 struct gf_poly *poly, unsigned int *roots)
947 switch (poly->deg) {
950 cnt = find_poly_deg1_roots(bch, poly, roots);
953 cnt = find_poly_deg2_roots(bch, poly, roots);
956 cnt = find_poly_deg3_roots(bch, poly, roots);
959 cnt = find_poly_deg4_roots(bch, poly, roots);
964 if (poly->deg && (k <= GF_M(bch))) {
965 factor_polynomial(bch, k, poly, &f1, &f2);
1120 static int build_gf_tables(struct bch_control *bch, unsigned int poly)
1123 const unsigned int k = 1 << deg(poly);
1137 x ^= poly;