Page MenuHomeFreeBSD

ministat: Simplify DumpPlot
Needs ReviewPublic

Authored by 0mp on Nov 12 2025, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 6, 10:43 AM
Unknown Object (File)
Sat, Sep 5, 2:49 PM
Unknown Object (File)
Sat, Sep 5, 12:50 PM
Unknown Object (File)
Sat, Sep 5, 8:00 AM
Unknown Object (File)
Fri, Sep 4, 11:41 PM
Unknown Object (File)
Fri, Sep 4, 7:58 PM
Unknown Object (File)
Fri, Sep 4, 3:17 AM
Unknown Object (File)
Thu, Sep 3, 5:05 AM
Subscribers

Details

Summary

There is no need to handle 0<=k<MAX_DS, as k is always like that in this
code path.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68574
Build 65457: arc lint + arc unit

Event Timeline

0mp requested review of this revision.Nov 12 2025, 3:12 PM

There is no need to handle 0<=k<MAX_DS, as k is always like that in this code path.

How do you know that?

usr.bin/ministat/ministat.c
635

@markj, during command-line argument parsing the program refuses to operate on more datasets than MAX_DS.

Ok, so PlotSet() sets pl->data[j * pl->width + x] |= val where 0<=val<MAX_DS. So your assertion is true, but only because MAX_DS is a power of 2.

I don't really see the value of the change to be honest.