Page MenuHomeFreeBSD

ministat: Simplify DumpPlot
Needs ReviewPublic

Authored by 0mp on Nov 12 2025, 3:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 2, 4:18 PM
Unknown Object (File)
Sun, Sep 27, 3:41 AM
Unknown Object (File)
Sun, Sep 27, 3:26 AM
Unknown Object (File)
Thu, Sep 24, 3:39 AM
Unknown Object (File)
Sep 6 2026, 10:43 AM
Unknown Object (File)
Sep 5 2026, 2:49 PM
Unknown Object (File)
Sep 5 2026, 12:50 PM
Unknown Object (File)
Sep 5 2026, 8:00 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.