Re: [PATCH 1/3] staging: dgnc: fix 80 characters per line limitation and code indent warnings.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 20, 2013 at 10:03:25PM +0530, Stalin Srinivasan wrote:
> From: stalinsrinivasan.s <stalinsrinivasan.subramanian@xxxxxxxxxxxx>
> 

We get your name from the email header.

> This is a patch to the dgnc_cls.c file that 
> fixes up 80 characters per line and code indent
> warnings found by the checkpatch.pl tool.

And a bunch of other things as well...  Really too many things to review
comfortably.  Split this up into a series of patches.

> @@ -572,7 +588,8 @@ static void cls_param(struct tty_struct *tty)
>  
>  		jindex = baud;
>  
> -		if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) && (jindex < 16)) {
> +		if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) &&
> +								(jindex < 16)) {
>  			baud = bauds[iindex][jindex];

Do it like this:

		if ((iindex >= 0) && (iindex < 4) &&
		    (jindex >= 0) && (jindex < 16)) {

In other words don't "right align" the code squashed over on the right
hand side of the screen.

> @@ -1350,7 +1382,9 @@ static void cls_send_break(struct channel_t *ch, int msecs)
>  		uchar temp = readb(&ch->ch_cls_uart->lcr);
>  		writeb((temp | UART_LCR_SBC), &ch->ch_cls_uart->lcr);
>  		ch->ch_flags |= (CH_BREAK_SENDING);
> -		DPR_IOCTL(("Port %d. Starting UART_LCR_SBC! start: %lx should end: %lx\n",
> +		DPR_IOCTL((
> +			"Port %d. Starting UART_LCR_SBC! start: %lx "
> +			"should end: %lx\n",
>  			ch->ch_portnum, jiffies, ch->ch_stop_sending_break));

Don't break up string literals like that.  Do it like:

		DPR_IOCTL((Port %d. Starting UART_LCR_SBC! start: %lx should end: %lx\n",
			  ch->ch_portnum, jiffies, ch->ch_stop_sending_break));

I haven't looked at why this macro needs extra parenthesis in the
caller but I suspect it is something gross...

> @@ -1389,12 +1423,12 @@ static void cls_vpd(struct dgnc_board *brd)
>  	if (!re_map_vpdbase)
>  		return;
>  
> -        /* Store the VPD into our buffer */
> -        for (i = 0; i < 0x40; i++) {
> +	/* Store the VPD into our buffer */
> +	for (i = 0; i < 0x40; i++) {
>  		brd->vpd[i] = readb(re_map_vpdbase + i);
> -		printk("%x ", brd->vpd[i]);
> -        }
> -	printk("\n");
> +		pr_info("%x ", brd->vpd[i]);
> +	}
> +	pr_info("\n");
>  

This doesn't work.  pr_info() will put some extra characters at the
start of every call.  You could use pr_cont()...  Officially, pr_cont()
doesn't work either since we have already booted and this has to be
re-written to print one line at a time.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux