> > I thus suggest that we change > > printk(KERN_INFO "%s: " __func__ " - blabla ", zr->name); > > to > > printk(KERN_INFO "%s: %s - blabla ", zr->name, __func__ ); > > which would work for both gcc-2.95 and gcc-3.2, and be in accordance > > with the C99 standard. > > Sounds good, let's do that. Are you gonna send up a patch or should I > make up something myself? If me, then that'll be next week, I won't be > home this weekend. If __func__ doesn't work (compiler screams about > undefined thing), I'll use __FUNCTION__ instead - that always works.
Here's a patch which uses __func__ along with %s in the printk's. The debug output in vpx3220.c should probably be rewritten, but as I'm not sure yet which of vpx3220.c and vpx32xx.c will be kept, I won't do it for now :-) The patch compiles fine with gcc-2.95, someone should test it with gcc-3. Laurent Pinchart
diff -u -r1.1.2.6 vpx3220.c --- vpx3220.c 27 Dec 2002 15:26:04 -0000 1.1.2.6 +++ vpx3220.c 12 Jan 2003 21:38:50 -0000 @@ -77,7 +77,7 @@ { /* Write the 16-bit address to the FPWR register */ if (i2c_smbus_write_word_data(client, 0x27, swab16(fpaddr)) == -1) { - DEBUG(printk(VPX3220_DEBUG __func__": failed\n")); + DEBUG(printk(VPX3220_DEBUG "%s: failed\n", __func__)); return -1; } @@ -86,7 +86,7 @@ /* Write the 16-bit data to the FPDAT register */ if (i2c_smbus_write_word_data(client, 0x28, swab16(data)) == -1) { - DEBUG(printk(VPX3220_DEBUG __func__": failed\n")); + DEBUG(printk(VPX3220_DEBUG "%s: failed\n", __func__)); return -1; } @@ -99,7 +99,7 @@ /* Write the 16-bit address to the FPRD register */ if (i2c_smbus_write_word_data(client, 0x26, swab16(fpaddr)) == -1) { - DEBUG(printk(VPX3220_DEBUG __func__": failed\n")); + DEBUG(printk(VPX3220_DEBUG "%s: failed\n", __func__)); return -1; } @@ -109,7 +109,7 @@ /* Read the 16-bit data from the FPDAT register */ data = i2c_smbus_read_word_data(client, 0x28); if (data == -1) { - DEBUG(printk(VPX3220_DEBUG __func__": failed\n")); + DEBUG(printk(VPX3220_DEBUG "%s: failed\n", __func__)); return -1; } @@ -452,7 +452,7 @@ int err; struct i2c_client *client; - DEBUG(printk(VPX3220_DEBUG __func__"\n")); + DEBUG(printk(VPX3220_DEBUG "%s\n", __func__)); /* Check if the adapter supports the needed features */ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | @@ -477,7 +477,7 @@ id = vpx3220_read(client, 0x00); if (id != 0xec) { - printk(KERN_INFO "vpx3220_attach: Wrong manufacturer ID (0x%02x)\n", id); + printk(KERN_INFO "%s: Wrong manufacturer ID (0x%02x)\n", __func__, id); kfree(client); return 0; } @@ -494,7 +494,7 @@ strcpy(client->name, "vpx3214c"); break; default: - printk(KERN_INFO __func__ ": Wrong part number (0x%04x)\n", pn); + printk(KERN_INFO "%s: Wrong part number (0x%04x)\n", __func__, pn); kfree(client); return 0; } @@ -523,7 +523,7 @@ int ret; ret = i2c_probe(adapter, &addr_data, &vpx3220_detect_client); - DEBUG(printk(VPX3220_DEBUG __func__ ": i2c_probe returned %d\n", ret)); + DEBUG(printk(VPX3220_DEBUG "%s: i2c_probe returned %d\n", __func__, ret)); return ret; }