* [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering.
@ 2013-07-24 20:15 Shaun Laing
2013-07-25 19:58 ` Shaun Laing
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Shaun Laing @ 2013-07-24 20:15 UTC (permalink / raw)
To: kernel-janitors
From: Shaun Laing <shaun-lk@xresource.ca>
Signed-off-by: Shaun Laing <shaun-lk@xresource.ca>
* Resolves sparse warnings of the form "warning: cast to restricted __le??"
* Renames temp variables to include "le", to remind that the values are little endian
---
diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c
index 6c60949..fb8caa7 100644
--- a/drivers/staging/comedi/drivers/dt9812.c
+++ b/drivers/staging/comedi/drivers/dt9812.c
@@ -707,8 +707,9 @@ static int dt9812_reset_device(struct comedi_device *dev)
u32 serial;
u16 vendor;
u16 product;
- u16 tmp16;
u8 tmp8;
+ __le16 tmple16;
+ __le32 tmple32;
int ret;
int i;
@@ -731,33 +732,33 @@ static int dt9812_reset_device(struct comedi_device *dev)
}
}
- ret = dt9812_read_info(dev, 1, &vendor, sizeof(vendor));
+ ret = dt9812_read_info(dev, 1, &tmple16, sizeof(tmple16));
if (ret) {
dev_err(dev->class_dev, "failed to read vendor id\n");
return ret;
}
- vendor = le16_to_cpu(vendor);
+ vendor = le16_to_cpu(tmple16);
- ret = dt9812_read_info(dev, 3, &product, sizeof(product));
+ ret = dt9812_read_info(dev, 3, &tmple16, sizeof(tmple16));
if (ret) {
dev_err(dev->class_dev, "failed to read product id\n");
return ret;
}
- product = le16_to_cpu(product);
+ product = le16_to_cpu(tmple16);
- ret = dt9812_read_info(dev, 5, &tmp16, sizeof(tmp16));
+ ret = dt9812_read_info(dev, 5, &tmple16, sizeof(tmple16));
if (ret) {
dev_err(dev->class_dev, "failed to read device id\n");
return ret;
}
- devpriv->device = le16_to_cpu(tmp16);
+ devpriv->device = le16_to_cpu(tmple16);
- ret = dt9812_read_info(dev, 7, &serial, sizeof(serial));
+ ret = dt9812_read_info(dev, 7, &tmple32, sizeof(tmple32));
if (ret) {
dev_err(dev->class_dev, "failed to read serial number\n");
return ret;
}
- serial = le32_to_cpu(serial);
+ serial = le32_to_cpu(tmple32);
/* let the user know what node this device is now attached to */
dev_info(dev->class_dev, "USB DT9812 (%4.4x.%4.4x.%4.4x) #0x%8.8x\n",
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering.
2013-07-24 20:15 [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering Shaun Laing
@ 2013-07-25 19:58 ` Shaun Laing
2013-07-26 11:57 ` Dan Carpenter
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Shaun Laing @ 2013-07-25 19:58 UTC (permalink / raw)
To: kernel-janitors
Hi all,
This is my first patch, so I'm not sure what the process is now that
I've sent it in. Thank you very much for your time and feedback.
On Wed, Jul 24, 2013 at 2:15 PM, Shaun Laing <shaun@xresource.ca> wrote:
> From: Shaun Laing <shaun-lk@xresource.ca>
> Signed-off-by: Shaun Laing <shaun-lk@xresource.ca>
>
> * Resolves sparse warnings of the form "warning: cast to restricted __le??"
> * Renames temp variables to include "le", to remind that the values are little endian
>
> ---
> diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c
> index 6c60949..fb8caa7 100644
> --- a/drivers/staging/comedi/drivers/dt9812.c
> +++ b/drivers/staging/comedi/drivers/dt9812.c
> @@ -707,8 +707,9 @@ static int dt9812_reset_device(struct comedi_device *dev)
> u32 serial;
> u16 vendor;
> u16 product;
> - u16 tmp16;
> u8 tmp8;
> + __le16 tmple16;
> + __le32 tmple32;
> int ret;
> int i;
>
> @@ -731,33 +732,33 @@ static int dt9812_reset_device(struct comedi_device *dev)
> }
> }
>
> - ret = dt9812_read_info(dev, 1, &vendor, sizeof(vendor));
> + ret = dt9812_read_info(dev, 1, &tmple16, sizeof(tmple16));
> if (ret) {
> dev_err(dev->class_dev, "failed to read vendor id\n");
> return ret;
> }
> - vendor = le16_to_cpu(vendor);
> + vendor = le16_to_cpu(tmple16);
>
> - ret = dt9812_read_info(dev, 3, &product, sizeof(product));
> + ret = dt9812_read_info(dev, 3, &tmple16, sizeof(tmple16));
> if (ret) {
> dev_err(dev->class_dev, "failed to read product id\n");
> return ret;
> }
> - product = le16_to_cpu(product);
> + product = le16_to_cpu(tmple16);
>
> - ret = dt9812_read_info(dev, 5, &tmp16, sizeof(tmp16));
> + ret = dt9812_read_info(dev, 5, &tmple16, sizeof(tmple16));
> if (ret) {
> dev_err(dev->class_dev, "failed to read device id\n");
> return ret;
> }
> - devpriv->device = le16_to_cpu(tmp16);
> + devpriv->device = le16_to_cpu(tmple16);
>
> - ret = dt9812_read_info(dev, 7, &serial, sizeof(serial));
> + ret = dt9812_read_info(dev, 7, &tmple32, sizeof(tmple32));
> if (ret) {
> dev_err(dev->class_dev, "failed to read serial number\n");
> return ret;
> }
> - serial = le32_to_cpu(serial);
> + serial = le32_to_cpu(tmple32);
>
> /* let the user know what node this device is now attached to */
> dev_info(dev->class_dev, "USB DT9812 (%4.4x.%4.4x.%4.4x) #0x%8.8x\n",
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering.
2013-07-24 20:15 [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering Shaun Laing
2013-07-25 19:58 ` Shaun Laing
@ 2013-07-26 11:57 ` Dan Carpenter
2013-07-26 12:00 ` Dan Carpenter
2013-07-26 13:09 ` Shaun Laing
3 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2013-07-26 11:57 UTC (permalink / raw)
To: kernel-janitors
On Wed, Jul 24, 2013 at 02:15:38PM -0600, Shaun Laing wrote:
> From: Shaun Laing <shaun-lk@xresource.ca>
This is not needed since you are the author. The email should
match the email address you are using to send patches.
The signed-off-by thing is intended to have a legal meaning, that
you didn't violate copyright or anything. You are using a different
email to send patches and to sign so it's a bit weird. Obviously,
we don't actually know that your real name is "Shaun Laing" either,
so it's not like it's a bullet proof system. But we generally say
that the email should match at least and if we know that it looks
like a fake name we won't accept that either.
> Signed-off-by: Shaun Laing <shaun-lk@xresource.ca>
Put the signed off by at the end of the patch.
>
> * Resolves sparse warnings of the form "warning: cast to restricted __le??"
> * Renames temp variables to include "le", to remind that the values are little endian
Don't put an "le" in the name. It looks ugly/doesn't match kernel
naming style and anyway sparse will remind you if you forget about
endianess.
Otherwise, the patch looks good. Resend it to the people in
./scripts/get_maintainer.pl. Always CC at least one mailing list.
There is a mailing list for staging code so you don't need to CC
linux-kernel (they will just ignore the patch anyway).
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering.
2013-07-24 20:15 [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering Shaun Laing
2013-07-25 19:58 ` Shaun Laing
2013-07-26 11:57 ` Dan Carpenter
@ 2013-07-26 12:00 ` Dan Carpenter
2013-07-26 13:09 ` Shaun Laing
3 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2013-07-26 12:00 UTC (permalink / raw)
To: kernel-janitors
Oh, one other thing. The subject should be:
Subject: [patch] staging: comedi: dt9812: Resolves sparse warnings regarding byte ordering.
Actually, that's too long.
But do a `git log --oneline drivers/staging/comedi/drivers/dt9812.c`
to see previous subjects.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering.
2013-07-24 20:15 [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering Shaun Laing
` (2 preceding siblings ...)
2013-07-26 12:00 ` Dan Carpenter
@ 2013-07-26 13:09 ` Shaun Laing
3 siblings, 0 replies; 5+ messages in thread
From: Shaun Laing @ 2013-07-26 13:09 UTC (permalink / raw)
To: kernel-janitors
Thank you!
On Fri, Jul 26, 2013 at 6:00 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Oh, one other thing. The subject should be:
>
> Subject: [patch] staging: comedi: dt9812: Resolves sparse warnings regarding byte ordering.
>
> Actually, that's too long.
>
> But do a `git log --oneline drivers/staging/comedi/drivers/dt9812.c`
> to see previous subjects.
>
> regards,
> dan carpenter
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-26 13:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-24 20:15 [PATCH 1/1] staging/comedi/drivers/dt9812.c: Resolves sparse warnings regarding byte ordering Shaun Laing
2013-07-25 19:58 ` Shaun Laing
2013-07-26 11:57 ` Dan Carpenter
2013-07-26 12:00 ` Dan Carpenter
2013-07-26 13:09 ` Shaun Laing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox