Author: markj
Date: Tue Aug 27 15:42:08 2019
New Revision: 351549
URL: https://svnweb.freebsd.org/changeset/base/351549

Log:
  Remove an extraneous + 1 in _domainset_create().
  
  DOMAINSET_FLS, like our fls(), is 1-indexed.
  
  Reported by:  alc
  MFC after:    1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c Tue Aug 27 15:34:37 2019        (r351548)
+++ head/sys/kern/kern_cpuset.c Tue Aug 27 15:42:08 2019        (r351549)
@@ -457,7 +457,7 @@ static struct domainset *
 _domainset_create(struct domainset *domain, struct domainlist *freelist)
 {
        struct domainset *ndomain;
-       int i, j, max;
+       int i, j;
 
        KASSERT(domain->ds_cnt <= vm_ndomains,
            ("invalid domain count in domainset %p", domain));
@@ -476,8 +476,7 @@ _domainset_create(struct domainset *domain, struct dom
        if (ndomain == NULL) {
                LIST_INSERT_HEAD(&cpuset_domains, domain, ds_link);
                domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask);
-               max = DOMAINSET_FLS(&domain->ds_mask) + 1;
-               for (i = 0, j = 0; i < max; i++)
+               for (i = 0, j = 0; i < DOMAINSET_FLS(&domain->ds_mask); i++)
                        if (DOMAINSET_ISSET(i, &domain->ds_mask))
                                domain->ds_order[j++] = i;
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to