J.K. Rowling gives millions of devotees exactly what they’re looking for, every time. So do James Patterson, “Days of Our Lives” and Hormel.

Rowling is frequently classed with Roald Dahl, L. Frank Baum, even Dickens. But her writing is dreary, her jokes terrible, her characterizations mostly one-dimensional (the Dursleys are swine, Slughorn a suckup, Hermione a teacher’s pet, Dumbledore the wise old font of plot exposition). And Harry might be the blandest superhero ever conceived. He simply follows the trail, learns the spells and saves the day. Kids love to be in Harry’s shoes: all zapping bad guys, no taking out the trash.

Compare Luke Skywalker, who has to conquer his own vanity, laziness and anger in order to earn his powers. Harry, like many of his generation, is the Cosseted One from an early age. He’s told that he’s special, that he’s got awesome gifts, that those who don’t understand this are blind to the plain facts. Deploying his powers involves no more character or soul-searching than following a recipe.

The whimsical creations and the narrative pull — making readers beg to know what’s going to happen next — are all Rowling offers. The great kids’ works strike deep, satisfying chords. “The Wizard of Oz” would be just a Technicolor fun ride without Dorothy’s discovery that everything she always wanted was right there at home. “Willy Wonka” isn’t just a funny freak-out. It’s also a near-biblical catalog of sinners and punishment. The Potter tales are built on nothing. Inside them is a deathly hollow.

Is there any children’s writer more dismissive of morals? A Rowling kid starts learning at an early age that principles are adjustable depending on convenience.

Rowling ignores ethics to the point of encouraging dishonorable behavior. Harry spends “Harry Potter and the Half-Blood Prince” — the film version of which is raking it in this weekend — cheating out of a textbook that has all the answers written in the margins, causing him to fraudulently win a luck potion that he uses to solve the central mystery. And his punishment for this is . . . nothing. Harry’s taking advantage of the annotated textbook is depicted as simple resourcefulness, and Hermione’s protests seem mere whining. Rowling’s readers will conclude it’s OK to go on eBay and buy a teacher’s edition of a textbook.

Consider the worst line in “Star Wars,” the one at which even guys who went to their prom dressed as Han Solo laugh derisively: “But I was going into Tashi Station to pick up some power converters!” Rowling’s baby beach reads are thick with such gummy technobabble. She piles on the silly names, magic incantations, “dark revelations” that aren’t dark, and a daytime-television litany of explanation and repetition: “Neville and Professor Flitwick are both hurt, but Madame Pomfrey says they’ll be all right. And a Death Eater’s dead, he got hit by a Killing Curse that huge blond one was firing off everywhere — Harry, if we hadn’t had your Felix potion, I think we’d all have been killed.” Petrificus totalus on all that exposition, please.

There is one funny satirical gag in “Harry Potter and the Half-Blood Prince” — which doesn’t arrive until p. 634. The French chick Fleur announces she’s found a bright side to her boyfriend turning part werewolf: Now he likes “very rare steaks.” “Eet ees lucky ‘e is marrying me,” Fleur says. (Hagrid’s pidgin is even more unbearable, by the way). “Because ze British overcook their meat, I ‘ave always said this.” Nice: The fantasy mirror is reflecting reality.

Dickens is not without his flaws — sentimentality, plot contrivance. “Martin Chuzzlewit” could do with a wee trim of about 250 pages. As for “Edwin Drood” — what’s the deal with that abrupt ending?

Yet when Dickens’ writing wasn’t grandiose, it was frequently touching, beautiful or funny. His characterizations were amazingly deft and enduring, his endings frequently devastating as they unveiled not just plot twists but revolutions of the soul.

“Gulliver’s Travels” and the “Alice in Wonderland” books are comedic sociopolitical satires. “Winnie the Pooh” has been used as a teaching aid to introduce Nietzsche, Descartes and Taoism. Superman (born in 1938, as Nazis marched) meant truth, justice and the American way.

Rowling, sensing that her readers would think her corny or un-PC if she (for instance) dared to make Harry stand for the transcendent appeal of British civilization and culture, is no more interested in principles or resonance than “Desperate Housewives” is. If the Potter books are about nothing except childish good vs. childish evil (and they are), then they amount to a cosmic quidditch match. There’s not a lot of suspense about who will win, why they should, or what it all means. All the pleasure for the reader is in the how — the vacuous, disposable, inconsequential how.

Kyle.Smith@nypost.com