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, Aug 9, 3:26 AM
Unknown Object (File)
Sat, Aug 8, 2:26 PM
Unknown Object (File)
Sat, Aug 8, 9:57 AM
Unknown Object (File)
Sat, Aug 8, 5:06 AM
Unknown Object (File)
Wed, Aug 5, 8:23 AM
Unknown Object (File)
Wed, Aug 5, 7:44 AM
Unknown Object (File)
Tue, Aug 4, 9:06 AM
Unknown Object (File)
Sat, Aug 1, 8:44 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.