I wish I could just let it go with "get your work done and nobody cares" but I learned over the years that's too simplistic. There's an expectation that you will work 8 hours. I don't want to micromanage anyone but some people simply will not do anything unless they are being monitored.
So many salaried jobs involve work that is time-sensitive and some that's not. I've had some people that look at "get your work done" as the time-sensitive stuff only. Well, that's not an 8 hour-per-day job every single day. There are times you have to occupy yourself productively with things that aren't on a deadline (clean out old files for example, or learn how to do Excel pivot tables, or maybe offer to help someone else who's overwhelmed at the moment).
I built a good career finding useful things to do if I had all the work caught up. Sometimes the work I was supposed to be doing got delayed getting to me and I had 2-3 days of downtime. I'd ask my manager if it was OK if I went over to Department X or Y and see if I could help with whatever they were struggling with. Nobody ever said a word to me when I needed to head out early or come in late. That wasn't true for everyone.
We had an entire department leisure themselves into unemployment after their new manager featured a "nobody cares, just get the work done" policy. Work from home whenever you felt like it, come in late, leave early, whatever. They would report the work progress based on how much of the money was spent(!). People were fighting to get into that group since it seemed to be a fun-filled environment. Two years later, a new VP came in and looked at the project performance numbers and said we aren't going to be in this business area any more. It could have been saved with the right management but the new VP wasn't going to spend the effort to understand the problem. Three people in the group were kept and moved to other departments, the other 12 got the axe.
I tell people to enjoy the flexibility on work hours if it's available but be sure you're letting your manager know what you're getting done. Chances are your co-workers aren't, and that will boost your stock price. And keep an eye on how the higher-ups feel about your group's performance. If it's poor, think about making a move even if people are getting away with working 10 hours a week while getting paid for 40.