Re: [PATCH] BTRFS: Runs the xor function if a Block has failed

2016-01-05 Thread Sanidhya Solanki
On Tue, 5 Jan 2016 10:22:36 +0100
David Sterba  wrote:

> If the data a rerecovered, why is -EIO still returned? 

In the other places in the file where the code appears, the submitted
patch is all that is required to do the xor. I think we also need to
include the following line:
memcpy(pointers[nr_data], pointers[0], PAGE_SIZE);
and delete the "return EIO" statement which I believe appears to be a
placeholder for the xor function.
In the end the final patch should look something like this:
> -  * TODO, we should redo the xor here.
>*/
> + memcpy(pointers[nr_data], pointers[0], 
> PAGE_SIZE);
> + run_xor(pointers, rbio->nr_data - 1, 
> PAGE_CACHE_SIZE); 
> - err = -EIO;

So, I was just going to send you the mail as it is written above, but I
decided to investigate. The commit in question that added the todo was
53b381b3abeb86f12787a6c40fee9b2f71edc23b. Unfortunately, it was not
submitted  by the original author, nor was it by any means a small
dedicated patch. It adds the entire file, without much comment or
explanation and has not been touched since. 

However, we can get some idea of what is expected by looking at line
2398 in raid56.c, where a similar case of raid 5 recovery is handled.

So what the patch described above does is deal with a scenario where
no q stripe or bad data block exists, and, we can only rebuild from the
p-stripe, in effect like a raid 5 recovery.

So, if you are satisfied with the above retouched change, I can modify
my original patch with your suggestions and my changes, and, I can
forward them to the list again.

> Also, I see some post-recovery steps eg. for the damaged P stripes
> (at label pstripes) and I'd expect something similar for the case
> you're fixing.

I believe that is the case because the other cases still have the q-
stripe available tor rebuild from, which requires cleanup afterwards,
but the raid5-like scenario above does not. Let me know if anything
else is needed.

> I'm not familiar with the raid56 implementation but the fix looks
> suspiciously trivial and I doubt that the xor was omitted out of
> laziness.

I guess we will never know.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Runs the xor function if a Block has failed

2016-01-05 Thread Sanidhya Solanki
On Tue, 5 Jan 2016 10:22:36 +0100
David Sterba  wrote:

> If the data a rerecovered, why is -EIO still returned? 

In the other places in the file where the code appears, the submitted
patch is all that is required to do the xor. I think we also need to
include the following line:
memcpy(pointers[nr_data], pointers[0], PAGE_SIZE);
and delete the "return EIO" statement which I believe appears to be a
placeholder for the xor function.
In the end the final patch should look something like this:
> -  * TODO, we should redo the xor here.
>*/
> + memcpy(pointers[nr_data], pointers[0], 
> PAGE_SIZE);
> + run_xor(pointers, rbio->nr_data - 1, 
> PAGE_CACHE_SIZE); 
> - err = -EIO;

So, I was just going to send you the mail as it is written above, but I
decided to investigate. The commit in question that added the todo was
53b381b3abeb86f12787a6c40fee9b2f71edc23b. Unfortunately, it was not
submitted  by the original author, nor was it by any means a small
dedicated patch. It adds the entire file, without much comment or
explanation and has not been touched since. 

However, we can get some idea of what is expected by looking at line
2398 in raid56.c, where a similar case of raid 5 recovery is handled.

So what the patch described above does is deal with a scenario where
no q stripe or bad data block exists, and, we can only rebuild from the
p-stripe, in effect like a raid 5 recovery.

So, if you are satisfied with the above retouched change, I can modify
my original patch with your suggestions and my changes, and, I can
forward them to the list again.

> Also, I see some post-recovery steps eg. for the damaged P stripes
> (at label pstripes) and I'd expect something similar for the case
> you're fixing.

I believe that is the case because the other cases still have the q-
stripe available tor rebuild from, which requires cleanup afterwards,
but the raid5-like scenario above does not. Let me know if anything
else is needed.

> I'm not familiar with the raid56 implementation but the fix looks
> suspiciously trivial and I doubt that the xor was omitted out of
> laziness.

I guess we will never know.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds the files and options needed for Hybrid Storage

2016-01-02 Thread Sanidhya Solanki
On Sat, 02 Jan 2016 12:40:46 +0100
Martin Steigerwald  wrote:
> Or is this something different?
Yes, Martin this patch starts the implementation that I hope will lead
to the implementation of a Hybrid Cache to the BTRFS.

However, there is no need to limit ourselves to just Flash devices.
Depending on how the implementation for 3D X-point devices and NVDIMMs
work out, this can be used to cache on those layers as well.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds the files and options needed for Hybrid Storage

2016-01-02 Thread Sanidhya Solanki
On Sat, 02 Jan 2016 12:40:46 +0100
Martin Steigerwald  wrote:
> Or is this something different?
Yes, Martin this patch starts the implementation that I hope will lead
to the implementation of a Hybrid Cache to the BTRFS.

However, there is no need to limit ourselves to just Flash devices.
Depending on how the implementation for 3D X-point devices and NVDIMMs
work out, this can be used to cache on those layers as well.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] BTRFS: Adds the files and options needed for Hybrid Storage

2016-01-01 Thread Sanidhya Solanki
This patch adds the file required for Hybrid Storage. It contains
the memory, time and size limits for the cache and the statistics that
will be provided while the cache is operating.
It also adds the Makefile changes needed to add the Hybrid Storage.

Signed-off-by: Sanidhya Solanki 
---
 fs/btrfs/Makefile |  2 +-
 fs/btrfs/cache.c  | 58 +++
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 fs/btrfs/cache.c

diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 6d1d0b9..dc56ae4 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -9,7 +9,7 @@ btrfs-y += super.o ctree.o extent-tree.o print-tree.o 
root-tree.o dir-item.o \
   export.o tree-log.o free-space-cache.o zlib.o lzo.o \
   compression.o delayed-ref.o relocation.o delayed-inode.o scrub.o \
   reada.o backref.o ulist.o qgroup.o send.o dev-replace.o raid56.o \
-  uuid-tree.o props.o hash.o
+  uuid-tree.o props.o hash.o cache.o
 
 btrfs-$(CONFIG_BTRFS_FS_POSIX_ACL) += acl.o
 btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o
diff --git a/fs/btrfs/cache.c b/fs/btrfs/cache.c
new file mode 100644
index 000..0ece7a1
--- /dev/null
+++ b/fs/btrfs/cache.c
@@ -0,0 +1,58 @@
+/*
+ * (c) Sanidhya Solanki, 2016
+ *
+ * Licensed under the FSF's GNU Public License v2 or later.
+ */
+#include 
+
+/* Cache size configuration )in MiB).*/
+#define MAX_CACHE_SIZE = 1
+#define MIN_CACHE_SIZE = 10
+
+/* Time (in seconds)before retrying to increase the cache size.*/
+#define CACHE_RETRY = 10
+
+/* Space required to be free (in MiB) before increasing the size of the
+ * cache. If cache size is less than cache_grow_limit, a block will be freed
+ * from the cache to allow the cache to continue growning.
+ */
+#define CACHE_GROW_LIMIT = 100
+
+/* Size required to be free (in MiB) after we shrink the cache, so that it
+ * does not grow in size immediately.
+ */
+#define CACHE_SHRINK_FREE_SPACE_LIMIT = 100
+
+/* Age (in seconds) of oldest and newest block in the cache.*/
+#define MAX_AGE_LIMIT = 300/* Five Minute Rule recommendation,
+* optimum size depends on size of data
+* blocks.
+*/
+#define MIN_AGE_LIMIT = 15 /* In case of cache stampede.*/
+
+/* Memory constraints (in percentage) before we stop caching.*/
+#define MIN_MEM_FREE = 10
+
+/* Cache statistics. */
+struct cache_stats {
+   u64 cache_size;
+   u64 maximum_cache_size_attained;
+   int cache_hit_rate;
+   int cache_miss_rate;
+   u64 cache_evicted;
+   u64 duplicate_read;
+   u64 duplicate_write;
+   int stats_update_interval;
+};
+
+#define cache_size CACHE_SIZE /* Current cache size.*/
+#define max_cache_size MAX_SIZE /* Max cache limit. */
+#define min_cache_size MIN_SIZE /* Min cache limit.*/
+#define cache_time MAX_TIME /* Maximum time to keep data in cache.*/
+#define evicted_csum   EVICTED_CSUM/* Checksum of the evited data
+* (to avoid repeatedly caching
+* data that was just evicted.
+*/
+#define read_csum  READ_CSUM /* Checksum of the read data.*/
+#define write_csum WRITE_CSUM /* Checksum of the written data.*/
+#define evict_interval EVICT_INTERVAL /* Time to keep data before eviction.*/
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] BTRFS: Adds the files and options needed for Hybrid Storage

2016-01-01 Thread Sanidhya Solanki
This patch adds the file required for Hybrid Storage. It contains
the memory, time and size limits for the cache and the statistics that
will be provided while the cache is operating.
It also adds the Makefile changes needed to add the Hybrid Storage.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 fs/btrfs/Makefile |  2 +-
 fs/btrfs/cache.c  | 58 +++
 2 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 fs/btrfs/cache.c

diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 6d1d0b9..dc56ae4 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -9,7 +9,7 @@ btrfs-y += super.o ctree.o extent-tree.o print-tree.o 
root-tree.o dir-item.o \
   export.o tree-log.o free-space-cache.o zlib.o lzo.o \
   compression.o delayed-ref.o relocation.o delayed-inode.o scrub.o \
   reada.o backref.o ulist.o qgroup.o send.o dev-replace.o raid56.o \
-  uuid-tree.o props.o hash.o
+  uuid-tree.o props.o hash.o cache.o
 
 btrfs-$(CONFIG_BTRFS_FS_POSIX_ACL) += acl.o
 btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o
diff --git a/fs/btrfs/cache.c b/fs/btrfs/cache.c
new file mode 100644
index 000..0ece7a1
--- /dev/null
+++ b/fs/btrfs/cache.c
@@ -0,0 +1,58 @@
+/*
+ * (c) Sanidhya Solanki, 2016
+ *
+ * Licensed under the FSF's GNU Public License v2 or later.
+ */
+#include 
+
+/* Cache size configuration )in MiB).*/
+#define MAX_CACHE_SIZE = 1
+#define MIN_CACHE_SIZE = 10
+
+/* Time (in seconds)before retrying to increase the cache size.*/
+#define CACHE_RETRY = 10
+
+/* Space required to be free (in MiB) before increasing the size of the
+ * cache. If cache size is less than cache_grow_limit, a block will be freed
+ * from the cache to allow the cache to continue growning.
+ */
+#define CACHE_GROW_LIMIT = 100
+
+/* Size required to be free (in MiB) after we shrink the cache, so that it
+ * does not grow in size immediately.
+ */
+#define CACHE_SHRINK_FREE_SPACE_LIMIT = 100
+
+/* Age (in seconds) of oldest and newest block in the cache.*/
+#define MAX_AGE_LIMIT = 300/* Five Minute Rule recommendation,
+* optimum size depends on size of data
+* blocks.
+*/
+#define MIN_AGE_LIMIT = 15 /* In case of cache stampede.*/
+
+/* Memory constraints (in percentage) before we stop caching.*/
+#define MIN_MEM_FREE = 10
+
+/* Cache statistics. */
+struct cache_stats {
+   u64 cache_size;
+   u64 maximum_cache_size_attained;
+   int cache_hit_rate;
+   int cache_miss_rate;
+   u64 cache_evicted;
+   u64 duplicate_read;
+   u64 duplicate_write;
+   int stats_update_interval;
+};
+
+#define cache_size CACHE_SIZE /* Current cache size.*/
+#define max_cache_size MAX_SIZE /* Max cache limit. */
+#define min_cache_size MIN_SIZE /* Min cache limit.*/
+#define cache_time MAX_TIME /* Maximum time to keep data in cache.*/
+#define evicted_csum   EVICTED_CSUM/* Checksum of the evited data
+* (to avoid repeatedly caching
+* data that was just evicted.
+*/
+#define read_csum  READ_CSUM /* Checksum of the read data.*/
+#define write_csum WRITE_CSUM /* Checksum of the written data.*/
+#define evict_interval EVICT_INTERVAL /* Time to keep data before eviction.*/
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Runs the xor function if a Block has failed

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 18:18:26 +0100
David Sterba  wrote:

> That's just the comment copied, the changelog does not explain why
> it's ok to do just the run_xor there. It does not seem trivial to me.
> Please describe that the end result after the code change is expected.

In the RAID 6 case after a failure, we discover that the failure
affected the entire P stripe, without any bad data occurring. Hence, we
xor the previously stored parity data to return the data that was lost
in the P stripe failure.

The xor-red data is from the parity blocks. Hence, we are left with 
recovered data belonging to the P stripe.

If there is an error during the completion of the xor (provided by the
patch ), we got to the cleanup function.

Hope that is satisfactory.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 17:17:22 +0100
David Sterba  wrote:

> Let me note that a good reputation is also built from patch reviews
> (hint hint).

Unfortunately, not too many patches coming in for BTRFS presently.
Mailing list activity is down to 25-35 mails per day. Mostly feature
and bug requests.

I will try to pitch in with patch reviews where possible.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 16:58:05 +0100
David Sterba  wrote:

> On Wed, Dec 30, 2015 at 06:15:23AM -0500, Sanidhya Solanki wrote:

> > - Implement a way to do an in-place Stripe Length change.
>
> How are you going to implement that? I've suggested the balance filter
> style of conversion, which is not in-place so I'm curious what do you
> mean by in-place.

As CAM suggested, it would basically be a CoW, with a checksum
comparison at the end to make sure no data has been corrupted.

In-place: Without taking the drives or filesystem offline or unmounting
them. Doing the conversion while the rest of the RAID is in use.
Risky, slow, but possible, given enough time for large data sets.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 22:10:44 +0800
Qu Wenruo  wrote:
> Understood now.

Good.

> I totally understand that implement ... to polish your
> skill.

That has got to be the most hilarious way I believe I have seen someone
delegate a task. But it was effective.

Only one problem. I do not run BTRFS on my systems nor do I have a
RAID setup, due to possessing a limited number of free drives. So, while
I may be able to code for it, I will not be able to test it. I will need
the community's help to do the testing.

I will get started tomorrow.

To-do (so far):
- Implement RAID Stripe length as a compile and runtime option.
- Implement a way to do an in-place Stripe Length change.
- Debugging & testing for the above additions.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 19:59:16 +0800
Qu Wenruo  wrote:
> Not really sure about the difference between 2 and 3.

I should have made it clear before, I was asking the exact use case in
mind when listing the choices. Option 2 would be for SysAdmins running
production software and configuring it as they desire.
Option 3 is what we have in the Kernel now, before my patch, where the
option exists, but it is fixed by the code. You can change it, but you
need to be someone fairly involved in the upstream work (like a
distribution Maintainer). This is what my patch implements (well, this
and option 3).
Option 1 leaves it as a compile time option.

> When you mention runtime option, did you mean ioctl/mount/balance 
> convert option?

Yes, that is correct.

> And what's the third one? Default mkfs time option?
> If you can make it mkfs time option, it won't be really hard to make
> it configurable.

This would be ideal for all use-cases, but make the implementation
much larger than it would be for the other options. Hence, I asked
what the exact use case was for the end-user being targeted.
 
> I didn't consider David means something that.
> As far as I read, he means balance convert option along with mkfs
> option.

Hence, why I asked.

> At least from what I have learned in recent btrfs development,
He> He> either
> we provide a good enough interfaces (normally, balance convert ioctl
> with mkfs time option) to configure some on-disk fields.

Just confirming before starting the implementation.
> So fixed kernel value is not a really good idea, and should at least
> be replace by mkfs time option.

Will do after confirmation.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 18:06:11 +0100
David Sterba  wrote:

> So you want to make the stripe size configurable?...

As I see it there are 3 ways to do it:
-Make it a compile time option that only configures it for a single
system with any devices that are added to the RAID.
-Make it a runtime option that can change based on how the
administrator configures it.
-A non-user facing option that is configurable by someone like a
distribution maintainer for all systems using the Binary Distribution.

As I see it, DS would like something like the third option, but CAM
(ostensibly a SysAdmin) wants the second option.

On the other hand, I implemented the first option. 

The first and third option can co-exit, the second is an orthogonal
target that needs to be setup separately.

Or we can make all options co-exist, but make it more complicated.

Please let me know which implementation is preferable, and, if you just
want me to expand the description (as DS' mail asked for) or redo the
entire setup.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] BTRFS: Runs the xor function if a Block has failed

2015-12-30 Thread Sanidhya Solanki
The patch adds the xor function after the P stripe
has failed, without bad data or the Q stripe.

Signed-off-by: Sanidhya Solanki 
---
 fs/btrfs/raid56.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 1a33d3e..d33734a 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1864,8 +1864,8 @@ static void __raid_recover_end_io(struct btrfs_raid_bio 
*rbio)
/*
 * Just the P stripe has failed, without
 * a bad data or Q stripe.
-* TODO, we should redo the xor here.
 */
+   run_xor(pointers, rbio->nr_data - 1, 
PAGE_CACHE_SIZE);
err = -EIO;
goto cleanup;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 16:58:05 +0100
David Sterba <dste...@suse.cz> wrote:

> On Wed, Dec 30, 2015 at 06:15:23AM -0500, Sanidhya Solanki wrote:

> > - Implement a way to do an in-place Stripe Length change.
>
> How are you going to implement that? I've suggested the balance filter
> style of conversion, which is not in-place so I'm curious what do you
> mean by in-place.

As CAM suggested, it would basically be a CoW, with a checksum
comparison at the end to make sure no data has been corrupted.

In-place: Without taking the drives or filesystem offline or unmounting
them. Doing the conversion while the rest of the RAID is in use.
Risky, slow, but possible, given enough time for large data sets.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 17:17:22 +0100
David Sterba  wrote:

> Let me note that a good reputation is also built from patch reviews
> (hint hint).

Unfortunately, not too many patches coming in for BTRFS presently.
Mailing list activity is down to 25-35 mails per day. Mostly feature
and bug requests.

I will try to pitch in with patch reviews where possible.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Runs the xor function if a Block has failed

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 18:18:26 +0100
David Sterba  wrote:

> That's just the comment copied, the changelog does not explain why
> it's ok to do just the run_xor there. It does not seem trivial to me.
> Please describe that the end result after the code change is expected.

In the RAID 6 case after a failure, we discover that the failure
affected the entire P stripe, without any bad data occurring. Hence, we
xor the previously stored parity data to return the data that was lost
in the P stripe failure.

The xor-red data is from the parity blocks. Hence, we are left with 
recovered data belonging to the P stripe.

If there is an error during the completion of the xor (provided by the
patch ), we got to the cleanup function.

Hope that is satisfactory.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] BTRFS: Runs the xor function if a Block has failed

2015-12-30 Thread Sanidhya Solanki
The patch adds the xor function after the P stripe
has failed, without bad data or the Q stripe.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 fs/btrfs/raid56.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 1a33d3e..d33734a 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1864,8 +1864,8 @@ static void __raid_recover_end_io(struct btrfs_raid_bio 
*rbio)
/*
 * Just the P stripe has failed, without
 * a bad data or Q stripe.
-* TODO, we should redo the xor here.
 */
+   run_xor(pointers, rbio->nr_data - 1, 
PAGE_CACHE_SIZE);
err = -EIO;
goto cleanup;
}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 18:06:11 +0100
David Sterba  wrote:

> So you want to make the stripe size configurable?...

As I see it there are 3 ways to do it:
-Make it a compile time option that only configures it for a single
system with any devices that are added to the RAID.
-Make it a runtime option that can change based on how the
administrator configures it.
-A non-user facing option that is configurable by someone like a
distribution maintainer for all systems using the Binary Distribution.

As I see it, DS would like something like the third option, but CAM
(ostensibly a SysAdmin) wants the second option.

On the other hand, I implemented the first option. 

The first and third option can co-exit, the second is an orthogonal
target that needs to be setup separately.

Or we can make all options co-exist, but make it more complicated.

Please let me know which implementation is preferable, and, if you just
want me to expand the description (as DS' mail asked for) or redo the
entire setup.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 19:59:16 +0800
Qu Wenruo  wrote:
> Not really sure about the difference between 2 and 3.

I should have made it clear before, I was asking the exact use case in
mind when listing the choices. Option 2 would be for SysAdmins running
production software and configuring it as they desire.
Option 3 is what we have in the Kernel now, before my patch, where the
option exists, but it is fixed by the code. You can change it, but you
need to be someone fairly involved in the upstream work (like a
distribution Maintainer). This is what my patch implements (well, this
and option 3).
Option 1 leaves it as a compile time option.

> When you mention runtime option, did you mean ioctl/mount/balance 
> convert option?

Yes, that is correct.

> And what's the third one? Default mkfs time option?
> If you can make it mkfs time option, it won't be really hard to make
> it configurable.

This would be ideal for all use-cases, but make the implementation
much larger than it would be for the other options. Hence, I asked
what the exact use case was for the end-user being targeted.
 
> I didn't consider David means something that.
> As far as I read, he means balance convert option along with mkfs
> option.

Hence, why I asked.

> At least from what I have learned in recent btrfs development,
He> He> either
> we provide a good enough interfaces (normally, balance convert ioctl
> with mkfs time option) to configure some on-disk fields.

Just confirming before starting the implementation.
> So fixed kernel value is not a really good idea, and should at least
> be replace by mkfs time option.

Will do after confirmation.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-30 Thread Sanidhya Solanki
On Wed, 30 Dec 2015 22:10:44 +0800
Qu Wenruo  wrote:
> Understood now.

Good.

> I totally understand that implement ... to polish your
> skill.

That has got to be the most hilarious way I believe I have seen someone
delegate a task. But it was effective.

Only one problem. I do not run BTRFS on my systems nor do I have a
RAID setup, due to possessing a limited number of free drives. So, while
I may be able to code for it, I will not be able to test it. I will need
the community's help to do the testing.

I will get started tomorrow.

To-do (so far):
- Implement RAID Stripe length as a compile and runtime option.
- Implement a way to do an in-place Stripe Length change.
- Debugging & testing for the above additions.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 18:06:11 +0100
David Sterba  wrote:

> I don't know about all implications from changing the define to
> sb->stripesize, also we want to define the allowed range etc. It would
> be better to add more description to the patch.

So, is the patch atleast somewhat usable and you just need me to expand
the description, or should I write the whole patch from scratch,
modifying superblock size as a runtime configurable option?

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 14:39:07 +0100
David Sterba  wrote:

> The stripe size depends on how the filesystem was made, at the moment
> the stripesize parameter is missing from mkfs. The kernel module
> should support all sizes at runtime, so it's not a compile-time
> option.

No good? I will try and re-implement it as a runtime option.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 14:39:07 +0100
David Sterba  wrote:

> The stripe size depends on how the filesystem was made, at the moment
> the stripesize parameter is missing from mkfs. The kernel module
> should support all sizes at runtime, so it's not a compile-time
> option.

No good? I will try and re-implement it as a runtime option.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-29 Thread Sanidhya Solanki
On Tue, 29 Dec 2015 18:06:11 +0100
David Sterba  wrote:

> I don't know about all implications from changing the define to
> sb->stripesize, also we want to define the allowed range etc. It would
> be better to add more description to the patch.

So, is the patch atleast somewhat usable and you just need me to expand
the description, or should I write the whole patch from scratch,
modifying superblock size as a runtime configurable option?

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-28 Thread Sanidhya Solanki
An option to select the RAID Stripe size is made
available in the BTRFS Filesystem, via an option
in the BTRFS Config setup, with minimal change
to the existing code base.

Signed-off-by: Sanidhya Solanki 
---
 fs/btrfs/Kconfig   | 42 ++
 fs/btrfs/Makefile  |  2 ++
 fs/btrfs/scrub.c   |  4 
 fs/btrfs/super.c   |  4 
 fs/btrfs/volumes.c |  2 +-
 fs/btrfs/volumes.h |  4 +++-
 6 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index 80e9c18..1454d21 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -28,6 +28,48 @@ config BTRFS_FS
 
  If unsure, say N.
 
+choice
+ prompt "Choose Stripe Size"
+ default RS_1024
+ help
+   Allows you to select the size of the stripe, which is the smallest 
sized
+   data block to be replicated.
+   Selecting a larger size than your physical block size may lead to 
data
+   fragmentation in some cases.
+
+config RS_512
+ bool "512 bytes"
+
+config RS_1024
+ bool "1024 bytes"
+
+config RS_2048
+ bool "2048 bytes"
+
+config RS_4096
+ bool "4096 bytes"
+
+config RS_8192
+ bool "8192 bytes"
+
+config RS_16384
+ bool "16384 bytes"
+
+config RS_32768
+ bool "32768 bytes"
+
+endchoice
+
+config BTRFS_RAID_STRIPE
+int
+default 512 if RS_512
+default 1024 if RS_1024
+default 2048 if RS_2048
+default 4096 if RS_4096
+default 8192 if RS_8192
+default 16384 if RS_16384
+default 32768 if RS_32768
+
 config BTRFS_FS_POSIX_ACL
bool "Btrfs POSIX Access Control Lists"
depends on BTRFS_FS
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 6d1d0b9..1c4e384 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -17,3 +17,5 @@ btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o
 btrfs-$(CONFIG_BTRFS_FS_RUN_SANITY_TESTS) += tests/free-space-tests.o \
tests/extent-buffer-tests.o tests/btrfs-tests.o \
tests/extent-io-tests.o tests/inode-tests.o tests/qgroup-tests.o
+
+btrfs-$(CONFIG_BTRFS_RAID_STRIPE) += scrub.o super.o volumes.o
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index b091d94..4d0f802 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -63,6 +63,10 @@ struct scrub_ctx;
  */
 #define SCRUB_MAX_PAGES_PER_BLOCK  16  /* 64k per node/leaf/sector */
 
+#define STRIPE_LENGTH CONFIG_BTRFS_RAID_STRIPE
+
+#define BTRFS_STRIPE_LEN   (64 * STRIPE_LENGTH)
+
 struct scrub_recover {
atomic_trefs;
struct btrfs_bio*bbio;
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 24154e4..3d91f8d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -64,6 +64,10 @@
 #define CREATE_TRACE_POINTS
 #include 
 
+#define STRIPE_LENGTH CONFIG_BTRFS_RAID_STRIPE
+
+#define BTRFS_STRIPE_LEN   (64 * STRIPE_LENGTH)
+
 static const struct super_operations btrfs_super_ops;
 static struct file_system_type btrfs_fs_type;
 
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 4564522..e1b2e5c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4461,7 +4461,7 @@ static int btrfs_cmp_device_info(const void *a, const 
void *b)
 static u32 find_raid56_stripe_len(u32 data_devices, u32 dev_stripe_target)
 {
/* TODO allow them to set a preferred stripe size */
-   return 64 * 1024;
+   return BTRFS_STRIPE_LEN;
 }
 
 static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type)
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index d5c84f6..9115a80 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -26,7 +26,9 @@
 
 extern struct mutex uuid_mutex;
 
-#define BTRFS_STRIPE_LEN   (64 * 1024)
+#define STRIPE_LENGTH CONFIG_BTRFS_RAID_STRIPE
+
+#define BTRFS_STRIPE_LEN   (64 * STRIPE_LENGTH)
 
 struct buffer_head;
 struct btrfs_pending_bios {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] BTRFS: Adds an option to select RAID Stripe size

2015-12-28 Thread Sanidhya Solanki
An option to select the RAID Stripe size is made
available in the BTRFS Filesystem, via an option
in the BTRFS Config setup, with minimal change
to the existing code base.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 fs/btrfs/Kconfig   | 42 ++
 fs/btrfs/Makefile  |  2 ++
 fs/btrfs/scrub.c   |  4 
 fs/btrfs/super.c   |  4 
 fs/btrfs/volumes.c |  2 +-
 fs/btrfs/volumes.h |  4 +++-
 6 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
index 80e9c18..1454d21 100644
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -28,6 +28,48 @@ config BTRFS_FS
 
  If unsure, say N.
 
+choice
+ prompt "Choose Stripe Size"
+ default RS_1024
+ help
+   Allows you to select the size of the stripe, which is the smallest 
sized
+   data block to be replicated.
+   Selecting a larger size than your physical block size may lead to 
data
+   fragmentation in some cases.
+
+config RS_512
+ bool "512 bytes"
+
+config RS_1024
+ bool "1024 bytes"
+
+config RS_2048
+ bool "2048 bytes"
+
+config RS_4096
+ bool "4096 bytes"
+
+config RS_8192
+ bool "8192 bytes"
+
+config RS_16384
+ bool "16384 bytes"
+
+config RS_32768
+ bool "32768 bytes"
+
+endchoice
+
+config BTRFS_RAID_STRIPE
+int
+default 512 if RS_512
+default 1024 if RS_1024
+default 2048 if RS_2048
+default 4096 if RS_4096
+default 8192 if RS_8192
+default 16384 if RS_16384
+default 32768 if RS_32768
+
 config BTRFS_FS_POSIX_ACL
bool "Btrfs POSIX Access Control Lists"
depends on BTRFS_FS
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 6d1d0b9..1c4e384 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -17,3 +17,5 @@ btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o
 btrfs-$(CONFIG_BTRFS_FS_RUN_SANITY_TESTS) += tests/free-space-tests.o \
tests/extent-buffer-tests.o tests/btrfs-tests.o \
tests/extent-io-tests.o tests/inode-tests.o tests/qgroup-tests.o
+
+btrfs-$(CONFIG_BTRFS_RAID_STRIPE) += scrub.o super.o volumes.o
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index b091d94..4d0f802 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -63,6 +63,10 @@ struct scrub_ctx;
  */
 #define SCRUB_MAX_PAGES_PER_BLOCK  16  /* 64k per node/leaf/sector */
 
+#define STRIPE_LENGTH CONFIG_BTRFS_RAID_STRIPE
+
+#define BTRFS_STRIPE_LEN   (64 * STRIPE_LENGTH)
+
 struct scrub_recover {
atomic_trefs;
struct btrfs_bio*bbio;
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 24154e4..3d91f8d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -64,6 +64,10 @@
 #define CREATE_TRACE_POINTS
 #include 
 
+#define STRIPE_LENGTH CONFIG_BTRFS_RAID_STRIPE
+
+#define BTRFS_STRIPE_LEN   (64 * STRIPE_LENGTH)
+
 static const struct super_operations btrfs_super_ops;
 static struct file_system_type btrfs_fs_type;
 
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 4564522..e1b2e5c 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4461,7 +4461,7 @@ static int btrfs_cmp_device_info(const void *a, const 
void *b)
 static u32 find_raid56_stripe_len(u32 data_devices, u32 dev_stripe_target)
 {
/* TODO allow them to set a preferred stripe size */
-   return 64 * 1024;
+   return BTRFS_STRIPE_LEN;
 }
 
 static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type)
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index d5c84f6..9115a80 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -26,7 +26,9 @@
 
 extern struct mutex uuid_mutex;
 
-#define BTRFS_STRIPE_LEN   (64 * 1024)
+#define STRIPE_LENGTH CONFIG_BTRFS_RAID_STRIPE
+
+#define BTRFS_STRIPE_LEN   (64 * STRIPE_LENGTH)
 
 struct buffer_head;
 struct btrfs_pending_bios {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header file.

2015-12-15 Thread Sanidhya Solanki
On Tue, 15 Dec 2015 07:55:15 -0700
Mathieu Poirier  wrote:
> I must admit you lost me here - what is this new version about?  I
> suggest you used the [PATCH v#] convention along with a log of
> modifications from one version to another when sending new revisions.
> That way people know what to look for.

It moves the macros that were not nested inside functions to the header
file. See how all the "defines" in the code are moved to skein_block.h?

The patch just changes 7 lines. The change was on the TODO list, under
the heading "Move macros to header files."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header file.

2015-12-15 Thread Sanidhya Solanki
On Tue, 15 Dec 2015 07:55:15 -0700
Mathieu Poirier  wrote:
> I must admit you lost me here - what is this new version about?  I
> suggest you used the [PATCH v#] convention along with a log of
> modifications from one version to another when sending new revisions.
> That way people know what to look for.

It moves the macros that were not nested inside functions to the header
file. See how all the "defines" in the code are moved to skein_block.h?

The patch just changes 7 lines. The change was on the TODO list, under
the heading "Move macros to header files."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] staging: dgnc: Patch updates the TODO file

2015-12-14 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] staging: dgnc: Patch includes CamelCase & Macro fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that led to
checkpatch.pl errors.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->driver_data);
if (rc

Re: [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that led to checkpatch.pl warnings.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235
-
drivers/staging/dgnc/dgnc_neo.h|  22 ++--
drivers/staging/dgnc/dgnc_pci.h|   1 -
drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
drivers/staging/dgnc/dgnc_tty.c|  46 +---
drivers/staging/dgnc/digi.h|  32 ++--- 8 files changed, 223
insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c
b/drivers/staging/dgnc/dgnc_cls.c index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-
writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY |
CH_TX_FIFO_LWM); diff --git a/drivers/staging/dgnc/dgnc_driver.h
b/drivers/staging/dgnc/dgnc_driver.h index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express
board */ 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly
stopped */ #define CH_FORCED_STOPI 0x4  /*
Input is forcibly stopped   */ 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts
*/ ulongch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c
b/drivers/staging/dgnc/dgnc_neo.c index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10,
0x20, 0x40, 0x80 }; +static uint dgnc_offset_table[8] = { 0x01, 0x02,
0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void
neo_set_cts_flow_control(struct channel_t *ch) /* Turn off auto Xon
flow control */ efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ static inline void
neo_set_rts_flow_control(struct channel_t *ch) ier &=
~UART_17158_IER_

Re: [PATCH FIXED 1/3] staging: dgnc: Patch includes spacing fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that led to checkpatch.pl warnings.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ static inline void neo_set_rts_flow_control(str

Re: [PATCH FIXED 3/3] staging: dgnc: Patch updates the TODO file

2015-12-14 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH FIXED 2/3] staging: dgnc: Patch for CamelCase fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that
checkpatch prompted for, as asked by the TODO.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->drive

Re: [PATCH FIXED 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that checkpatch prompted for,
as asked by the TODO.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ static inline void neo_

Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Can you tell me what was incorrect about them?
I thought you requested the dgnc patches to be resent without the
headers.
There are 3 of them because Dan Carpenter asked my patch to be broken
up so each one does only one thing. I also resent you the skein
subsystem patches, as I did not hear anything from you for almost a
week.
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header file.

2015-12-14 Thread Sanidhya Solanki
The original code defined macros in the source code, making it
harder to read. Moved them to the header file, as per the TODO file.

Updated the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/skein/TODO  | 1 -
 drivers/staging/skein/skein_block.c | 6 --
 drivers/staging/skein/skein_block.h | 7 +++
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO
index cd3508d..e3de0c7 100644
--- a/drivers/staging/skein/TODO
+++ b/drivers/staging/skein/TODO
@@ -1,6 +1,5 @@
 skein/threefish TODO
 
- - move macros into appropriate header files
  - add / pass test vectors
  - module support
 
diff --git a/drivers/staging/skein/skein_block.c 
b/drivers/staging/skein/skein_block.c
index 45b4732..2120392 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -26,12 +26,6 @@
 #define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 1024 */
 #endif
 
-#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
-#define KW_TWK_BASE (0)
-#define KW_KEY_BASE (3)
-#define ks  (kw + KW_KEY_BASE)
-#define ts  (kw + KW_TWK_BASE)
-
 #ifdef SKEIN_DEBUG
 #define debug_save_tweak(ctx)   \
 {   \
diff --git a/drivers/staging/skein/skein_block.h 
b/drivers/staging/skein/skein_block.h
index 9d40f4a..0fd4bfe 100644
--- a/drivers/staging/skein/skein_block.h
+++ b/drivers/staging/skein/skein_block.h
@@ -7,6 +7,13 @@
 ** This algorithm and source code is released to the public domain.
 **
 /
+
+#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
+#define KW_TWK_BASE (0)
+#define KW_KEY_BASE (3)
+#define ks  (kw + KW_KEY_BASE)
+#define ts  (kw + KW_TWK_BASE)
+
 #ifndef _SKEIN_BLOCK_H_
 #define _SKEIN_BLOCK_H_
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that checkpatch prompted for,
as asked by the TODO.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ static inline void neo_

Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that
checkpatch prompted for, as asked by the TODO.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->drive

Re: [PATCH 2/3] staging: dgnc: Patch includes CamelCase & Macro fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that led to
checkpatch.pl errors.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->

Re: [PATCH 3/3] staging: dgnc: Patch updates the TODO file

2015-12-14 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header file.

2015-12-14 Thread Sanidhya Solanki
The original code defined macros in the source code, making it
harder to read. Moved them to the header file, as per the TODO file.

Updated the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/skein/TODO  | 1 -
 drivers/staging/skein/skein_block.c | 6 --
 drivers/staging/skein/skein_block.h | 7 +++
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO
index cd3508d..e3de0c7 100644
--- a/drivers/staging/skein/TODO
+++ b/drivers/staging/skein/TODO
@@ -1,6 +1,5 @@
 skein/threefish TODO
 
- - move macros into appropriate header files
  - add / pass test vectors
  - module support
 
diff --git a/drivers/staging/skein/skein_block.c 
b/drivers/staging/skein/skein_block.c
index 45b4732..2120392 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -26,12 +26,6 @@
 #define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 1024 */
 #endif
 
-#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
-#define KW_TWK_BASE (0)
-#define KW_KEY_BASE (3)
-#define ks  (kw + KW_KEY_BASE)
-#define ts  (kw + KW_TWK_BASE)
-
 #ifdef SKEIN_DEBUG
 #define debug_save_tweak(ctx)   \
 {   \
diff --git a/drivers/staging/skein/skein_block.h 
b/drivers/staging/skein/skein_block.h
index 9d40f4a..0fd4bfe 100644
--- a/drivers/staging/skein/skein_block.h
+++ b/drivers/staging/skein/skein_block.h
@@ -7,6 +7,13 @@
 ** This algorithm and source code is released to the public domain.
 **
 /
+
+#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
+#define KW_TWK_BASE (0)
+#define KW_KEY_BASE (3)
+#define ks  (kw + KW_KEY_BASE)
+#define ts  (kw + KW_TWK_BASE)
+
 #ifndef _SKEIN_BLOCK_H_
 #define _SKEIN_BLOCK_H_
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH FIXED 2/3] staging: dgnc: Patch for CamelCase fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that
checkpatch prompted for, as asked by the TODO.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->

Re: [PATCH FIXED 3/3] staging: dgnc: Patch updates the TODO file

2015-12-14 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Can you tell me what was incorrect about them?
I thought you requested the dgnc patches to be resent without the
headers.
There are 3 of them because Dan Carpenter asked my patch to be broken
up so each one does only one thing. I also resent you the skein
subsystem patches, as I did not hear anything from you for almost a
week.
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH FIXED 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that checkpatch prompted for,
as asked by the TODO.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ stat

Re: [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that led to checkpatch.pl warnings.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235
-
drivers/staging/dgnc/dgnc_neo.h|  22 ++--
drivers/staging/dgnc/dgnc_pci.h|   1 -
drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
drivers/staging/dgnc/dgnc_tty.c|  46 +---
drivers/staging/dgnc/digi.h|  32 ++--- 8 files changed, 223
insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c
b/drivers/staging/dgnc/dgnc_cls.c index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-
writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY |
CH_TX_FIFO_LWM); diff --git a/drivers/staging/dgnc/dgnc_driver.h
b/drivers/staging/dgnc/dgnc_driver.h index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express
board */ 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly
stopped */ #define CH_FORCED_STOPI 0x4  /*
Input is forcibly stopped   */ 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts
*/ ulongch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c
b/drivers/staging/dgnc/dgnc_neo.c index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10,
0x20, 0x40, 0x80 }; +static uint dgnc_offset_table[8] = { 0x01, 0x02,
0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void
neo_set_cts_flow_control(struct channel_t *ch) /* Turn off auto Xon
flow control */ efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before
setting it */
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ static inline void
neo_set_rts_flow_control(struct channel_t *

Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that checkpatch prompted for,
as asked by the TODO.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ stat

Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that
checkpatch prompted for, as asked by the TODO.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->

Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-14 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH FIXED 1/3] staging: dgnc: Patch includes spacing fixes

2015-12-14 Thread Sanidhya Solanki
Patch contains the spacing fixes that led to checkpatch.pl warnings.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>ch_neo_uart->fctr);
+   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY),
+  >ch_neo_uart->fctr);
 
/* Feed the UART our trigger levels */
writeb(8, >ch_neo_uart->tfifo);
@@ -144,13 +148,16 @@ static inline voi

Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Sorry about Patch 1/3 having the header information. The rest should be fine.

I broke up the patches as you requested.

I can also confirm that git am gives me an error if the patch to be applied
does not contain the header information. Specifically, "Patch format detection 
failed.".
Yes, this is only after I email myself the patch, reset to the cloned git 
directory,
and then apply the patch. "git apply --check" returns no error in this scenario.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that
checkpatch prompted for, as asked by the TODO.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->drive

Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
>From a1635ea5e75cb2f10728ae4ddf3a21567958e98f Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki 
Date: Sat, 12 Dec 2015 02:20:03 -0500
Subject: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch
 fixes

Patch contains the spacing fixes that checkpatch prompted for,
as asked by the TODO.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>ch_neo_uart->fctr);
+   writeb((UAR

Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Thank you everyone for your concern regarding my email client.

Unfortunately, there is a bug in "git send-email" that leads to the gmail 
SMTP server rejecting certain patches sent by the git command. If I can
replicate and fix the issue for " git am" (which I do apply after emailing
to myself) I will not send the git header anymore. 

This bug is well documented. It presents itself as an error in line 1351/1320
in a gitconfig file. Rest assured you will not see the git header again.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Thank you everyone for your concern regarding my email client.

Unfortunately, there is a bug in "git send-email" that leads to the gmail 
SMTP server rejecting certain patches sent by the git command. If I can
replicate and fix the issue for " git am" (which I do apply after emailing
to myself) I will not send the git header anymore. 

This bug is well documented. It presents itself as an error in line 1351/1320
in a gitconfig file. Rest assured you will not see the git header again.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Patch updates the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Patch contains the CamelCase fixes & Macro fixes that
checkpatch prompted for, as asked by the TODO.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  25 ++--
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 226 +
 drivers/staging/dgnc/dgnc_sysfs.c  | 134 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 
 drivers/staging/dgnc/digi.h|  20 ++--
 7 files changed, 367 insertions(+), 319 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_Major = rc;
+   dgnc_major = rc;
 
dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt");
if (IS_ERR(dgnc_class)) {
@@ -237,7 +237,7 @@ static int dgnc_start(void)
}
 
dev = device_create(dgnc_class, NULL,
-   MKDEV(dgnc_Major, 0),
+   MKDEV(dgnc_major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
@@ -267,11 +267,11 @@ static int dgnc_start(void)
return 0;
 
 failed_tty:
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
 failed_device:
class_destroy(dgnc_class);
 failed_class:
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
return rc;
 }
 
@@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct 
pci_device_id *ent)
} else {
rc = dgnc_found_board(pdev, ent->

Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
>From a1635ea5e75cb2f10728ae4ddf3a21567958e98f Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki <jpage.l...@gmail.com>
Date: Sat, 12 Dec 2015 02:20:03 -0500
Subject: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch
 fixes

Patch contains the spacing fixes that checkpatch prompted for,
as asked by the TODO.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.h |   8 --
 drivers/staging/dgnc/dgnc_neo.c| 235 -
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  |  18 ++-
 drivers/staging/dgnc/dgnc_tty.c|  46 +---
 drivers/staging/dgnc/digi.h|  32 ++---
 8 files changed, 223 insertions(+), 143 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.h 
b/drivers/staging/dgnc/dgnc_driver.h
index ce7cd9b..e4be81b 100644
--- a/drivers/staging/dgnc/dgnc_driver.h
+++ b/drivers/staging/dgnc/dgnc_driver.h
@@ -88,7 +88,6 @@
 #define   _POSIX_VDISABLE '\0'
 #endif
 
-
 /*
  * All the possible states the driver can be while being loaded.
  */
@@ -106,7 +105,6 @@ enum {
BOARD_READY
 };
 
-
 /*
  *
  * Structures and closely related defines.
@@ -145,7 +143,6 @@ struct board_ops {
  /
 #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */
 
-
 /*
  * Per-board information
  */
@@ -241,7 +238,6 @@ struct dgnc_board {
 
 };
 
-
 /
  * Unit flag definitions for un_flags.
  /
@@ -277,7 +273,6 @@ struct un_t {
struct device *un_sysfs;
 };
 
-
 /
  * Device flag definitions for ch_flags.
  /
@@ -300,7 +295,6 @@ struct un_t {
 #define CH_FORCED_STOP  0x2/* Output is forcibly stopped   
*/
 #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped
*/
 
-
 /* Our Read/Error/Write queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
@@ -309,7 +303,6 @@ struct un_t {
 #define EQUEUESIZE RQUEUESIZE
 #define WQUEUESIZE (WQUEUEMASK + 1)
 
-
 /
  * Channel information structure.
  /
@@ -397,7 +390,6 @@ struct channel_t {
ulong   ch_intr_tx; /* Count of interrupts */
ulong   ch_intr_rx; /* Count of interrupts */
 
-
/* /proc// entries */
struct proc_dir_entry *proc_entry_pointer;
struct dgnc_proc_entry *dgnc_channel_table;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 8106f52..2b94b75 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = {
.send_immediate_char =  neo_send_immediate_char
 };
 
-static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 
0x80 };
+static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08,
+   0x10, 0x20, 0x40, 0x80 };
 
 /*
  * This function allows calls to ensure that all outstanding
@@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct 
channel_t *ch)
/* Turn off auto Xon flow control */
efr &= ~UART_17158_EFR_IXON;
 
-   /* Why? Becuz Exar's spec says we have to zero it out before setting it 
*/
+   /* Why? Becuz Exar's spec says we have to
+* zero it out before setting it.
+*/
writeb(0, >ch_neo_uart->efr);
 
/* Turn on UART enhanced bits */
writeb(efr, >ch_neo_uart->efr);
 
/* Turn on table D, with 8 char hi/low watermarks */
-   writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), 
>c

Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-12 Thread Sanidhya Solanki
Sorry about Patch 1/3 having the header information. The rest should be fine.

I broke up the patches as you requested.

I can also confirm that git am gives me an error if the patch to be applied
does not contain the header information. Specifically, "Patch format detection 
failed.".
Yes, this is only after I email myself the patch, reset to the cloned git 
directory,
and then apply the patch. "git apply --check" returns no error in this scenario.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
On Fri, 11 Dec 2015 16:02:33 +0300
Dan Carpenter  wrote:

> On Fri, Dec 11, 2015 at 03:21:49AM -0500, Sanidhya Solanki wrote:
> > >From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001
> > From: Sanidhya Solanki 
> > Date: Fri, 11 Dec 2015 03:08:53 -0500
> > Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
> 
> 
> Don't include this stuff.
Whenever I remove that part, the "git am" command gives me an error that
it cannot detect patch format and the patch application fails.

Thanks for the macro information. I misunderstood initially and thought you 
wanted me to get rid of the entire code block included in the do-while, 
rather than just replacing the do-while loop with the code. I sent you 
an update patch that does just that and a separate patch that includes 
the TODO file update.

Any more errors in the code regarding parenthesis alignment are a 
checkpatch bug, which you can visually reconfirm.

Also, any more requests by checkpatch to further breakup the remaining
long lines may further degrade readablility due to presence of arrow
pointers.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: dgnc: Update the TODO file

2015-12-11 Thread Sanidhya Solanki
>From ae99848ed2c054e3ec031b3014f4727f6ff94ea3 Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki 
Date: Fri, 11 Dec 2015 21:12:35 -0500
Subject: [PATCH 2/2] staging: dgnc: Update the TODO file

Patch updates the TODO file. Line regarding checkpatch
changes removed.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH: FIXED} staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
>From fa54ad27ad5ba8c90e0b42901af09423b1b3d0c7 Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki 
Date: Fri, 11 Dec 2015 21:08:06 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Patch contains the checkpatch fixes as asked by the TODO.
Unnecessary do-while() loops are removed as well.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  33 +++---
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 229 ++---
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  | 140 ++-
 drivers/staging/dgnc/dgnc_tty.c| 197 +++
 drivers/staging/dgnc/digi.h|  44 +++
 10 files changed, 441 insertions(+), 313 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
return rc;
}
-   dgnc_

Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
On Fri, 11 Dec 2015 16:02:33 +0300
Dan Carpenter  wrote:

> > Signed-off-by: Sanidhya Solanki 
> > @@ -110,7 +98,16 @@ static ssize_t dgnc_vpd_show(struct device *p, struct 
> > device_attribute *attr,
> > int count = 0;
> > int i = 0;
> >  
> > -   DGNC_VERIFY_BOARD(p, bd);
> > +   do {
> > +   if (!p)
> > +   return 0;
> > +
> > +   bd = dev_get_drvdata(p);
> > +   if (!bd || bd->magic != DGNC_BOARD_MAGIC)
> > +   return 0;
> > +   if (bd->state != BOARD_READY)
> > +   return 0;
> > +   } while (0);
> 
> Google about why do while(0) loops are used in macros and then redo
> this.  Mostly the patch isn't bad, but I suspect I'm going to complain
> about how you split up some of the long lines.

Let me just be completely sure that you and I are on the same page here. The 
macro was used to replace the do-while loop, I replaced all instances of the 
macro with the the actual loop. Both pieces were originally part of the code, 
just using macros in place of do-while statements. Do you still want me to 
change it? Maybe the original author did it for a specific reason.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
>From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki 
Date: Fri, 11 Dec 2015 03:08:53 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Patch contains the checkpatch fixes as asked by the TODO.
TODO file is updated as well.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/dgnc/TODO  |   1 -
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  33 +++---
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 229 ++---
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  | 163 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 +++
 drivers/staging/dgnc/digi.h|  44 +++
 11 files changed, 464 insertions(+), 314 deletions(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_st

[PATCH] staging: gdm72xx: Code cleanups

2015-12-11 Thread Sanidhya Solanki
>From c07c57f3e045865b0acae498c631189f24aeda0b Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki 
Date: Thu, 10 Dec 2015 21:13:10 -0500
Subject: [PATCH] staging: gdm72xx: Code cleanups

Code cleanups as per the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/gdm72xx/gdm_qos.c   | 54 +++
 drivers/staging/gdm72xx/gdm_sdio.c  |  4 +--
 drivers/staging/gdm72xx/gdm_usb.c   |  3 +-
 drivers/staging/gdm72xx/gdm_usb.h   |  4 +--
 drivers/staging/gdm72xx/gdm_wimax.c | 18 +--
 drivers/staging/gdm72xx/hci.h   | 11 +++
 drivers/staging/gdm72xx/netlink_k.c |  8 ++---
 drivers/staging/gdm72xx/sdio_boot.c |  2 +-
 drivers/staging/gdm72xx/usb_boot.c  | 10 +++---
 drivers/staging/gdm72xx/usb_ids.h   | 64 ++---
 10 files changed, 88 insertions(+), 90 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
b/drivers/staging/gdm72xx/gdm_qos.c
index 81feffa..c03204b 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -101,7 +101,7 @@ void gdm_qos_init(void *nic_ptr)
}
 
qcb->qos_list_cnt = 0;
-   qcb->qos_null_idx = QOS_MAX-1;
+   qcb->qos_null_idx = QOS_MAX - 1;
qcb->qos_limit_size = 255;
 
spin_lock_init(>qos_lock);
@@ -128,7 +128,7 @@ void gdm_qos_release_list(void *nic_ptr)
}
 
qcb->qos_list_cnt = 0;
-   qcb->qos_null_idx = QOS_MAX-1;
+   qcb->qos_null_idx = QOS_MAX - 1;
 
for (i = 0; i < QOS_MAX; i++) {
list_for_each_entry_safe(entry, n, >qos_list[i], list) {
@@ -143,18 +143,18 @@ static int chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 
*stream, u8 *port)
 {
int i;
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & IPTYPEOFSERVICE) {
if (((stream[1] & csr->ip2s_mask) < csr->ip2s_lo) ||
((stream[1] & csr->ip2s_mask) > csr->ip2s_hi))
return 1;
}
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & PROTOCOL) {
if (stream[9] != csr->protocol)
return 1;
}
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & IPMASKEDSRCADDRESS) {
for (i = 0; i < 4; i++) {
if ((stream[12 + i] & csr->ipsrc_addrmask[i]) !=
(csr->ipsrc_addr[i] & csr->ipsrc_addrmask[i]))
@@ -162,7 +162,7 @@ static int chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 
*stream, u8 *port)
}
}
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & IPMASKEDDSTADDRESS) {
for (i = 0; i < 4; i++) {
if ((stream[16 + i] & csr->ipdst_addrmask[i]) !=
(csr->ipdst_addr[i] & csr->ipdst_addrmask[i]))
@@ -170,14 +170,14 @@ static int chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 
*stream, u8 *port)
}
}
 
-   if (csr->classifier_rule_en) {
-   i = ((port[0]<<8)&0xff00)+port[1];
+   if (csr->classifier_rule_en & PROTOCOLSRCPORTRANGE) {
+   i = ((port[0] << 8) & 0xff00) + port[1];
if ((i < csr->srcport_lo) || (i > csr->srcport_hi))
return 1;
}
 
-   if (csr->classifier_rule_en) {
-   i = ((port[2]<<8)&0xff00)+port[3];
+   if (csr->classifier_rule_en & PROTOCOLDSTPORTRANGE) {
+   i = ((port[2] << 8) & 0xff00) + port[3];
if ((i < csr->dstport_lo) || (i > csr->dstport_hi))
return 1;
}
@@ -193,7 +193,7 @@ static int get_qos_index(struct nic *nic, u8 *iph, u8 
*tcpudph)
if (!iph || !tcpudph)
return -1;
 
-   ip_ver = (iph[0]>>4)&0xf;
+   ip_ver = (iph[0] >> 4) & 0xf;
 
if (ip_ver != 4)
return -1;
@@ -261,7 +261,7 @@ int gdm_qos_send_hci_pkt(struct sk_buff *skb, struct 
net_device *dev)
struct list_head send_list;
int ret = 0;
 
-   tcph = (struct tcphdr *)iph + iph->ihl*4;
+   tcph = (struct tcphdr *)iph + iph->ihl * 4;
 
if (ethh->h_proto == cpu_to_be16(ETH_P_IP)) {
if (qcb->qos_list_cnt && !qos_free_list.cnt) {
@@ -342,17 +342,17 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int 
size)
if (sub_cmd_evt == QOS_REPORT) {
spin_lock_irqsave(>qos_lock, flags);
for (i = 0; i < qcb->qos_list_cnt; i++) {
-   sfid = ((buf[(i*5)+6]<<24)&0xff00);
-   sfid += ((buf[(i*5)+7]<<16)&0xff);
-   sfid += ((buf[(i*5)+8]<&l

[PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
>From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki <jpage.l...@gmail.com>
Date: Fri, 11 Dec 2015 03:08:53 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Patch contains the checkpatch fixes as asked by the TODO.
TODO file is updated as well.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/TODO  |   1 -
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  33 +++---
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 229 ++---
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  | 163 +-
 drivers/staging/dgnc/dgnc_tty.c| 197 +++
 drivers/staging/dgnc/digi.h|  44 +++
 11 files changed, 464 insertions(+), 314 deletions(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Class

[PATCH] staging: gdm72xx: Code cleanups

2015-12-11 Thread Sanidhya Solanki
>From c07c57f3e045865b0acae498c631189f24aeda0b Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki <jpage.l...@gmail.com>
Date: Thu, 10 Dec 2015 21:13:10 -0500
Subject: [PATCH] staging: gdm72xx: Code cleanups

Code cleanups as per the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/gdm72xx/gdm_qos.c   | 54 +++
 drivers/staging/gdm72xx/gdm_sdio.c  |  4 +--
 drivers/staging/gdm72xx/gdm_usb.c   |  3 +-
 drivers/staging/gdm72xx/gdm_usb.h   |  4 +--
 drivers/staging/gdm72xx/gdm_wimax.c | 18 +--
 drivers/staging/gdm72xx/hci.h   | 11 +++
 drivers/staging/gdm72xx/netlink_k.c |  8 ++---
 drivers/staging/gdm72xx/sdio_boot.c |  2 +-
 drivers/staging/gdm72xx/usb_boot.c  | 10 +++---
 drivers/staging/gdm72xx/usb_ids.h   | 64 ++---
 10 files changed, 88 insertions(+), 90 deletions(-)

diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
b/drivers/staging/gdm72xx/gdm_qos.c
index 81feffa..c03204b 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -101,7 +101,7 @@ void gdm_qos_init(void *nic_ptr)
}
 
qcb->qos_list_cnt = 0;
-   qcb->qos_null_idx = QOS_MAX-1;
+   qcb->qos_null_idx = QOS_MAX - 1;
qcb->qos_limit_size = 255;
 
spin_lock_init(>qos_lock);
@@ -128,7 +128,7 @@ void gdm_qos_release_list(void *nic_ptr)
}
 
qcb->qos_list_cnt = 0;
-   qcb->qos_null_idx = QOS_MAX-1;
+   qcb->qos_null_idx = QOS_MAX - 1;
 
for (i = 0; i < QOS_MAX; i++) {
list_for_each_entry_safe(entry, n, >qos_list[i], list) {
@@ -143,18 +143,18 @@ static int chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 
*stream, u8 *port)
 {
int i;
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & IPTYPEOFSERVICE) {
if (((stream[1] & csr->ip2s_mask) < csr->ip2s_lo) ||
((stream[1] & csr->ip2s_mask) > csr->ip2s_hi))
return 1;
}
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & PROTOCOL) {
if (stream[9] != csr->protocol)
return 1;
}
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & IPMASKEDSRCADDRESS) {
for (i = 0; i < 4; i++) {
if ((stream[12 + i] & csr->ipsrc_addrmask[i]) !=
(csr->ipsrc_addr[i] & csr->ipsrc_addrmask[i]))
@@ -162,7 +162,7 @@ static int chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 
*stream, u8 *port)
}
}
 
-   if (csr->classifier_rule_en) {
+   if (csr->classifier_rule_en & IPMASKEDDSTADDRESS) {
for (i = 0; i < 4; i++) {
if ((stream[16 + i] & csr->ipdst_addrmask[i]) !=
(csr->ipdst_addr[i] & csr->ipdst_addrmask[i]))
@@ -170,14 +170,14 @@ static int chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 
*stream, u8 *port)
}
}
 
-   if (csr->classifier_rule_en) {
-   i = ((port[0]<<8)&0xff00)+port[1];
+   if (csr->classifier_rule_en & PROTOCOLSRCPORTRANGE) {
+   i = ((port[0] << 8) & 0xff00) + port[1];
if ((i < csr->srcport_lo) || (i > csr->srcport_hi))
return 1;
}
 
-   if (csr->classifier_rule_en) {
-   i = ((port[2]<<8)&0xff00)+port[3];
+   if (csr->classifier_rule_en & PROTOCOLDSTPORTRANGE) {
+   i = ((port[2] << 8) & 0xff00) + port[3];
if ((i < csr->dstport_lo) || (i > csr->dstport_hi))
return 1;
}
@@ -193,7 +193,7 @@ static int get_qos_index(struct nic *nic, u8 *iph, u8 
*tcpudph)
if (!iph || !tcpudph)
return -1;
 
-   ip_ver = (iph[0]>>4)&0xf;
+   ip_ver = (iph[0] >> 4) & 0xf;
 
if (ip_ver != 4)
return -1;
@@ -261,7 +261,7 @@ int gdm_qos_send_hci_pkt(struct sk_buff *skb, struct 
net_device *dev)
struct list_head send_list;
int ret = 0;
 
-   tcph = (struct tcphdr *)iph + iph->ihl*4;
+   tcph = (struct tcphdr *)iph + iph->ihl * 4;
 
if (ethh->h_proto == cpu_to_be16(ETH_P_IP)) {
if (qcb->qos_list_cnt && !qos_free_list.cnt) {
@@ -342,17 +342,17 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int 
size)
if (sub_cmd_evt == QOS_REPORT) {
spin_lock_irqsave(>qos_lock, flags);
for (i = 0; i < qcb->qos_list_cnt; i++) {
-   sfid = ((buf[(i*5)+6]<<24)&0xff00);
-   sfid += ((buf[(i*5)+7]<<16)&0xff);

Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
On Fri, 11 Dec 2015 16:02:33 +0300
Dan Carpenter <dan.carpen...@oracle.com> wrote:

> > Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
> > @@ -110,7 +98,16 @@ static ssize_t dgnc_vpd_show(struct device *p, struct 
> > device_attribute *attr,
> > int count = 0;
> > int i = 0;
> >  
> > -   DGNC_VERIFY_BOARD(p, bd);
> > +   do {
> > +   if (!p)
> > +   return 0;
> > +
> > +   bd = dev_get_drvdata(p);
> > +   if (!bd || bd->magic != DGNC_BOARD_MAGIC)
> > +   return 0;
> > +   if (bd->state != BOARD_READY)
> > +   return 0;
> > +   } while (0);
> 
> Google about why do while(0) loops are used in macros and then redo
> this.  Mostly the patch isn't bad, but I suspect I'm going to complain
> about how you split up some of the long lines.

Let me just be completely sure that you and I are on the same page here. The 
macro was used to replace the do-while loop, I replaced all instances of the 
macro with the the actual loop. Both pieces were originally part of the code, 
just using macros in place of do-while statements. Do you still want me to 
change it? Maybe the original author did it for a specific reason.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: dgnc: Update the TODO file

2015-12-11 Thread Sanidhya Solanki
>From ae99848ed2c054e3ec031b3014f4727f6ff94ea3 Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki <jpage.l...@gmail.com>
Date: Fri, 11 Dec 2015 21:12:35 -0500
Subject: [PATCH 2/2] staging: dgnc: Update the TODO file

Patch updates the TODO file. Line regarding checkpatch
changes removed.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO
index 0e0825b..0bdfd26 100644
--- a/drivers/staging/dgnc/TODO
+++ b/drivers/staging/dgnc/TODO
@@ -1,4 +1,3 @@
-* checkpatch fixes
 * remove unnecessary comments
 * remove unnecessary error messages. Example kzalloc() has its
   own error message. Adding an extra one is useless.
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH: FIXED} staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
>From fa54ad27ad5ba8c90e0b42901af09423b1b3d0c7 Mon Sep 17 00:00:00 2001
From: Sanidhya Solanki <jpage.l...@gmail.com>
Date: Fri, 11 Dec 2015 21:08:06 -0500
Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

Patch contains the checkpatch fixes as asked by the TODO.
Unnecessary do-while() loops are removed as well.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/dgnc/dgnc_cls.c|   4 +-
 drivers/staging/dgnc/dgnc_driver.c |  56 -
 drivers/staging/dgnc/dgnc_driver.h |  33 +++---
 drivers/staging/dgnc/dgnc_mgmt.c   |  28 ++---
 drivers/staging/dgnc/dgnc_neo.c| 229 ++---
 drivers/staging/dgnc/dgnc_neo.h|  22 ++--
 drivers/staging/dgnc/dgnc_pci.h|   1 -
 drivers/staging/dgnc/dgnc_sysfs.c  | 140 ++-
 drivers/staging/dgnc/dgnc_tty.c| 197 +++
 drivers/staging/dgnc/digi.h|  44 +++
 10 files changed, 441 insertions(+), 313 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 75040da..d312d35 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch)
/* Clear out UART and FIFO */
readb(>ch_cls_uart->txrx);
 
-   writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
-  >ch_cls_uart->isr_fcr);
+   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR |
+  UART_FCR_CLEAR_XMIT), >ch_cls_uart->isr_fcr);
udelay(10);
 
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.c 
b/drivers/staging/dgnc/dgnc_driver.c
index fc6d298..37fb8f9 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -48,7 +48,7 @@ static void   dgnc_do_remap(struct dgnc_board *brd);
 /*
  * File operations permitted on Control/Management major.
  */
-static const struct file_operations dgnc_BoardFops = {
+static const struct file_operations dgnc_board_fops = {
.owner  =   THIS_MODULE,
.unlocked_ioctl =   dgnc_mgmt_ioctl,
.open   =   dgnc_mgmt_open,
@@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = {
 /*
  * Globals
  */
-uint   dgnc_NumBoards;
-struct dgnc_board  *dgnc_Board[MAXBOARDS];
+uint   dgnc_num_boards;
+struct dgnc_board  *dgnc_board[MAXBOARDS];
 DEFINE_SPINLOCK(dgnc_global_lock);
 DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */
-uint   dgnc_Major;
+uint   dgnc_major;
 intdgnc_poll_tick = 20;/* Poll interval - 20 ms */
 
 /*
@@ -92,7 +92,7 @@ struct board_id {
unsigned int is_pci_express;
 };
 
-static struct board_id dgnc_Ids[] = {
+static struct board_id dgnc_ids[] = {
{   PCI_DEVICE_CLASSIC_4_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_4_422_PCI_NAME,  4,  0   },
{   PCI_DEVICE_CLASSIC_8_PCI_NAME,  8,  0   },
@@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void)
 
dgnc_remove_driver_sysfiles(_driver);
 
-   device_destroy(dgnc_class, MKDEV(dgnc_Major, 0));
+   device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
-   unregister_chrdev(dgnc_Major, "dgnc");
+   unregister_chrdev(dgnc_major, "dgnc");
 
-   for (i = 0; i < dgnc_NumBoards; ++i) {
-   dgnc_remove_ports_sysfiles(dgnc_Board[i]);
-   dgnc_tty_uninit(dgnc_Board[i]);
-   dgnc_cleanup_board(dgnc_Board[i]);
+   for (i = 0; i < dgnc_num_boards; ++i) {
+   dgnc_remove_ports_sysfiles(dgnc_board[i]);
+   dgnc_tty_uninit(dgnc_board[i]);
+   dgnc_cleanup_board(dgnc_board[i]);
}
 
dgnc_tty_post_uninit();
 
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
 }
 
@@ -187,7 +187,7 @@ static int __init dgnc_init_module(void)
 */
if (rc < 0) {
/* Only unregister if it was actually registered. */
-   if (dgnc_NumBoards)
+   if (dgnc_num_boards)
pci_unregister_driver(_driver);
else
pr_warn("WARNING: dgnc driver load failed.  No Digi Neo 
or Classic boards found.\n");
@@ -222,12 +222,12 @@ static int dgnc_start(void)
 *
 * Register management/dpa devices
 */
-   rc = register_chrdev(0, "dgnc", _BoardFops);
+   rc = register_chrdev(0, "dgnc", _board_fops);
if (rc < 0) {
pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc);
  

Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes

2015-12-11 Thread Sanidhya Solanki
On Fri, 11 Dec 2015 16:02:33 +0300
Dan Carpenter <dan.carpen...@oracle.com> wrote:

> On Fri, Dec 11, 2015 at 03:21:49AM -0500, Sanidhya Solanki wrote:
> > >From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001
> > From: Sanidhya Solanki <jpage.l...@gmail.com>
> > Date: Fri, 11 Dec 2015 03:08:53 -0500
> > Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
> 
> 
> Don't include this stuff.
Whenever I remove that part, the "git am" command gives me an error that
it cannot detect patch format and the patch application fails.

Thanks for the macro information. I misunderstood initially and thought you 
wanted me to get rid of the entire code block included in the do-while, 
rather than just replacing the do-while loop with the code. I sent you 
an update patch that does just that and a separate patch that includes 
the TODO file update.

Any more errors in the code regarding parenthesis alignment are a 
checkpatch bug, which you can visually reconfirm.

Also, any more requests by checkpatch to further breakup the remaining
long lines may further degrade readablility due to presence of arrow
pointers.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: Skein: Moved macros from skein_block.c to header file.

2015-12-07 Thread Sanidhya Solanki
The original code defined macros in the source code, making it
harder to read. Moved them to the header file, as per the TODO file.

Upadated the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/skein/TODO  | 1 -
 drivers/staging/skein/skein_block.c | 6 --
 drivers/staging/skein/skein_block.h | 7 +++
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO
index cd3508d..e3de0c7 100644
--- a/drivers/staging/skein/TODO
+++ b/drivers/staging/skein/TODO
@@ -1,6 +1,5 @@
 skein/threefish TODO
 
- - move macros into appropriate header files
  - add / pass test vectors
  - module support
 
diff --git a/drivers/staging/skein/skein_block.c 
b/drivers/staging/skein/skein_block.c
index 45b4732..2120392 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -26,12 +26,6 @@
 #define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 1024 */
 #endif
 
-#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
-#define KW_TWK_BASE (0)
-#define KW_KEY_BASE (3)
-#define ks  (kw + KW_KEY_BASE)
-#define ts  (kw + KW_TWK_BASE)
-
 #ifdef SKEIN_DEBUG
 #define debug_save_tweak(ctx)   \
 {   \
diff --git a/drivers/staging/skein/skein_block.h 
b/drivers/staging/skein/skein_block.h
index 9d40f4a..0fd4bfe 100644
--- a/drivers/staging/skein/skein_block.h
+++ b/drivers/staging/skein/skein_block.h
@@ -7,6 +7,13 @@
 ** This algorithm and source code is released to the public domain.
 **
 /
+
+#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
+#define KW_TWK_BASE (0)
+#define KW_KEY_BASE (3)
+#define ks  (kw + KW_KEY_BASE)
+#define ts  (kw + KW_TWK_BASE)
+
 #ifndef _SKEIN_BLOCK_H_
 #define _SKEIN_BLOCK_H_
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header

2015-12-07 Thread Sanidhya Solanki
On Mon, 7 Dec 2015 11:37:31 +0530
Sudip Mukherjee  wrote:

> And you moved skein_256_process_block() from skein_block.c to a header
> file. Is skein_256_process_block() a macro?

No, it is not a macro, it is a conditional. But as other conditionals
was already included in the header file, I felt that it was
appropriate to move other conditionals as well. However, I will undo
that and test a patch, which I can send to you after making sure it
does not get mangled.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: Skein: Moved macros from skein_block.c to header file.

2015-12-07 Thread Sanidhya Solanki
The original code defined macros in the source code, making it
harder to read. Moved them to the header file, as per the TODO file.

Upadated the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/skein/TODO  | 1 -
 drivers/staging/skein/skein_block.c | 6 --
 drivers/staging/skein/skein_block.h | 7 +++
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO
index cd3508d..e3de0c7 100644
--- a/drivers/staging/skein/TODO
+++ b/drivers/staging/skein/TODO
@@ -1,6 +1,5 @@
 skein/threefish TODO
 
- - move macros into appropriate header files
  - add / pass test vectors
  - module support
 
diff --git a/drivers/staging/skein/skein_block.c 
b/drivers/staging/skein/skein_block.c
index 45b4732..2120392 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -26,12 +26,6 @@
 #define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 1024 */
 #endif
 
-#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
-#define KW_TWK_BASE (0)
-#define KW_KEY_BASE (3)
-#define ks  (kw + KW_KEY_BASE)
-#define ts  (kw + KW_TWK_BASE)
-
 #ifdef SKEIN_DEBUG
 #define debug_save_tweak(ctx)   \
 {   \
diff --git a/drivers/staging/skein/skein_block.h 
b/drivers/staging/skein/skein_block.h
index 9d40f4a..0fd4bfe 100644
--- a/drivers/staging/skein/skein_block.h
+++ b/drivers/staging/skein/skein_block.h
@@ -7,6 +7,13 @@
 ** This algorithm and source code is released to the public domain.
 **
 /
+
+#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
+#define KW_TWK_BASE (0)
+#define KW_KEY_BASE (3)
+#define ks  (kw + KW_KEY_BASE)
+#define ts  (kw + KW_TWK_BASE)
+
 #ifndef _SKEIN_BLOCK_H_
 #define _SKEIN_BLOCK_H_
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header

2015-12-07 Thread Sanidhya Solanki
On Mon, 7 Dec 2015 11:37:31 +0530
Sudip Mukherjee  wrote:

> And you moved skein_256_process_block() from skein_block.c to a header
> file. Is skein_256_process_block() a macro?

No, it is not a macro, it is a conditional. But as other conditionals
was already included in the header file, I felt that it was
appropriate to move other conditionals as well. However, I will undo
that and test a patch, which I can send to you after making sure it
does not get mangled.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Documentation: email-clients.txt

2015-12-06 Thread Sanidhya Solanki
So, now that everyone has sounded off about their clients, I guess we
can know how people still use the clients that are included in the
documentation.

As a side note, JC, I think I have figured out why the patch did not
apply for you but works for me. It appears, ostensibly, that when
using CLaws 3.12 on Fedora, I can send patches that seem to work only
after inserting the file. If I add anything in the compose window after
inserting the patch, the client appears to mangle it. That would
explain the issues you experienced and  I still seem to be having. 

As an aside, I do send every patch to myself on multiple accounts using
Claws, then compare the SHA512 hash, and as a final measure reset git
and reapply the patch. Only then do I send it to the mailing list.

If no one else provides a patch including the information supplied by
this email chain in 5 days, then I will collect it all and send it to
you in a patch.

Best give people a few days to claim their findings as their own,
without delaying it too much.

Try the patch I just send you.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Documentation: email-clients.txt

2015-12-06 Thread Sanidhya Solanki
[PATCH] Documentation: email-clients.txt

The information for Claws Mail, Evolution and Thunderbird was out of
date. It has been updated with new instructions and warnings.

Signed-off-by: Sanidhya Solanki 
---
 Documentation/email-clients.txt | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/email-clients.txt
b/Documentation/email-clients.txt index 2d485de..8819c90 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -79,17 +79,27 @@ to insert into the message.
 ~~
 Claws Mail (GUI)
 
-Works. Some people use this successfully for patches.
+Tested and Works as of December 2015. Some people use this successfully
+for patches.
 
 To insert a patch use Message->Insert File (CTRL+i) or an external
editor. 
 If the inserted patch has to be edited in the Claws composition window
 "Auto wrapping" in Configuration->Preferences->Compose->Wrapping
should be -disabled.
+disabled. Also, under the heading "View", sub-heading "Character
Encoding" +, choose "Unicode (UTF - 8)"
+
+Do remember that if you insert or type something in the main text area,
+and decide to delete it, you will need to reset the formatting by
opening +a new window for the change you want to make. Re-using the
window in which +you deleted the text will lead to the new message
being mangled. 
 ~~
 Evolution (GUI)
 
+As of December 2015, the composing & inserting  method described below
+does not work.
+
 Some people use this successfully for patches.
 
 When composing mail select: Preformat
@@ -244,8 +254,9 @@ Sylpheed (GUI)
 ~~
 Thunderbird (GUI)
 
-Thunderbird is an Outlook clone that likes to mangle text, but there
are ways -to coerce it into behaving.
+Thunderbird is an Outlook clone that likes to mangle text, but there
are +ways to coerce it into behaving. In December 2015, the internal
editor +options do not appear to work.
 
 - Allow use of an external editor:
   The easiest thing to do with Thunderbird and patches is to use an
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Documentation: email-clients.txt

2015-12-06 Thread Sanidhya Solanki
Patch included below. As an aside, thank you for the excellent work on
the books and other documentation.


Documentation: email-clients.txt

The information for Claws Mail, Evolution and Thunderbird was out of
date. It has been updated with new instructions and warnings.

Signed-off-by: Sanidhya Solanki 
---
 Documentation/email-clients.txt | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/email-clients.txt
b/Documentation/email-clients.txt index 2d485de..8819c90 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -79,17 +79,27 @@ to insert into the message.
 ~~
 Claws Mail (GUI)
 
-Works. Some people use this successfully for patches.
+Tested and Works as of December 2015. Some people use this successfully
+for patches.
 
 To insert a patch use Message->Insert File (CTRL+i) or an external
editor. 
 If the inserted patch has to be edited in the Claws composition window
 "Auto wrapping" in Configuration->Preferences->Compose->Wrapping
should be -disabled.
+disabled. Also, under the heading "View", sub-heading "Character
Encoding" +, choose "Unicode (UTF - 8)"
+
+Do remember that if you insert or type something in the main text area,
+and decide to delete it, you will need to reset the formatting by
opening +a new window for the change you want to make. Re-using the
window in which +you deleted the text will lead to the new message
being mangled. 
 ~~
 Evolution (GUI)
 
+As of December 2015, the composing & inserting  method described below
+does not work.
+
 Some people use this successfully for patches.
 
 When composing mail select: Preformat
@@ -244,8 +254,9 @@ Sylpheed (GUI)
 ~~
 Thunderbird (GUI)
 
-Thunderbird is an Outlook clone that likes to mangle text, but there
are ways -to coerce it into behaving.
+Thunderbird is an Outlook clone that likes to mangle text, but there
are +ways to coerce it into behaving. In December 2015, the internal
editor +options do not appear to work.
 
 - Allow use of an external editor:
   The easiest thing to do with Thunderbird and patches is to use an
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Documentation: email-clients.txt

2015-12-06 Thread Sanidhya Solanki
Patch included below. As an aside, thank you for the excellent work on
the books and other documentation.


Documentation: email-clients.txt

The information for Claws Mail, Evolution and Thunderbird was out of
date. It has been updated with new instructions and warnings.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 Documentation/email-clients.txt | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/email-clients.txt
b/Documentation/email-clients.txt index 2d485de..8819c90 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -79,17 +79,27 @@ to insert into the message.
 ~~
 Claws Mail (GUI)
 
-Works. Some people use this successfully for patches.
+Tested and Works as of December 2015. Some people use this successfully
+for patches.
 
 To insert a patch use Message->Insert File (CTRL+i) or an external
editor. 
 If the inserted patch has to be edited in the Claws composition window
 "Auto wrapping" in Configuration->Preferences->Compose->Wrapping
should be -disabled.
+disabled. Also, under the heading "View", sub-heading "Character
Encoding" +, choose "Unicode (UTF - 8)"
+
+Do remember that if you insert or type something in the main text area,
+and decide to delete it, you will need to reset the formatting by
opening +a new window for the change you want to make. Re-using the
window in which +you deleted the text will lead to the new message
being mangled. 
 ~~
 Evolution (GUI)
 
+As of December 2015, the composing & inserting  method described below
+does not work.
+
 Some people use this successfully for patches.
 
 When composing mail select: Preformat
@@ -244,8 +254,9 @@ Sylpheed (GUI)
 ~~
 Thunderbird (GUI)
 
-Thunderbird is an Outlook clone that likes to mangle text, but there
are ways -to coerce it into behaving.
+Thunderbird is an Outlook clone that likes to mangle text, but there
are +ways to coerce it into behaving. In December 2015, the internal
editor +options do not appear to work.
 
 - Allow use of an external editor:
   The easiest thing to do with Thunderbird and patches is to use an
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Documentation: email-clients.txt

2015-12-06 Thread Sanidhya Solanki
[PATCH] Documentation: email-clients.txt

The information for Claws Mail, Evolution and Thunderbird was out of
date. It has been updated with new instructions and warnings.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 Documentation/email-clients.txt | 19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/Documentation/email-clients.txt
b/Documentation/email-clients.txt index 2d485de..8819c90 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -79,17 +79,27 @@ to insert into the message.
 ~~
 Claws Mail (GUI)
 
-Works. Some people use this successfully for patches.
+Tested and Works as of December 2015. Some people use this successfully
+for patches.
 
 To insert a patch use Message->Insert File (CTRL+i) or an external
editor. 
 If the inserted patch has to be edited in the Claws composition window
 "Auto wrapping" in Configuration->Preferences->Compose->Wrapping
should be -disabled.
+disabled. Also, under the heading "View", sub-heading "Character
Encoding" +, choose "Unicode (UTF - 8)"
+
+Do remember that if you insert or type something in the main text area,
+and decide to delete it, you will need to reset the formatting by
opening +a new window for the change you want to make. Re-using the
window in which +you deleted the text will lead to the new message
being mangled. 
 ~~
 Evolution (GUI)
 
+As of December 2015, the composing & inserting  method described below
+does not work.
+
 Some people use this successfully for patches.
 
 When composing mail select: Preformat
@@ -244,8 +254,9 @@ Sylpheed (GUI)
 ~~
 Thunderbird (GUI)
 
-Thunderbird is an Outlook clone that likes to mangle text, but there
are ways -to coerce it into behaving.
+Thunderbird is an Outlook clone that likes to mangle text, but there
are +ways to coerce it into behaving. In December 2015, the internal
editor +options do not appear to work.
 
 - Allow use of an external editor:
   The easiest thing to do with Thunderbird and patches is to use an
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Documentation: email-clients.txt

2015-12-06 Thread Sanidhya Solanki
So, now that everyone has sounded off about their clients, I guess we
can know how people still use the clients that are included in the
documentation.

As a side note, JC, I think I have figured out why the patch did not
apply for you but works for me. It appears, ostensibly, that when
using CLaws 3.12 on Fedora, I can send patches that seem to work only
after inserting the file. If I add anything in the compose window after
inserting the patch, the client appears to mangle it. That would
explain the issues you experienced and  I still seem to be having. 

As an aside, I do send every patch to myself on multiple accounts using
Claws, then compare the SHA512 hash, and as a final measure reset git
and reapply the patch. Only then do I send it to the mailing list.

If no one else provides a patch including the information supplied by
this email chain in 5 days, then I will collect it all and send it to
you in a patch.

Best give people a few days to claim their findings as their own,
without delaying it too much.

Try the patch I just send you.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header

2015-12-05 Thread Sanidhya Solanki
I disagree with the output of the automaton. Included below are my
compile checks before and after the patch.
The output has been scrubbed to remove information about my file layout.

--
[~ linux]$ git branch -v
  master 31ade3b Linux 4.4-rc3
* pat31ade3b Linux 4.4-rc3
[~ linux]$ make -j5 drivers/staging/skein/skein_block.o
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  CHK include/generated/timeconst.h
  CHK include/generated/bounds.h
  CHK include/generated/asm-offsets.h
  CALLscripts/checksyscalls.sh
  CC  drivers/staging/skein/skein_block.o
[~ linux]$ pwd
~/linux
[~ linux]$ git branch -v
  master 31ade3b Linux 4.4-rc3
* pat31ade3b Linux 4.4-rc3
[~ linux]$ git branch -v
  master 31ade3b Linux 4.4-rc3
* pat4d2271c Staging: Skein: Moved macros from skein_block.c to
header file. 
[~ linux]$ pwd
~/linux
[~ linux]$ make -j5 drivers/staging/skein/skein_block.o
  CHK include/config/kernel.release
  UPD include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  UPD include/generated/utsrelease.h
  CHK include/generated/timeconst.h
  CHK include/generated/bounds.h
  CHK include/generated/asm-offsets.h
  CALLscripts/checksyscalls.sh
  CC  drivers/staging/skein/skein_block.o
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: Skein: Patch adds the test vectors

2015-12-05 Thread Sanidhya Solanki
The patch is included below.
I would like to apologize for the past few emails. It turns out the
documentation included in the eMail clients file is woefully out of
date. I have checked the patches for errors using the scripts provided.
However, it turns out that the scripts are slightly incorrect, as you
can see when it keeps asking to align the statements with the brackets.
Another issue has turned out to be that you cannot follow the scripts
completely without altering the code in a significant way, as it
suggests changing the deterministic portions of the hash, changing
certain functions, reducing line length, etc.
I have sent the patch to myself, applied it, as well as compared sha512
hashes of both the original and the mailed copy.
For the rest of the work on this patch and the skein subsystem, I defer
to someone with the expertise and experience of making Linux modules
and the skein hash families. I believe that if I continue to make
further changes to these files, I might make a mistake which alters
functionality of the hash function. I will continue to contribute to
the other kernel branches.
I will submit a patch to correct the email documentation tomorrow. 
Thanks for you patience everyone.
---
[PATCH] Staging: Skein: Patch adds the test vectors

This patch adds the test vectors, and cleans up most of the
syntactical and formatting errors. It also updates the TODO for
the remaining tasks.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/skein/TODO |   8 +-
 drivers/staging/skein/skein_test.c | 831
+
drivers/staging/skein/skein_test.h | 516 +++ 3
files changed, 1351 insertions(+), 4 deletions(-) create mode 100644
drivers/staging/skein/skein_test.c create mode 100644
drivers/staging/skein/skein_test.h

diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO
index cd3508d..10a4b6cf 100644
--- a/drivers/staging/skein/TODO
+++ b/drivers/staging/skein/TODO
@@ -1,8 +1,8 @@
 skein/threefish TODO
 
- - move macros into appropriate header files
- - add / pass test vectors
+ - clean up skein_test.c and skein_test.h
+ - pass test vectors
  - module support
 
-Please send patches to Jason Cooper  in addition
to the -staging tree mailinglist.
+Please send patches to Jason Cooper  in addition
+to the staging tree mailinglist.
diff --git a/drivers/staging/skein/skein_test.c
b/drivers/staging/skein/skein_test.c new file mode 100644
index 000..9c1a794
--- /dev/null
+++ b/drivers/staging/skein/skein_test.c
@@ -0,0 +1,831 @@
+/***
+**
+** Test/verification code for the Skein block functions.
+**
+** Source code author: Doug Whiting, 2008.
+**
+** This algorithm and source code is released to the public domain.
+**
+** Testing:
+**   - buffering of incremental calls (random cnt steps)
+**   - partial input byte handling
+**   - output sample hash results (for comparison of ref vs. optimized)
+**   - performance
+**
+***/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "skein.h"
+#include "SHA3api_ref.h"
+
+static const uint_t hash_bits[] =  /* list of hash hash lengths
to test */
+   { 160, 224, 256, 384, 512, 1024, 256 + 8, 512 + 8,
1024 + 8, 2048 + 8 }; +
+/* External function to process blkcnt (nonzero) full block(s) of
data. */ +void  skein_256_process_block(skein_256_ctxt_t *ctx,
const u08b_t *blkptr, size_t blkcnt, size_t bytecntadd); +void
skein_512_process_block(skein_512_ctxt_t *ctx, const u08b_t *blkptr,
size_t blkcnt, size_t bytecntadd); +void
skein_1024_process_block(skein_1024_ctxt_t *ctx, const u08b_t *blkptr,
size_t blkcnt, size_t bytecntadd); + +/** debug i/o
helper routines **/ +void fatalerror(const char
*s, ...) +{
+   /* print out a msg and exit with an error code */
+   va_list ap;
+
+   va_start(ap, s);
+   vprintf(s, ap);
+   va_end(ap);
+   printf("\n");
+   exit(2);
+}
+
+static uint_t _quiet_   =   0;  /* quiet processing? */
+static uint_t verbose   =   0;  /* verbose flag bits */
+static uint_t kathash   = ~0u;  /* use as a quick check on KAT results
*/ +
+void show_bytes(uint_t cnt, const u08b_t *b)
+{
+   /* formatted output of byte array */
+   uint_t i;
+
+   for (i = 0; i < cnt; i++) {
+   if (i  % 16 ==  0)
+   printf("");
+   else if (i % 4 == 0)
+   printf(" ");
+   printf(" %02X", b[i]);
+   kathash = (kathash ^ b[i]) * 0xDEADBEEF;
+   kathash = (kathash ^ (kathash >> 23) ^ (kathash >> 17)
^ (kathash >> 9)) * 0xCAFEF00D;
+  

[PATCH] Staging: Skein: Moved macros from skein_block.c to header

2015-12-05 Thread Sanidhya Solanki
Staging: Skein: Moved macros from skein_block.c to header
 file.

The original code defined macros in the source code, making it
harder to read. Moved them to the header file, as per the TODO file.

Signed-off-by: Sanidhya Solanki 
---
 drivers/staging/skein/skein_block.c | 473 +---
 drivers/staging/skein/skein_block.h | 454 ++
 2 files changed, 466 insertions(+), 461 deletions(-)

diff --git a/drivers/staging/skein/skein_block.c 
b/drivers/staging/skein/skein_block.c
index 45b4732..ec8292d 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -18,458 +18,6 @@
 #include "skein_base.h"
 #include "skein_block.h"
 
-#ifndef SKEIN_USE_ASM
-#define SKEIN_USE_ASM   (0) /* default is all C code (no ASM) */
-#endif
-
-#ifndef SKEIN_LOOP
-#define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 1024 */
-#endif
-
-#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
-#define KW_TWK_BASE (0)
-#define KW_KEY_BASE (3)
-#define ks  (kw + KW_KEY_BASE)
-#define ts  (kw + KW_TWK_BASE)
-
-#ifdef SKEIN_DEBUG
-#define debug_save_tweak(ctx)   \
-{   \
-   ctx->h.tweak[0] = ts[0];\
-   ctx->h.tweak[1] = ts[1];\
-}
-#else
-#define debug_save_tweak(ctx)
-#endif
-
-#if !(SKEIN_USE_ASM & 256)
-#undef  RCNT
-#define RCNT (SKEIN_256_ROUNDS_TOTAL / 8)
-#ifdef SKEIN_LOOP /* configure how much to unroll the loop */
-#define SKEIN_UNROLL_256 (((SKEIN_LOOP) / 100) % 10)
-#else
-#define SKEIN_UNROLL_256 (0)
-#endif
-
-#if SKEIN_UNROLL_256
-#if (RCNT % SKEIN_UNROLL_256)
-#error "Invalid SKEIN_UNROLL_256" /* sanity check on unroll count */
-#endif
-#endif
-#define ROUND256(p0, p1, p2, p3, ROT, r_num) \
-   do { \
-   X##p0 += X##p1;  \
-   X##p1 = rotl_64(X##p1, ROT##_0); \
-   X##p1 ^= X##p0;  \
-   X##p2 += X##p3;  \
-   X##p3 = rotl_64(X##p3, ROT##_1); \
-   X##p3 ^= X##p2;  \
-   } while (0)
-
-#if SKEIN_UNROLL_256 == 0
-#define R256(p0, p1, p2, p3, ROT, r_num) /* fully unrolled */ \
-   ROUND256(p0, p1, p2, p3, ROT, r_num)
-
-#define I256(R) \
-   do {\
-   /* inject the key schedule value */ \
-   X0   += ks[((R) + 1) % 5];  \
-   X1   += ks[((R) + 2) % 5] + ts[((R) + 1) % 3];  \
-   X2   += ks[((R) + 3) % 5] + ts[((R) + 2) % 3];  \
-   X3   += ks[((R) + 4) % 5] + (R) + 1;\
-   } while (0)
-#else
-/* looping version */
-#define R256(p0, p1, p2, p3, ROT, r_num) ROUND256(p0, p1, p2, p3, ROT, r_num)
-
-#define I256(R) \
-   do {\
-   /* inject the key schedule value */ \
-   X0 += ks[r + (R) + 0];  \
-   X1 += ks[r + (R) + 1] + ts[r + (R) + 0];\
-   X2 += ks[r + (R) + 2] + ts[r + (R) + 1];\
-   X3 += ks[r + (R) + 3] + r + (R);\
-   /* rotate key schedule */   \
-   ks[r + (R) + 4] = ks[r + (R) - 1];  \
-   ts[r + (R) + 2] = ts[r + (R) - 1];  \
-   } while (0)
-#endif
-#define R256_8_ROUNDS(R)\
-   do {\
-   R256(0, 1, 2, 3, R_256_0, 8 * (R) + 1); \
-   R256(0, 3, 2, 1, R_256_1, 8 * (R) + 2); \
-   R256(0, 1, 2, 3, R_256_2, 8 * (R) + 3); \
-   R256(0, 3, 2, 1, R_256_3, 8 * (R) + 4); \
-   I256(2 * (R));  \
-   R256(0, 1, 2, 3, R_256_4, 8 * (R) + 5); \
-   R256(0, 3, 2, 1, R_256_5, 8 * (R) + 6); \
-   R256(0, 1, 2, 3, R_256_6, 8 * (R) + 7); \
-   R256(0, 3, 2, 1, R_256_7, 8 * (R) + 8); \
-   I256(2 * (R) + 1);  \
-   } while (0)
-
-#define R256_UNROLL_R(NN) \
-   ((SKEIN_UNROLL_256 == 0 &&\
-   SKEIN_256_ROUNDS_TOTAL / 8 > (NN)) || \
-   (SKEIN_UNROLL_256 > (NN)))
-
-#if  (SKEIN_UNROLL_256 > 14)
-#error  "need more unrolling in skein_256_process_block"
-#endif
-#endif
-
-#if !(SKEIN_USE_ASM & 512)
-#undef  RCNT
-#define RCNT  (SKEIN_512_ROUNDS_TOTAL/8)
-
-#ifdef SKEIN_LOOP /* configure how much to unroll the loop */
-#define SKEIN_UNROLL_512 (((SKEIN_LOOP)/10)%10)
-#else
-#define SKEIN_UNROLL_512 (0)
-#endif
-
-#if SKEIN_UNROLL_512
-#if (RCNT % SKEIN_U

Re: [PATCH] Staging: Skein: Moved macros from skein_block.c to header

2015-12-05 Thread Sanidhya Solanki
I disagree with the output of the automaton. Included below are my
compile checks before and after the patch.
The output has been scrubbed to remove information about my file layout.

--
[~ linux]$ git branch -v
  master 31ade3b Linux 4.4-rc3
* pat31ade3b Linux 4.4-rc3
[~ linux]$ make -j5 drivers/staging/skein/skein_block.o
  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  CHK include/generated/timeconst.h
  CHK include/generated/bounds.h
  CHK include/generated/asm-offsets.h
  CALLscripts/checksyscalls.sh
  CC  drivers/staging/skein/skein_block.o
[~ linux]$ pwd
~/linux
[~ linux]$ git branch -v
  master 31ade3b Linux 4.4-rc3
* pat31ade3b Linux 4.4-rc3
[~ linux]$ git branch -v
  master 31ade3b Linux 4.4-rc3
* pat4d2271c Staging: Skein: Moved macros from skein_block.c to
header file. 
[~ linux]$ pwd
~/linux
[~ linux]$ make -j5 drivers/staging/skein/skein_block.o
  CHK include/config/kernel.release
  UPD include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  UPD include/generated/utsrelease.h
  CHK include/generated/timeconst.h
  CHK include/generated/bounds.h
  CHK include/generated/asm-offsets.h
  CALLscripts/checksyscalls.sh
  CC  drivers/staging/skein/skein_block.o
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: Skein: Moved macros from skein_block.c to header

2015-12-05 Thread Sanidhya Solanki
Staging: Skein: Moved macros from skein_block.c to header
 file.

The original code defined macros in the source code, making it
harder to read. Moved them to the header file, as per the TODO file.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/skein/skein_block.c | 473 +---
 drivers/staging/skein/skein_block.h | 454 ++
 2 files changed, 466 insertions(+), 461 deletions(-)

diff --git a/drivers/staging/skein/skein_block.c 
b/drivers/staging/skein/skein_block.c
index 45b4732..ec8292d 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
@@ -18,458 +18,6 @@
 #include "skein_base.h"
 #include "skein_block.h"
 
-#ifndef SKEIN_USE_ASM
-#define SKEIN_USE_ASM   (0) /* default is all C code (no ASM) */
-#endif
-
-#ifndef SKEIN_LOOP
-#define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 1024 */
-#endif
-
-#define BLK_BITS(WCNT * 64) /* some useful definitions for code here */
-#define KW_TWK_BASE (0)
-#define KW_KEY_BASE (3)
-#define ks  (kw + KW_KEY_BASE)
-#define ts  (kw + KW_TWK_BASE)
-
-#ifdef SKEIN_DEBUG
-#define debug_save_tweak(ctx)   \
-{   \
-   ctx->h.tweak[0] = ts[0];\
-   ctx->h.tweak[1] = ts[1];\
-}
-#else
-#define debug_save_tweak(ctx)
-#endif
-
-#if !(SKEIN_USE_ASM & 256)
-#undef  RCNT
-#define RCNT (SKEIN_256_ROUNDS_TOTAL / 8)
-#ifdef SKEIN_LOOP /* configure how much to unroll the loop */
-#define SKEIN_UNROLL_256 (((SKEIN_LOOP) / 100) % 10)
-#else
-#define SKEIN_UNROLL_256 (0)
-#endif
-
-#if SKEIN_UNROLL_256
-#if (RCNT % SKEIN_UNROLL_256)
-#error "Invalid SKEIN_UNROLL_256" /* sanity check on unroll count */
-#endif
-#endif
-#define ROUND256(p0, p1, p2, p3, ROT, r_num) \
-   do { \
-   X##p0 += X##p1;  \
-   X##p1 = rotl_64(X##p1, ROT##_0); \
-   X##p1 ^= X##p0;  \
-   X##p2 += X##p3;  \
-   X##p3 = rotl_64(X##p3, ROT##_1); \
-   X##p3 ^= X##p2;  \
-   } while (0)
-
-#if SKEIN_UNROLL_256 == 0
-#define R256(p0, p1, p2, p3, ROT, r_num) /* fully unrolled */ \
-   ROUND256(p0, p1, p2, p3, ROT, r_num)
-
-#define I256(R) \
-   do {\
-   /* inject the key schedule value */ \
-   X0   += ks[((R) + 1) % 5];  \
-   X1   += ks[((R) + 2) % 5] + ts[((R) + 1) % 3];  \
-   X2   += ks[((R) + 3) % 5] + ts[((R) + 2) % 3];  \
-   X3   += ks[((R) + 4) % 5] + (R) + 1;\
-   } while (0)
-#else
-/* looping version */
-#define R256(p0, p1, p2, p3, ROT, r_num) ROUND256(p0, p1, p2, p3, ROT, r_num)
-
-#define I256(R) \
-   do {\
-   /* inject the key schedule value */ \
-   X0 += ks[r + (R) + 0];  \
-   X1 += ks[r + (R) + 1] + ts[r + (R) + 0];\
-   X2 += ks[r + (R) + 2] + ts[r + (R) + 1];\
-   X3 += ks[r + (R) + 3] + r + (R);\
-   /* rotate key schedule */   \
-   ks[r + (R) + 4] = ks[r + (R) - 1];  \
-   ts[r + (R) + 2] = ts[r + (R) - 1];  \
-   } while (0)
-#endif
-#define R256_8_ROUNDS(R)\
-   do {\
-   R256(0, 1, 2, 3, R_256_0, 8 * (R) + 1); \
-   R256(0, 3, 2, 1, R_256_1, 8 * (R) + 2); \
-   R256(0, 1, 2, 3, R_256_2, 8 * (R) + 3); \
-   R256(0, 3, 2, 1, R_256_3, 8 * (R) + 4); \
-   I256(2 * (R));  \
-   R256(0, 1, 2, 3, R_256_4, 8 * (R) + 5); \
-   R256(0, 3, 2, 1, R_256_5, 8 * (R) + 6); \
-   R256(0, 1, 2, 3, R_256_6, 8 * (R) + 7); \
-   R256(0, 3, 2, 1, R_256_7, 8 * (R) + 8); \
-   I256(2 * (R) + 1);  \
-   } while (0)
-
-#define R256_UNROLL_R(NN) \
-   ((SKEIN_UNROLL_256 == 0 &&\
-   SKEIN_256_ROUNDS_TOTAL / 8 > (NN)) || \
-   (SKEIN_UNROLL_256 > (NN)))
-
-#if  (SKEIN_UNROLL_256 > 14)
-#error  "need more unrolling in skein_256_process_block"
-#endif
-#endif
-
-#if !(SKEIN_USE_ASM & 512)
-#undef  RCNT
-#define RCNT  (SKEIN_512_ROUNDS_TOTAL/8)
-
-#ifdef SKEIN_LOOP /* configure how much to unroll the loop */
-#define SKEIN_UNROLL_512 (((SKEIN_LOOP)/10)%10)
-#else
-#define SKEIN_UNROLL_512 (0)
-#endif
-
-#if SKEI

[PATCH] Staging: Skein: Patch adds the test vectors

2015-12-05 Thread Sanidhya Solanki
The patch is included below.
I would like to apologize for the past few emails. It turns out the
documentation included in the eMail clients file is woefully out of
date. I have checked the patches for errors using the scripts provided.
However, it turns out that the scripts are slightly incorrect, as you
can see when it keeps asking to align the statements with the brackets.
Another issue has turned out to be that you cannot follow the scripts
completely without altering the code in a significant way, as it
suggests changing the deterministic portions of the hash, changing
certain functions, reducing line length, etc.
I have sent the patch to myself, applied it, as well as compared sha512
hashes of both the original and the mailed copy.
For the rest of the work on this patch and the skein subsystem, I defer
to someone with the expertise and experience of making Linux modules
and the skein hash families. I believe that if I continue to make
further changes to these files, I might make a mistake which alters
functionality of the hash function. I will continue to contribute to
the other kernel branches.
I will submit a patch to correct the email documentation tomorrow. 
Thanks for you patience everyone.
---
[PATCH] Staging: Skein: Patch adds the test vectors

This patch adds the test vectors, and cleans up most of the
syntactical and formatting errors. It also updates the TODO for
the remaining tasks.

Signed-off-by: Sanidhya Solanki <jpage.l...@gmail.com>
---
 drivers/staging/skein/TODO |   8 +-
 drivers/staging/skein/skein_test.c | 831
+
drivers/staging/skein/skein_test.h | 516 +++ 3
files changed, 1351 insertions(+), 4 deletions(-) create mode 100644
drivers/staging/skein/skein_test.c create mode 100644
drivers/staging/skein/skein_test.h

diff --git a/drivers/staging/skein/TODO b/drivers/staging/skein/TODO
index cd3508d..10a4b6cf 100644
--- a/drivers/staging/skein/TODO
+++ b/drivers/staging/skein/TODO
@@ -1,8 +1,8 @@
 skein/threefish TODO
 
- - move macros into appropriate header files
- - add / pass test vectors
+ - clean up skein_test.c and skein_test.h
+ - pass test vectors
  - module support
 
-Please send patches to Jason Cooper <ja...@lakedaemon.net> in addition
to the -staging tree mailinglist.
+Please send patches to Jason Cooper <ja...@lakedaemon.net> in addition
+to the staging tree mailinglist.
diff --git a/drivers/staging/skein/skein_test.c
b/drivers/staging/skein/skein_test.c new file mode 100644
index 000..9c1a794
--- /dev/null
+++ b/drivers/staging/skein/skein_test.c
@@ -0,0 +1,831 @@
+/***
+**
+** Test/verification code for the Skein block functions.
+**
+** Source code author: Doug Whiting, 2008.
+**
+** This algorithm and source code is released to the public domain.
+**
+** Testing:
+**   - buffering of incremental calls (random cnt steps)
+**   - partial input byte handling
+**   - output sample hash results (for comparison of ref vs. optimized)
+**   - performance
+**
+***/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "skein.h"
+#include "SHA3api_ref.h"
+
+static const uint_t hash_bits[] =  /* list of hash hash lengths
to test */
+   { 160, 224, 256, 384, 512, 1024, 256 + 8, 512 + 8,
1024 + 8, 2048 + 8 }; +
+/* External function to process blkcnt (nonzero) full block(s) of
data. */ +void  skein_256_process_block(skein_256_ctxt_t *ctx,
const u08b_t *blkptr, size_t blkcnt, size_t bytecntadd); +void
skein_512_process_block(skein_512_ctxt_t *ctx, const u08b_t *blkptr,
size_t blkcnt, size_t bytecntadd); +void
skein_1024_process_block(skein_1024_ctxt_t *ctx, const u08b_t *blkptr,
size_t blkcnt, size_t bytecntadd); + +/** debug i/o
helper routines **/ +void fatalerror(const char
*s, ...) +{
+   /* print out a msg and exit with an error code */
+   va_list ap;
+
+   va_start(ap, s);
+   vprintf(s, ap);
+   va_end(ap);
+   printf("\n");
+   exit(2);
+}
+
+static uint_t _quiet_   =   0;  /* quiet processing? */
+static uint_t verbose   =   0;  /* verbose flag bits */
+static uint_t kathash   = ~0u;  /* use as a quick check on KAT results
*/ +
+void show_bytes(uint_t cnt, const u08b_t *b)
+{
+   /* formatted output of byte array */
+   uint_t i;
+
+   for (i = 0; i < cnt; i++) {
+   if (i  % 16 ==  0)
+   printf("");
+   else if (i % 4 == 0)
+   printf(" ");
+   printf(" %02X", b[i]);
+   kathash = (kathash ^ b[i]) * 0xDEADBEEF;
+   kathash = (kathash ^ (kathash >> 23) ^ (kathash