On Fri, 2009-11-13 at 10:07 +0100, Heiko Carstens wrote: > On Mon, Nov 09, 2009 at 01:28:00PM -0800, Joe Perches wrote: > > Typically, strncmp uses the length of the second > > argument as the maximum comparison length. > > Perhaps these strncmp uses should be modified? > > arch/s390/kernel/vdso.c: if (strncmp(s, "on", 3) == 0) > > arch/s390/kernel/vdso.c: else if (strncmp(s, "off", 4) == 0) > > arch/s390/kernel/setup.c: if (strncmp(str, "hwc", 4) == 0 || strncmp(str, "sclp", 5) == 0) > > arch/s390/kernel/setup.c: if (strncmp(str, "3215", 5) == 0) > > arch/s390/kernel/setup.c: if (strncmp(str, "3270", 5) == 0) > Why do you think we have errors in here? Other uses of strncmp in the same file. $ grep strncmp arch/s390/kernel/setup.c if (strncmp(str, "hwc", 4) == 0 || strncmp(str, "sclp", 5) == 0) if (strncmp(str, "3215", 5) == 0) if (strncmp(str, "3270", 5) == 0) if (strncmp(ptr + 8, "3270", 4) == 0) { } else if (strncmp(ptr + 8, "3215", 4) == 0) { if (!strncmp(p, "off", 3)) > The only thing I can see is that the length parameter is superfluous > and that we could have used strcmp instead. If that's what's appropriate, isn't that what should actually be used? -- To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html