Page MenuHomeFreeBSD

ses: cleanup ses tests
ClosedPublic

Authored by asomers on Jan 19 2022, 9:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 5:07 AM
Unknown Object (File)
Fri, Apr 12, 3:09 AM
Unknown Object (File)
Thu, Apr 11, 11:20 PM
Unknown Object (File)
Jan 19 2024, 3:55 AM
Unknown Object (File)
Dec 23 2023, 11:49 AM
Unknown Object (File)
Dec 22 2023, 4:12 PM
Unknown Object (File)
Oct 15 2023, 9:41 AM
Unknown Object (File)
Oct 15 2023, 9:41 AM
Subscribers

Details

Summary

Address mav's feedback RE eea7c61590ae

Reported by: mav
MFC after: 2 weeks
MFC with: eea7c61590ae8968b3f1f609cf0bc8633222a94f
Sponsored by: Axcient

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tests/sys/ses/nondestructive.c
208

I'm confused. How can you have a PASS device and a NVD device?

tests/sys/ses/nondestructive.c
208

We can't, same as for "nvme", which is a controller, not a device. I've mentioned that in original patch review.

  • nvd and nvme devices are not part of CAM
tests/sys/ses/nondestructive.c
172

It should work but as I've written: "I mean ses_status_common_get_element_status_code() or whatever it becomes after all those macros unrolled..."

  • Use ses_status_common_get_element_status_code
tests/sys/ses/nondestructive.c
172

I've changed it, but the necessity of the cast makes it not really any more type safe than the last version. Perhaps these status fields should be changed into some kind of union in a future revision?

tests/sys/ses/destructive.c
70

One newline is good, but two (before the "{") would be better.

191

elmstat.cstat seems to be mostly uninitialized here except select and ident bits. Why have you read existing state in do_setelmstat(), but not here?

tests/sys/ses/nondestructive.c
172

I was also thinking about this inconvenience. Though the IOCTL interface was written long before those macros.

asomers marked 4 inline comments as done.
  • style
  • Fully initialize elmstat during do_setelmstat_cleanup
tests/sys/ses/destructive.c
188

I'm sorry I've forgot it, but at some point I've implemented special function ses_status_to_ctrl() to convert status bytes into control. The problem is that some bits there should be kept, while others -- cleared, and there is no way to know what is what except hardcoding it.

  • Sanitize element status bits with ses_status_to_ctrl
This revision is now accepted and ready to land.Mar 27 2023, 8:03 PM
This revision was automatically updated to reflect the committed changes.