lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 14 Dec 2011 18:45:47 -0800
From:	Joe Perches <joe@...ches.com>
To:	Valdis.Kletnieks@...edu
Cc:	Ravishankar karkala Mallikarjunayya 
	<ravishankar.km@...enturtles.in>, gregkh@...e.de,
	wfp5p@...ginia.edu, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 30/30] Staging: comedi: fix printk issue in jr3_pci.c

On Wed, 2011-12-14 at 21:25 -0500, Valdis.Kletnieks@...edu wrote:
> On Mon, 12 Dec 2011 12:52:19 +0530, Ravishankar karkala Mallikarjunayya said:
> > This is a patch to the jr3_pci.c file that fixes up a
> > printk warning found by the checkpatch.pl tool.
[]
> > diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c
[]
> > @@ -593,24 +593,24 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice *s)
[]
> > +					printk(KERN_DEBUG "%i ", (min_full_scale).fx);
> > +					printk(KERN_CONT "%i ", (min_full_scale).fy);
> > +					printk(KERN_CONT "%i ", (min_full_scale).fz);
> > +					printk(KERN_CONT "%i ", (min_full_scale).mx);
> > +					printk(KERN_CONT "%i ", (min_full_scale).my);
> > +					printk(KERN_CONT "%i ", (min_full_scale).mz);
> > +					printk(KERN_CONT "\n");
> Is there a reason that as long as you were fixing this code, you didn't make it
> one call to printk?
> 					printk(KERN_DEBUG,"%i %i %i %i %i %i\n",
> 						(min_full_scale).fx),
> 						(min_full_scale).fy),
> 						(min_full_scale).fz),
> 						(min_full_scale).mx),
> 						(min_full_scale).my),
> 						(min_full_scale).mz));
> Doing it this way helps guarantee that another CPU doesn't inject a printk into
> the middle and split up your output.
> Also, there should be at least a *short* text string in that printk saying what
> it is.  printk(KERN_DEBUG,"jr3_poll %i"   or similar would be a start.
> Otherwise you get a line with 6 integers in it.

Use #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
and
pr_debug(etc...)

min_full_scale is a variable and doesn't need parenthesis.
It's also in my opinion an overly long name.

					mfs =  get_min_full_scales(channel);
					pr_debug("Got MinFullScales: %i %i %i, %i %i %i\n",
						 msf.fx, msf.fy, msf.fz,
						 msf.mx, msf.my, msf.mz);

> Also, if you're indented that far to the right, that driver is probably in
> serious need of some restructuring or refactoring.

I think 5 tab indentation is a lot but 6 tabs is too many.


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ