2018-07-18 17:05:11

by Raghu Halharvi

[permalink] [raw]
Subject: [PATCH] pktcdvd:checkpatch:fix pointer declaration

* Fix all pointer declaration which causes
"ERROR: "foo* bar" should be "foo *bar""

Signed-off-by: RAGHU Halharvi <[email protected]>
---
drivers/block/pktcdvd.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 59fb66c0e064..50a574049144 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -104,7 +104,7 @@ static struct class *class_pktcdvd; /* /sys/class/pktcdvd */
static struct dentry *pkt_debugfs_root; /* /sys/kernel/debug/pktcdvd */

/* forward declaration */
-static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev);
+static int pkt_setup_dev(dev_t dev, dev_t *pkt_dev);
static int pkt_remove_dev(dev_t pkt_dev);
static int pkt_seq_show(struct seq_file *m, void *p);

@@ -116,10 +116,10 @@ static sector_t get_zone(sector_t sector, struct pktcdvd_device *pd)
/*
* create and register a pktcdvd kernel object.
*/
-static struct pktcdvd_kobj* pkt_kobj_create(struct pktcdvd_device *pd,
- const char* name,
- struct kobject* parent,
- struct kobj_type* ktype)
+static struct pktcdvd_kobj *pkt_kobj_create(struct pktcdvd_device *pd,
+ const char *name,
+ struct kobject *parent,
+ struct kobj_type *ktype)
{
struct pktcdvd_kobj *p;
int error;
@@ -246,7 +246,7 @@ static ssize_t kobj_pkt_show(struct kobject *kobj,
return n;
}

-static void init_write_congestion_marks(int* lo, int* hi)
+static void init_write_congestion_marks(int *lo, int *hi)
{
if (*hi > 0) {
*hi = max(*hi, 500);
@@ -2708,7 +2708,7 @@ static char *pktcdvd_devnode(struct gendisk *gd, umode_t *mode)
/*
* Set up mapping from pktcdvd device to CD-ROM device.
*/
-static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)
+static int pkt_setup_dev(dev_t dev, dev_t *pkt_dev)
{
int idx;
int ret = -ENOMEM;
--
2.17.1



2018-07-18 18:07:36

by Bart Van Assche

[permalink] [raw]
Subject: Re: [PATCH] pktcdvd:checkpatch:fix pointer declaration

On Wed, 2018-07-18 at 21:28 +-0530, RAGHU Halharvi wrote:
+AD4- +ACo- Fix all pointer declaration which causes
+AD4- +ACI-ERROR: +ACI-foo+ACo- bar+ACI- should be +ACI-foo +ACo-bar+ACIAIg-

Hello Raghu,

If you would not be aware of this, checkpatch is a tool that is intended to
verify patches before submission and not to verify code that is already
upstream. A detailed explanation of why patches like this one should not be
submitted is available in +ACI-A quick guide to why stand-alone checkpatch
patches suck+ACI-
(https://lists.kernelnewbies.org/pipermail/kernelnewbies/2014-September/012296.html).

Thanks,

Bart.

2018-07-18 18:44:03

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] pktcdvd:checkpatch:fix pointer declaration

On Wed, 2018-07-18 at 18:06 +0000, Bart Van Assche wrote:
> On Wed, 2018-07-18 at 21:28 +0530, RAGHU Halharvi wrote:
> > * Fix all pointer declaration which causes
> > "ERROR: "foo* bar" should be "foo *bar""
>
> Hello Raghu,
>
> If you would not be aware of this, checkpatch is a tool that is intended to
> verify patches before submission and not to verify code that is already
> upstream. A detailed explanation of why patches like this one should not be
> submitted is available in "A quick guide to why stand-alone checkpatch
> patches suck"
> (https://lists.kernelnewbies.org/pipermail/kernelnewbies/2014-September/012296.html).

Read more of the whole thread.
Varying opinions exist.


2018-07-18 19:01:54

by Raghu Halharvi

[permalink] [raw]
Subject: Re: [PATCH] pktcdvd:checkpatch:fix pointer declaration

Bart,

I'm starter in kernel contribution & I guess cleanup of certain files
which have more than 50+ checkpatch errors is good start.

Also one of the patch was accepted by Jens Axboe & he responded back to
resend one of the patch which was not getting applied.

But I get your point ,I'll restrict my checkpatch fixes to drivers/staging files

Thanks Joe for followup.

On Wed, Jul 18, 2018 at 11:43:11AM -0700, Joe Perches wrote:
> On Wed, 2018-07-18 at 18:06 +0000, Bart Van Assche wrote:
> > On Wed, 2018-07-18 at 21:28 +0530, RAGHU Halharvi wrote:
> > > * Fix all pointer declaration which causes
> > > "ERROR: "foo* bar" should be "foo *bar""
> >
> > Hello Raghu,
> >
> > If you would not be aware of this, checkpatch is a tool that is intended to
> > verify patches before submission and not to verify code that is already
> > upstream. A detailed explanation of why patches like this one should not be
> > submitted is available in "A quick guide to why stand-alone checkpatch
> > patches suck"
> > (https://lists.kernelnewbies.org/pipermail/kernelnewbies/2014-September/012296.html).
>
> Read more of the whole thread.
> Varying opinions exist.
>