Merge tag 'driver-core-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / include / linux / cpumask.h
index 5d4d07a9e1ed15e67c249cc402ba1908ef412b06..1e7399fc69c0a1e5304b892bb8accc15567cdfd3 100644 (file)
@@ -996,14 +996,15 @@ cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
  * cpumask; Typically used by bin_attribute to export cpumask bitmask
  * ABI.
  *
- * Returns the length of how many bytes have been copied.
+ * Returns the length of how many bytes have been copied, excluding
+ * terminating '\0'.
  */
 static inline ssize_t
 cpumap_print_bitmask_to_buf(char *buf, const struct cpumask *mask,
                loff_t off, size_t count)
 {
        return bitmap_print_bitmask_to_buf(buf, cpumask_bits(mask),
-                                  nr_cpu_ids, off, count);
+                                  nr_cpu_ids, off, count) - 1;
 }
 
 /**
@@ -1018,7 +1019,7 @@ cpumap_print_list_to_buf(char *buf, const struct cpumask *mask,
                loff_t off, size_t count)
 {
        return bitmap_print_list_to_buf(buf, cpumask_bits(mask),
-                                  nr_cpu_ids, off, count);
+                                  nr_cpu_ids, off, count) - 1;
 }
 
 #if NR_CPUS <= BITS_PER_LONG