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, Jan 2, 6:32 PM
Unknown Object (File)
Tue, Dec 30, 2:19 AM
Unknown Object (File)
Sun, Dec 28, 5:25 AM
Unknown Object (File)
Dec 1 2025, 9:18 AM
Unknown Object (File)
Nov 30 2025, 7:13 AM
Unknown Object (File)
Nov 28 2025, 2:29 PM
Unknown Object (File)
Nov 27 2025, 1:18 AM
Unknown Object (File)
Nov 27 2025, 12:04 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.