Re: [PATCH 6/6] keucr: fix some alignment- and whitespace-problems

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

 



On Thu, Jun 06, 2013 at 06:10:50PM +0200, Johannes Schilling wrote:
> resolves checkpatch errors and warnings regarding whitespace around
> operators, line lengths and indentation.
> 

I feel like this should be broken up into several patches.  A lot of
these changes will make checkpatch.pl happy but they are not
beautiful.

> --- a/drivers/staging/keucr/init.c
> +++ b/drivers/staging/keucr/init.c
> @@ -98,11 +98,16 @@ int ENE_SMInit(struct us_data *us)
>  	us->SM_CardID   = buf[2];
>  
>  	if (us->SM_Status.Insert && us->SM_Status.Ready) {

The better way to solve this is:

-		dev_info(&us->pusb_dev->dev, "Insert     = %x\n", us->SM_Status.Insert);
+		dev_info(us_dev, "Insert     = %x\n", us->SM_Status.Insert);

> -		dev_info(&us->pusb_dev->dev, "Ready      = %x\n", us->SM_Status.Ready);
> -		dev_info(&us->pusb_dev->dev, "WtP        = %x\n", us->SM_Status.WtP);
> -		dev_info(&us->pusb_dev->dev, "DeviceID   = %x\n", us->SM_DeviceID);
> -		dev_info(&us->pusb_dev->dev, "CardID     = %x\n", us->SM_CardID);
> +		dev_info(&us->pusb_dev->dev, "Insert     = %x\n",
> +					     us->SM_Status.Insert);
> +		dev_info(&us->pusb_dev->dev, "Ready      = %x\n",
> +					     us->SM_Status.Ready);
> +		dev_info(&us->pusb_dev->dev, "WtP        = %x\n",
> +					     us->SM_Status.WtP);
> +		dev_info(&us->pusb_dev->dev, "DeviceID   = %x\n",
> +					     us->SM_DeviceID);
> +		dev_info(&us->pusb_dev->dev, "CardID     = %x\n",
> +					     us->SM_CardID);
>  		MediaChange = 1;
>  		Check_D_MediaFmt(us);
>  	} else {
> @@ -174,7 +179,8 @@ int ENE_SendScsiCmd(struct us_data *us, BYTE fDir, void *buf, int use_sg)
>  	result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
>  					    bcb, US_BULK_CB_WRAP_LEN, NULL);
>  	if (result != USB_STOR_XFER_GOOD) {
> -		dev_err(&us->pusb_dev->dev, "send cmd to out endpoint fail ---\n");
> +		dev_err(&us->pusb_dev->dev,
> +				"send cmd to out endpoint fail ---\n");

Line the parameters up:

+		dev_info(&us->pusb_dev->dev,
+			 "my extra long messssssssssssssssagesfasdfadf ---\n");

I used 3 tabs and a space to make everything line up correctly.  But
if you use a temporary variable this will fit on one line.


> @@ -604,9 +604,9 @@ static int eucr_probe(struct usb_interface *intf,
>  	if (!(MiscReg03 & 0x02)) {
>  		result = -ENODEV;
>  		quiesce_and_remove_host(us);
> -		pr_info("keucr: The driver only supports SM/MS card.\
> -			To use SD card, \
> -			please build driver/usb/storage/ums-eneub6250.ko\n");
> +		pr_info("keucr: The driver only supports SM/MS card. "
> +			"To use SD card, "
> +			"please build driver/usb/storage/ums-eneub6250.ko\n");
>  		goto BadDevice;
>  	}
>  

This is a bug fix.  It should go in as a separate patch.

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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