Messages in this thread | | | Subject | Re: [PATCH 6/6] keucr: fix some alignment- and whitespace-problems | From | Joe Perches <> | Date | Thu, 06 Jun 2013 11:03:42 -0700 |
| |
On Thu, 2013-06-06 at 18:10 +0200, Johannes Schilling wrote: > resolves checkpatch errors and warnings regarding whitespace around > operators, line lengths and indentation.
I suggest adding --strict to your checkpatch runs to report a few more style usage elements.
> diff --git a/drivers/staging/keucr/init.c b/drivers/staging/keucr/init.c [] > @@ -98,11 +98,16 @@ int ENE_SMInit(struct us_data *us) [] > if (us->SM_Status.Insert && us->SM_Status.Ready) { > - dev_info(&us->pusb_dev->dev, "Insert = %x\n", us->SM_Status.Insert); [] > + dev_info(&us->pusb_dev->dev, "Insert = %x\n", > + us->SM_Status.Insert);
I think this would be nicer aligning the arguments to the open parenthesis like:
dev_info(&us->pusb_dev->dev, "Insert = %x\n", us->SM_Status.Insert);
but using
us_info(us, "Insert = %x\n", us->SM_Status.Insert);
would be nicer still and fit 80 cols, etc...
Another option would be to use a macro like:
#define us_show_status(us, field) \ us_info(us, "%-11s= %x\n", #field, us->SM_Status.field)
And these become
us_show_status(us, "Insert"); us_show_status(us, "Ready"); us_show_status(us, "WtP");
etc...
It depends on how many of these actually exist whether or not a macro is appropriate.
| |