Re: [PATCH 7/6] ipc/sem.c: add a printk_once for semctl(GETNCNT/GETZCNT)

From: Manfred Spraul
Date: Sun May 25 2014 - 15:42:13 EST


Hi Joe,

On 05/25/2014 08:39 PM, Joe Perches wrote:
On Sun, 2014-05-25 at 20:21 +0200, Manfred Spraul wrote:
+ */
+ printk_once(KERN_INFO "semctl(GETNCNT/GETZCNT) is since 3.16 Single " \
+ "Unix Specification compliant.\n" \
+ "The task %d triggered the difference, " \
+ "watch for misbehavior.", current->pid);
Unnecessary line continuations.
Missing terminating newline after "misbehavior"
Ideally coalesced or broken at linebreaks like:

pr_info_once("semctl(GETNCNT/GETZCNT) is Single Unix Specification compliant since kernel v3.16\n"
"Task %d triggered the difference, watch for misbehavior\n",
current->pid);
Thanks. I'll try to remember to really run checkpatch instead of assuming what it might report.
if (sop->sem_num != semnum)
return 0;
Should the printk_once (which could be pr_info_once or _ratelimited
or maybe even emitted at KERN_DEBUG) be done only when
the return is 1?

To fully check if there is a difference would mean that the old code and the new code run in parallel.

The code might trigger slightly too often, but since there are zero known users of GETZCNT / GETNCNT simplicity wins.

--
Manfred
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/