Problems cloning the git repostories
Subsystems (2)
Hello there,
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The media_tree repository failed on the first line
Quoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvb
which I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.git
with a fatal: read error: Connection reset by peer.
Is it possible to clone either (or both) repositories at this time, or are they down? And in the absence of cloning the kernel for the media_tree.git repository, is it possible to simply clone thegit://linuxtv.org/media_tree.git repository and work from that?
My interest in this is to install some patches created by Devin Heitmueller for the Pinnacle PCTV 80e USB tuner (at least the ATSC portion of the tuner). Once I'm able to determine exactly what changes are made, I would like to either submit the patches to the repository, or send them to someone who has more experience in patching the files for submission.
One other question (totally unrelated to this post though): When I send emails, normally they are GPG signed. Should I disable that for this list, or is it acceptable?
Thank you for any information, and have a great day:) Patrick.
Quoted 28 lines · Patrick Dickey
Hello there,
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvbwhich I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.gitwith a fatal: read error: Connection reset by peer.
Is it possible to clone either (or both) repositories at this time, or are they down? And in the absence of cloning the kernel for the media_tree.git repository, is it possible to simply clone the
git://linuxtv.org/media_tree.gitrepository and work from that?My interest in this is to install some patches created by Devin Heitmueller for the Pinnacle PCTV 80e USB tuner (at least the ATSC portion of the tuner). Once I'm able to determine exactly what changes are made, I would like to either submit the patches to the repository, or send them to someone who has more experience in patching the files for submission.
Quoted 6 lines
One other question (totally unrelated to this post though): When I send emails, normally they are GPG signed. Should I disable that for this list, or is it acceptable?
Thank you for any information, and have a great day:) Patrick.
Hi Patrick,
As I said on the blog, the issue isn't getting the driver to work against current kernels. Merging the driver against the current tree is a trivial exercise (the patch series should apply trivially against the current code, with only a few minor conflicts related to board numbers, etc).
The bigger issue though is once you do that and have the driver running, you now have a body of code > 10,000 lines which doesn't meet the "coding standards". Doing such a refactoring is a relatively straightforward exercise but very time consuming (you already have a working driver, so you just have to make sure you don't break anything).
The more I think about this, the more it annoys me. I did all the hard parts:
* I worked with the product vendor to get the details for the design
* I got Hauppauge/PCTV to compel the chipset vendor to release the reference code under a GPL compatible license
* I worked out redistribution terms on the firmware
* I ported the driver to Linux
* I integrated the driver and debugged it to achieve signal lock
And why is it not in the mainline? Because none of the above matters if I didn't waste a bunch of my time removing a bunch of "#ifdef WINDOWS" lines and converting whitespace from tabs to spaces.
It's crap like this that's the reason why some of the best LinuxTV driver authors still have a bunch of stuff that isn't merged upstream.
We just don't have time for this sort of bullshit that any monkey
could do if he/she was willing to invest the effort. We're just too busy doing *actual* driver work.
Five years ago the hard part was finding competent developers, getting access to datasheets, getting access to reference driver code, and getting access to the details for a hardware design. Now most of those problems are not the issue - we have access to all the data but we want to waste the time of the few competent developers out there making them do "coding style cleanup" before perfectly good code gets merged upstream. There has been more than one case where I've considered doing a driver for a new board and decided against it because the barrier to getting it upstream is not worth my time.
Want to see more device support upstream? Optimize the process to make it easy for the people who know the hardware and how to write the drivers to get code upstream, and leave it to the "janitors" to work out the codingstyle issues.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Em 25-09-2011 10:55, Devin Heitmueller escreveu:
Quoted 70 lines · Patrick Dickey
Quoted 28 lines
Hello there,
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvbwhich I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.gitwith a fatal: read error: Connection reset by peer.
Is it possible to clone either (or both) repositories at this time, or are they down? And in the absence of cloning the kernel for the media_tree.git repository, is it possible to simply clone the
git://linuxtv.org/media_tree.gitrepository and work from that?My interest in this is to install some patches created by Devin Heitmueller for the Pinnacle PCTV 80e USB tuner (at least the ATSC portion of the tuner). Once I'm able to determine exactly what changes are made, I would like to either submit the patches to the repository, or send them to someone who has more experience in patching the files for submission.
Quoted 6 lines
One other question (totally unrelated to this post though): When I send emails, normally they are GPG signed. Should I disable that for this list, or is it acceptable?
Thank you for any information, and have a great day:) Patrick.
Hi Patrick,
As I said on the blog, the issue isn't getting the driver to work against current kernels. Merging the driver against the current tree is a trivial exercise (the patch series should apply trivially against the current code, with only a few minor conflicts related to board numbers, etc).
The bigger issue though is once you do that and have the driver running, you now have a body of code > 10,000 lines which doesn't meet the "coding standards". Doing such a refactoring is a relatively straightforward exercise but very time consuming (you already have a working driver, so you just have to make sure you don't break anything).
The more I think about this, the more it annoys me. I did all the hard parts:
* I worked with the product vendor to get the details for the design
* I got Hauppauge/PCTV to compel the chipset vendor to release the reference code under a GPL compatible license
* I worked out redistribution terms on the firmware
* I ported the driver to Linux
* I integrated the driver and debugged it to achieve signal lockAnd why is it not in the mainline? Because none of the above matters if I didn't waste a bunch of my time removing a bunch of "#ifdef WINDOWS" lines and converting whitespace from tabs to spaces.
It's crap like this that's the reason why some of the best LinuxTV driver authors still have a bunch of stuff that isn't merged upstream.
We just don't have time for this sort of bullshit that any monkey
could do if he/she was willing to invest the effort. We're just too busy doing *actual* driver work.
Quoted 10 lines
Five years ago the hard part was finding competent developers, getting access to datasheets, getting access to reference driver code, and getting access to the details for a hardware design. Now most of those problems are not the issue - we have access to all the data but we want to waste the time of the few competent developers out there making them do "coding style cleanup" before perfectly good code gets merged upstream. There has been more than one case where I've considered doing a driver for a new board and decided against it because the barrier to getting it upstream is not worth my time.
I fail to see any trial from your side to send the patches upstream:
no pull requests and no patches for this driver were _ever_ sent to the ML. I can only guess that maybe submitting it upstream were not part of your contract with the vendor.
Coding Style fixes are generally trivial, and they can be done very quickly with some scripting. I took only a few hours to convert drx-d and drx-k to the Linux Coding Style, on my spare time. The scripts I wrote for that are together with the commits (they're generally a few lines perl scripting doing some replacements). I usually do this with other drivers, when people submit me them with those troubles and I have some time, and never asked or earned a single penny for doing that.
Also, as I've told you several times before, code with broken coding styles can be submitted as-is, without any changes to drivers/staging, where they're fixed by kernel newbies with more time to work on that.
So, please don't use weak arguments like that as an excuse for you to not submit your drivers.
Quoted 4 lines
Want to see more device support upstream? Optimize the process to make it easy for the people who know the hardware and how to write the drivers to get code upstream, and leave it to the "janitors" to work out the codingstyle issues.
The process you've just described exists already since Sept, 2008. It is called:
/drivers/staging
In summary, if you don't have a couple hours to make your driver to match Kernel Coding Style, just send it as is to /drivers/staging, c/c me and Greg KH, and that's it.
Regards,
Mauro
Quoted 3 lines · Mauro Carvalho Chehab
I fail to see any trial from your side to send the patches upstream:
no pull requests and no patches for this driver were _ever_ sent to the ML.
You and I have discussed this issue multiple times with these drivers, including the drx-j (which is the basis for the 80e device in question). All the code is publicly available, and I in fact invited you personally to pull whatever you want (as a policy we don't publish public trees that have outstanding licensing issues).
Look how long it took to get xc4000 upstream. Look how long it took drx-d to get upstream. Those trees sat there for *years* with your full knowledge of their existence and that the only reason they weren't merged was because of codingstyle issues.
Oh, and I did spend a bunch of hours doing cleanup work on the as102 driver, and it was still not good enough. I decided it wasn't worth the additional time. That tree has only been rotting for 19 months.
Quoted 2 lines
I can only guess that maybe submitting it upstream were not part of your contract with the vendor.
I don't even know what this means. Commercial customers who I've done work for almost never are willing to pay for me to merge code upstream. And yet code does get upstream. Why? Because I do it in my free time as a courtesy to the community.
Probably also worth noting that the project in question - the 80e - was not done for any customer. I just did the work because I wanted to see the device supported under Linux.
Quoted 7 lines
Coding Style fixes are generally trivial, and they can be done very quickly with some scripting. I took only a few hours to convert drx-d and drx-k to the Linux Coding Style, on my spare time. The scripts I wrote for that are together with the commits (they're generally a few lines perl scripting doing some replacements). I usually do this with other drivers, when people submit me them with those troubles and I have some time, and never asked or earned a single penny for doing that.
Hey, feel free to grab the drx-j driver then. This is like the fourth time I'm invited you to pull the sources and do such a cleanup. And like I said above, I don't earn any money for such cleanups either. I just believe it's a colossal waste of my time that would be better spent doing real driver development.
Quoted 3 lines
Also, as I've told you several times before, code with broken coding styles can be submitted as-is, without any changes to
drivers/staging, where they're fixed by kernel newbies with more time to work on that.
Last I checked you can't put demod or tuners drivers into staging because they are a dependency of the bridge driver. I guess maybe you can accomplish that if you litter the bridge driver source and makefiles with #ifdef lines. If that situation has changed, then great.
Quoted 2 lines
So, please don't use weak arguments like that as an excuse for you to not submit your drivers.
Suggesting that the developers who are trying to give you working code at zero cost is a pretty crappy way to treat them.
Quoted 5 lines
Quoted 4 lines
Want to see more device support upstream? Optimize the process to make it easy for the people who know the hardware and how to write the drivers to get code upstream, and leave it to the "janitors" to work out the codingstyle issues.
Quoted 7 lines
The process you've just described exists already since Sept, 2008. It is called:
/drivers/stagingIn summary, if you don't have a couple hours to make your driver to match Kernel Coding Style, just send it as is to /drivers/staging, c/c me and Greg KH, and that's it.
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-80e/
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Have fun.
The harder you make it to get code upstream, the more developers who will just say "to hell with this". And *that* is why there are thousands of lines of working drivers which various developers have in out-of-tree drivers.
You can sit in denial that there is a fundamental problem with the management of this project and blame the developers for being lazy, or you can take some concrete action to get the code merged upstream.
Your call.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Staging submission: PCTV 80e and PCTV 74e drivers (was Re: Problems cloning the git repostories)
Adding Cc: staging maintainer and mailinglist.
Quoted 18 lines · On Sep 26 Devin Heitmueller wrote:
Quoted 5 lines · Mauro Carvalho Chehab
Quoted 4 lines
Want to see more device support upstream? Optimize the process to make it easy for the people who know the hardware and how to write the drivers to get code upstream, and leave it to the "janitors" to work out the codingstyle issues.
Quoted 7 lines
The process you've just described exists already since Sept, 2008. It is called:
/drivers/stagingIn summary, if you don't have a couple hours to make your driver to match Kernel Coding Style, just send it as is to /drivers/staging, c/c me and Greg KH, and that's it.
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-80e/
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Quoted 6 lines
Have fun.
The harder you make it to get code upstream, the more developers who will just say "to hell with this". And *that* is why there are thousands of lines of working drivers which various developers have in out-of-tree drivers.
Hi,
perhaps a kind developer over at devel@driverdev could extract patches for staging out of the above mercurial repositories, and then folks can work on mainline inclusion. (Somebody who actually has such a device might be most motivated to do it.)
No need to get angry that it hasn't happened yet. :-) It's just a matter of the right people joining the effort at the right time.
Thanks Devin for the offer,
Signature · 3 lines
Stefan Richter -=====-==-== =--= ==-== http://arcgraph.de/sr/
Re: Staging submission: PCTV 80e and PCTV 74e drivers (was Re: Problems cloning the git repostories)
Quoted 20 lines · Stefan Richter
Adding Cc: staging maintainer and mailinglist.
Quoted 17 lines · On Sep 26 Devin Heitmueller wrote:
Quoted 5 lines · Mauro Carvalho Chehab
Quoted 4 lines
Want to see more device support upstream? Optimize the process to make it easy for the people who know the hardware and how to write the drivers to get code upstream, and leave it to the "janitors" to work out the codingstyle issues.
Quoted 7 lines
The process you've just described exists already since Sept, 2008. It is called:
/drivers/stagingIn summary, if you don't have a couple hours to make your driver to match Kernel Coding Style, just send it as is to /drivers/staging, c/c me and Greg KH, and that's it.
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-80e/
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
I can't do that as I need some commit messages in a format we can accept (i.e. your directory structure doesn't match what we need in the kernel tree from what I can tell.)
Quoted 6 lines
Quoted 6 lines
Have fun.
The harder you make it to get code upstream, the more developers who will just say "to hell with this". And *that* is why there are thousands of lines of working drivers which various developers have in out-of-tree drivers.
The Linux patch process is one of the easiest, and most well-documented for any open source project that I have ever seen.
If you don't agree (and that's fine if you don't), any ideas on what we can do to make it better would be glady appreciated.
Quoted 4 lines
perhaps a kind developer over at devel@driverdev could extract patches for staging out of the above mercurial repositories, and then folks can work on mainline inclusion. (Somebody who actually has such a device might be most motivated to do it.)
As the drivers don't seem to be touched in way over a year, odds are the code isn't going to be able to build as-is, so it will require some changes for basic issues.
And I'll glady accept patches for the staging tree. Also note that we've just created a drivers/staging/media/ tree to house lots of different v4l drivers that are being worked on in the staging tree to help coordinate this type of work better.
thanks,
greg k-h
Re: Staging submission: PCTV 80e and PCTV 74e drivers (was Re: Problems cloning the git repostories)
Quoted 16 lines · On Sep 27 Greg KH wrote:
Quoted 11 lines · Stefan Richter
Adding Cc: staging maintainer and mailinglist.
Quoted 8 lines · On Sep 26 Devin Heitmueller wrote:
Quoted 3 lines · Mauro Carvalho Chehab
In summary, if you don't have a couple hours to make your driver to match Kernel Coding Style, just send it as is to /drivers/staging, c/c me and Greg KH, and that's it.
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-80e/
PULL http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/I can't do that as I need some commit messages in a format we can accept (i.e. your directory structure doesn't match what we need in the kernel tree from what I can tell.)
[...]
Quoted 8 lines
As the drivers don't seem to be touched in way over a year, odds are the code isn't going to be able to build as-is, so it will require some changes for basic issues.
And I'll glady accept patches for the staging tree. Also note that we've just created a
drivers/staging/media/tree to house lots of different v4l drivers that are being worked on in the staging tree to help coordinate this type of work better.
The conversion into patches with proper changelog, fitting directory structure, and basic build-ability in current staging is exactly the first step for which a volunteer is sought (next would then be the cleanup associated with staging->mainline transition); Devin noted that he is not going to dedicate time for these types of tasks. (I for one also won't; still got plenty to do in some other drivers...)
Signature · 3 lines
Stefan Richter -=====-==-== =--= ==-== http://arcgraph.de/sr/
cover Staging submission: PCTV 74e drivers and some cleanup (was: Staging submission: PCTV 80e and PCTV 74e drivers)
[PATCH 1/7] pull as102 driver fromhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/ with the only change needed to compile it in git tree[1]: usb_buffer_alloc() to usb_alloc_coherent() and usb_buffer_free() to usb_free_coherent()
[PATCH 2/7] as102: add new device nBox DVB-T Dongle adds new device working on this driver
Next patches i made basing on Mauro Carvalho Chehab comments from previous pull try [2].
[PATCH 3/7] as102: cleanup - get rid off typedefs
[PATCH 4/7] as102: cleanup - formatting code
[PATCH 5/7] as102: cleanup - set __attribute__(packed) instead of pragma(pack) [PATCH 6/7] as102: cleanup - delete vim comments
[PATCH 7/7] as102: cleanup - get rid of unnecessary defines (WIN32, LINUX)
[1] git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git kernel-3.1.0-git9+
[2] http://www.spinics.net/lists/linux-media/msg16723.html
W dniu 27.09.2011 21:33, Stefan Richter pisze:
Quoted 30 lines · On Sep 27 Greg KH wrote:
Quoted 14 lines · Stefan Richter
Quoted 10 lines
Adding Cc: staging maintainer and mailinglist.
Quoted 7 lines · On Sep 26 Devin Heitmueller wrote:
Quoted 3 lines · Mauro Carvalho Chehab
In summary, if you don't have a couple hours to make your driver to match Kernel Coding Style, just send it as is to /drivers/staging, c/c me and Greg KH, and that's it.
PULLhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-80e/ PULLhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
I can't do that as I need some commit messages in a format we can accept (i.e. your directory structure doesn't match what we need in the kernel tree from what I can tell.)
[...]
Quoted 8 lines
As the drivers don't seem to be touched in way over a year, odds are the code isn't going to be able to build as-is, so it will require some changes for basic issues.
And I'll glady accept patches for the staging tree. Also note that we've just created a
drivers/staging/media/tree to house lots of different v4l drivers that are being worked on in the staging tree to help coordinate this type of work better.The conversion into patches with proper changelog, fitting directory structure, and basic build-ability in current staging is exactly the first step for which a volunteer is sought (next would then be the cleanup associated with
staging->mainlinetransition); Devin noted that he is not going to dedicate time for these types of tasks. (I for one also won't; still got plenty to do in some other drivers...)
Re: [PATCH 0/7] Staging submission: PCTV 74e drivers and some cleanup (was: Staging submission: PCTV 80e and PCTV 74e drivers)
Quoted 8 lines · Piotr Chmura
[PATCH 1/7] pull as102 driver fromhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/ with the only change needed to compile it in git tree[1]:
usb_buffer_alloc()tousb_alloc_coherent()andusb_buffer_free()tousb_free_coherent()[PATCH 2/7] as102: add new device nBox DVB-T Dongle adds new device working on this driver
Quoted 7 lines
Next patches i made basing on Mauro Carvalho Chehab comments from previous pull try [2].
[PATCH 3/7] as102: cleanup - get rid off typedefs
[PATCH 4/7] as102: cleanup - formatting code
[PATCH 5/7] as102: cleanup - set__attribute__(packed)instead of pragma(pack) [PATCH 6/7] as102: cleanup - delete vim comments
[PATCH 7/7] as102: cleanup - get rid of unnecessary defines (WIN32, LINUX)
Mauro, care to take these and move them under your newly-created drivers/staging/media/ directory?
thanks,
greg k-h
Staging questions: WAS Re: [PATCH 0/7] Staging submission: PCTV 74e drivers and some cleanup
I'm posting this question under this thread because the subject pertains to the question (in that I'm asking about staging and about the PCTV 80e drivers).
I started cleaning up the drx39xx* drivers for the PCTV-80e and have them in a github repository. Ultimately I want to send a pull request, so other people can finish the cleaning (as I'm not comfortable with pulling out the #ifdef statements myself).
So my questions are these:
1. If I move the drx39xx* and associated files into the staging directory (staging/media/dvb/frontends to be exact), do I simply need to point to staging/filename for any #include statements (specifically in the em28xx-dvb.c and em28xx-cards.c files), or do I need to do something else?
2. In the Makefile for the frontends, I have the commands to make the drivers for the drx39xx* files. Do I need to point those to the staging/ directory as well, or do I need to create Makefiles in that directory for these files? I ask this because on my system, I wasn't able to "make" the files when they were in a subdirectory of frontends. I actually had to move them to the frontends directory and transfer the commands from the Makefile in the subdirectory to the frontends Makefile.
3. If I submit a pull request as is right now (where these files will go into the linux/drivers/media/dvb/frontends directory and the em28xx-* files will point to those files), will they be pulled in, and someone will help me to get them in the right places? Or do I need to move them to staging, reconfigure everything, and then submit the pull request?
Thank you for any help and information, and have a great day:) Patrick.
Quoted 23 lines · Greg KH
Quoted 8 lines · Piotr Chmura
[PATCH 1/7] pull as102 driver fromhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/ with the only change needed to compile it in git tree[1]:
usb_buffer_alloc()tousb_alloc_coherent()andusb_buffer_free()tousb_free_coherent()[PATCH 2/7] as102: add new device nBox DVB-T Dongle adds new device working on this driver
Quoted 7 lines
Next patches i made basing on Mauro Carvalho Chehab comments from previous pull try [2].
[PATCH 3/7] as102: cleanup - get rid off typedefs
[PATCH 4/7] as102: cleanup - formatting code
[PATCH 5/7] as102: cleanup - set__attribute__(packed)instead of pragma(pack) [PATCH 6/7] as102: cleanup - delete vim comments
[PATCH 7/7] as102: cleanup - get rid of unnecessary defines (WIN32, LINUX)Mauro, care to take these and move them under your newly-created
drivers/staging/media/directory?thanks,
greg k-h
Re: Staging questions: WAS Re: [PATCH 0/7] Staging submission: PCTV 74e drivers and some cleanup
Hi Patrick,
Quoted 3 lines · Patrick Dickey
I'm posting this question under this thread because the subject pertains to the question (in that I'm asking about staging and about the PCTV 80e drivers).
You should definitely be looking at the "as102" thread that is currently going on this mailing list. Piotr is actually going through the same process as you are (he is working on upstreaming the as102 driver from a kernellabs.com tree). He made some pretty common mistakes (all perfectly understandable), and your reading the thread might help you avoid them (and having to redo your patch series).
Quoted 4 lines
I started cleaning up the drx39xx* drivers for the PCTV-80e and have them in a github repository. Ultimately I want to send a pull request, so other people can finish the cleaning (as I'm not comfortable with pulling out the #ifdef statements myself).
You should definitely ask Mauro how he expects to do a staging driver for a demodulator before you do any further work. The staging tree works well for bridge drivers, but demod drivers such as the drx require code in the bridge driver (the em28xx in this case), so it's not clear how you would do staging for a product where the bridge driver isn't in staging as well. The answer to that question will likely guide you in how to get the driver into staging.
If you have specific questions regarding anything you see in the driver, let me know. I don't have much time nowadays but will find the time if you ask concise questions.
Good luck. It will be great to finally see this merged upstream.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Re: Staging questions: WAS Re: [PATCH 0/7] Staging submission: PCTV 74e drivers and some cleanup
Em 19-10-2011 11:57, Devin Heitmueller escreveu:
Quoted 19 lines
Hi Patrick,
Quoted 3 lines · Patrick Dickey
I'm posting this question under this thread because the subject pertains to the question (in that I'm asking about staging and about the PCTV 80e drivers).
You should definitely be looking at the "as102" thread that is currently going on this mailing list. Piotr is actually going through the same process as you are (he is working on upstreaming the as102 driver from a kernellabs.com tree). He made some pretty common mistakes (all perfectly understandable), and your reading the thread might help you avoid them (and having to redo your patch series).
Quoted 4 lines
I started cleaning up the drx39xx* drivers for the PCTV-80e and have them in a github repository. Ultimately I want to send a pull request, so other people can finish the cleaning (as I'm not comfortable with pulling out the #ifdef statements myself).
Quoted 7 lines
You should definitely ask Mauro how he expects to do a staging driver for a demodulator before you do any further work. The staging tree works well for bridge drivers, but demod drivers such as the drx require code in the bridge driver (the em28xx in this case), so it's not clear how you would do staging for a product where the bridge driver isn't in staging as well. The answer to that question will likely guide you in how to get the driver into staging.
Ah yes, good point. Well, just submit it as if it should be added at the right place, but putting the Kconfig changes in separate. If this driver is not that different than the other drx drivers, I may try to find some time to fix it on the same way.
You may also take a look at the history for the drx-k merging patches. I basically wrote a few small perl scripts to correct coding style, and a few manual work.
Quoted 9 lines
If you have specific questions regarding anything you see in the driver, let me know. I don't have much time nowadays but will find the time if you ask concise questions.
Good luck. It will be great to finally see this merged upstream.
Devin
Re: Staging questions: WAS Re: [PATCH 0/7] Staging submission: PCTV 74e drivers and some cleanup
Thank you for the suggestions (both of you). I'll submit a pull request by this weekend (as I want to test it again in Ubuntu 11.10 just to make sure everything works). And for Mauro, is there a direct link to the scripts? I looked for them after the last time I emailed, but couldn't find them (or I wasn't looking in the right place).
Have a great day:)
Patrick.
Quoted 47 lines · Mauro Carvalho Chehab
Em 19-10-2011 11:57, Devin Heitmueller escreveu:
Quoted 19 lines
Hi Patrick,
Quoted 3 lines · Patrick Dickey
I'm posting this question under this thread because the subject pertains to the question (in that I'm asking about staging and about the PCTV 80e drivers).
You should definitely be looking at the "as102" thread that is currently going on this mailing list. Piotr is actually going through the same process as you are (he is working on upstreaming the as102 driver from a kernellabs.com tree). He made some pretty common mistakes (all perfectly understandable), and your reading the thread might help you avoid them (and having to redo your patch series).
Quoted 4 lines
I started cleaning up the drx39xx* drivers for the PCTV-80e and have them in a github repository. Ultimately I want to send a pull request, so other people can finish the cleaning (as I'm not comfortable with pulling out the #ifdef statements myself).
Quoted 7 lines
You should definitely ask Mauro how he expects to do a staging driver for a demodulator before you do any further work. The staging tree works well for bridge drivers, but demod drivers such as the drx require code in the bridge driver (the em28xx in this case), so it's not clear how you would do staging for a product where the bridge driver isn't in staging as well. The answer to that question will likely guide you in how to get the driver into staging.
Ah yes, good point. Well, just submit it as if it should be added at the right place, but putting the
Kconfigchanges in separate. If this driver is not that different than the other drx drivers, I may try to find some time to fix it on the same way.You may also take a look at the history for the drx-k merging patches. I basically wrote a few small perl scripts to correct coding style, and a few manual work.
Quoted 9 lines
If you have specific questions regarding anything you see in the driver, let me know. I don't have much time nowadays but will find the time if you ask concise questions.
Good luck. It will be great to finally see this merged upstream.
Devin
Re: Staging questions: WAS Re: [PATCH 0/7] Staging submission: PCTV 74e drivers and some cleanup
Em 20-10-2011 08:53, Patrick Dickey escreveu:
Quoted 5 lines
Thank you for the suggestions (both of you). I'll submit a pull request by this weekend (as I want to test it again in Ubuntu 11.10 just to make sure everything works). And for Mauro, is there a direct link to the scripts? I looked for them after the last time I emailed, but couldn't find them (or I wasn't looking in the right place).
Yes, but it is not easy to navigate into it. They were added as comments at the git history. You can easily get them by using this command:
$ git log drivers/media/dvb/frontends/drxk_hard.c
It basically shows all changes for drxk_hard. Several of the initial changesets contain the scripts I used to produce the patches.
For example, at changeset ea90f011fdcc3d4fde78532eab8af09637176765 contains one:
http://git.linuxtv.org/media_tree.git/commitdiff/ea90f011fdcc3d4fde78532eab8af09637176765
That script removes the ugly CHK_ERROR macro that can hide things, as the macro contains a flow control change inside, and silently touches the status var. At the drx drivers I've cleaned up, they used to do something like:
#define CHK_ERROR(s) if ((status = s) < 0) break
...
int status = 0;
do {
CHK_ERROR(Write16_0(state, SIO_CC_PWD_MODE__A,
SIO_CC_PWD_MODE_LEVEL_NONE));
...
} while (0);And, inside CHK_ERROR, there was a break if error.
It is worthy to comment that checkpatch did a very well job pointing this problem:
this only works well if there aren't any loop inside the do. However, I got several cases where the above weren't work as expected, as there was an extra loop inside the do/while.
So, after appling the above change, I had to manually write a patch replacing the do/while logic with a goto error approach:
http://git.linuxtv.org/media_tree.git/commitdiff/be44eb283b97c29b06a125cb5527b299d84315f4
So, the above were rewritten as:
int status = 0; status = Write16_0(state, SIO_CC_PWD_MODE__A, SIO_CC_PWD_MODE_LEVEL_NONE); if (status < 0) goto error; ... error: return status;
The end result is cleaner, easier to review, and won't contain hidden troubles due to assumption that all calls to CHK_ERROR macro would happen from a do/while logic with no extra loop inside.
It should be noticed that I wrote the scripts specifically to replace the bad things I found at the drx-k driver. They are similar to the ones I wrote for drx-d, but I had to change some things, as the logic was not identical (and/or because I've improved the scripts I used for drx-d). In other words, you'll need to verify if they apply for your drx driver or not, and review the diff patch, to be sure that the patch won't break anything.
At the end, you'll need to re-test the driver, as you might have added some bad things at the conversion.
I hope that helps.
Quoted 53 lines
Have a great day:)
Patrick.Quoted 47 lines · Mauro Carvalho Chehab
Em 19-10-2011 11:57, Devin Heitmueller escreveu:
Quoted 19 lines
Hi Patrick,
Quoted 3 lines · Patrick Dickey
I'm posting this question under this thread because the subject pertains to the question (in that I'm asking about staging and about the PCTV 80e drivers).
You should definitely be looking at the "as102" thread that is currently going on this mailing list. Piotr is actually going through the same process as you are (he is working on upstreaming the as102 driver from a kernellabs.com tree). He made some pretty common mistakes (all perfectly understandable), and your reading the thread might help you avoid them (and having to redo your patch series).
Quoted 4 lines
I started cleaning up the drx39xx* drivers for the PCTV-80e and have them in a github repository. Ultimately I want to send a pull request, so other people can finish the cleaning (as I'm not comfortable with pulling out the #ifdef statements myself).
Quoted 7 lines
You should definitely ask Mauro how he expects to do a staging driver for a demodulator before you do any further work. The staging tree works well for bridge drivers, but demod drivers such as the drx require code in the bridge driver (the em28xx in this case), so it's not clear how you would do staging for a product where the bridge driver isn't in staging as well. The answer to that question will likely guide you in how to get the driver into staging.
Ah yes, good point. Well, just submit it as if it should be added at the right place, but putting the
Kconfigchanges in separate. If this driver is not that different than the other drx drivers, I may try to find some time to fix it on the same way.You may also take a look at the history for the drx-k merging patches. I basically wrote a few small perl scripts to correct coding style, and a few manual work.
Quoted 9 lines
If you have specific questions regarding anything you see in the driver, let me know. I don't have much time nowadays but will find the time if you ask concise questions.
Good luck. It will be great to finally see this merged upstream.
Devin
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/7 Staging submission: PCTV 74e driver (as102)
Staging submission: PCTV 74e driver (as102)
From: Devin Heitmueller<[email protected]>
pull as102 driver from
This is driver for PCTV 74e DVB-T USB tuner, taken from [1], written by Devin Heitmueller using the GPL reference driver provided by Abilis.
The only change needed to compile it in current git tree [2] was changing calls usb_buffer_alloc() and usb_buffer_free() to usb_alloc_coherent() and usb_free_coherent(). It's included in this patch.
Patch was tested by me on amd64.
[1]http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
[2] git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git kernel-3.1.0-git9+
drivers/staging/as102/as102_drv.c +360 -0
@@ -0,0 +1,360 @@ +/* +* Abilis Systems Single DVB-T Receiver +* Copyright (C) 2008 Pierrick Hascoet<[email protected]> +* Copyright (C) 2010 Devin Heitmueller<[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#include <linux/kernel.h> +#include <linux/errno.h> +#include <linux/init.h> +#include <linux/slab.h> +#include <linux/module.h> +#include <linux/mm.h> +#include <linux/kref.h> +#include <asm/uaccess.h> +#include <linux/usb.h> + +/* header file for Usb device driver*/ +#include "as102_drv.h" +#include "as102_fw.h" + +#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) +#include "dvbdev.h" +#else +#warning >>> DVB_CORE not defined !!!<<< +#endif + +int debug; +module_param_named (debug, debug, int,0644 ); +MODULE_PARM_DESC (debug,"Turn on/off debugging (default: off)" ); + +int dual_tuner; +module_param_named (dual_tuner, dual_tuner, int,0644 ); +MODULE_PARM_DESC (dual_tuner,"Activate Dual-Tuner config (default: off)" ); + +static int fw_upload =1 ; +module_param_named (fw_upload, fw_upload, int,0644 ); +MODULE_PARM_DESC (fw_upload,"Turn on/off default FW upload (default: on)" ); + +static int pid_filtering; +module_param_named (pid_filtering, pid_filtering, int,0644 ); +MODULE_PARM_DESC (pid_filtering,"Activate HW PID filtering (default: off)" ); + +static int ts_auto_disable; +module_param_named (ts_auto_disable, ts_auto_disable, int,0644 ); +MODULE_PARM_DESC (ts_auto_disable,"Stream Auto Enable on FW (default: off)" ); + +int elna_enable =1 ; +module_param_named (elna_enable, elna_enable, int,0644 ); +MODULE_PARM_DESC (elna_enable,"Activate eLNA (default: on)" ); + +#ifdef DVB_DEFINE_MOD_OPT_ADAPTER_NR +DVB_DEFINE_MOD_OPT_ADAPTER_NR (adapter_nr); +#endif + +#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) +static void as102_stop_stream (struct as102_dev_t *dev) +{ +struct as102_bus_adapter_t *bus_adap; + +if (dev !=NULL ) + bus_adap =&dev->bus_adap; +else +return ; + +if (bus_adap->ops->stop_stream !=NULL ) + bus_adap->ops->stop_stream (dev); + +if (ts_auto_disable) { +if (mutex_lock_interruptible (&dev->bus_adap.lock)) +return ; + +if (as10x_cmd_stop_streaming (bus_adap)<0 ) +dprintk (debug,"as10x_cmd_stop_streaming failed\n" ); + +mutex_unlock (&dev->bus_adap.lock); + } +} + +static int as102_start_stream (struct as102_dev_t *dev) +{ +struct as102_bus_adapter_t *bus_adap; +int ret = -EFAULT ; + +if (dev !=NULL ) + bus_adap =&dev->bus_adap; +else +return ret; + +if (bus_adap->ops->start_stream !=NULL ) + ret = bus_adap->ops->start_stream (dev); + +if (ts_auto_disable) { +if (mutex_lock_interruptible (&dev->bus_adap.lock)) +return -EFAULT ; + + ret =as10x_cmd_start_streaming (bus_adap); + +mutex_unlock (&dev->bus_adap.lock); + } + +return ret; +} + +static int as10x_pid_filter (struct as102_dev_t *dev, +int index,u16 pid,int onoff) { + +struct as102_bus_adapter_t *bus_adap =&dev->bus_adap; +int ret = -EFAULT ; + +ENTER (); + +if (mutex_lock_interruptible (&dev->bus_adap.lock)) { +dprintk (debug,"mutex_lock_interruptible(lock) failed !\n" ); +return -EBUSY ; + } + +switch (onoff) { +case 0 : + ret =as10x_cmd_del_PID_filter (bus_adap, (uint16_t ) pid); +dprintk (debug,"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n" , + index, pid, ret); +break ; +case 1 : + { +struct as10x_ts_filter filter; + + filter.type =TS_PID_TYPE_TS ; + filter.idx =0xFF ; + filter.pid = pid; + + ret =as10x_cmd_add_PID_filter (bus_adap,&filter); +dprintk (debug,"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n" , + index, filter.idx, filter.pid, ret); +break ; + } + } + +mutex_unlock (&dev->bus_adap.lock); + +LEAVE (); +return ret; +} + +static int as102_dvb_dmx_start_feed (struct dvb_demux_feed *dvbdmxfeed) +{ +int ret =0 ; +struct dvb_demux *demux = dvbdmxfeed->demux; +struct as102_dev_t *as102_dev = demux->priv; + +ENTER (); + +if (mutex_lock_interruptible (&as102_dev->sem)) +return -ERESTARTSYS ; + +if (pid_filtering) { +as10x_pid_filter (as102_dev, + dvbdmxfeed->index, dvbdmxfeed->pid,1 ); + } + +if (as102_dev->streaming++ ==0 ) + ret =as102_start_stream (as102_dev); + +mutex_unlock (&as102_dev->sem); +LEAVE (); +return ret; +} + +static int as102_dvb_dmx_stop_feed (struct dvb_demux_feed *dvbdmxfeed) +{ +struct dvb_demux *demux = dvbdmxfeed->demux; +struct as102_dev_t *as102_dev = demux->priv; + +ENTER (); + +if (mutex_lock_interruptible (&as102_dev->sem)) +return -ERESTARTSYS ; + +if (--as102_dev->streaming ==0 ) +as102_stop_stream (as102_dev); + +if (pid_filtering) { +as10x_pid_filter (as102_dev, + dvbdmxfeed->index, dvbdmxfeed->pid,0 ); + } + +mutex_unlock (&as102_dev->sem); +LEAVE (); +return 0 ; +} +#endif + +int as102_dvb_register (struct as102_dev_t *as102_dev) +{ +int ret =0 ; +ENTER (); + +#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) + ret =dvb_register_adapter (&as102_dev->dvb_adap, + as102_dev->name, +THIS_MODULE , +#if defined(CONFIG_AS102_USB) + &as102_dev->bus_adap.usb_dev->dev +#elif defined(CONFIG_AS102_SPI ) + &as102_dev->bus_adap.spi_dev->dev +#else +#error >>> dvb_register_adapter<<< +#endif +#ifdef DVB_DEFINE_MOD_OPT_ADAPTER_NR + , adapter_nr +#endif + ); +if (ret<0 ) { +err ("%s: dvb_register_adapter() failed (errno = %d)" , + __func__, ret); + goto failed; + } + + as102_dev->dvb_dmx.priv = as102_dev; + as102_dev->dvb_dmx.filternum = pid_filtering ?16 :256 ; + as102_dev->dvb_dmx.feednum =256 ; + as102_dev->dvb_dmx.start_feed = as102_dvb_dmx_start_feed; + as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed; + + as102_dev->dvb_dmx.dmx.capabilities =DMX_TS_FILTERING | +DMX_SECTION_FILTERING ; + + as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum; + as102_dev->dvb_dmxdev.demux =&as102_dev->dvb_dmx.dmx; + as102_dev->dvb_dmxdev.capabilities =0 ; + + ret =dvb_dmx_init (&as102_dev->dvb_dmx); +if (ret<0 ) { +err ("%s: dvb_dmx_init() failed (errno = %d)" , __func__, ret); + goto failed; + } + + ret =dvb_dmxdev_init (&as102_dev->dvb_dmxdev,&as102_dev->dvb_adap); +if (ret<0 ) { +err ("%s: dvb_dmxdev_init() failed (errno = %d)" , __func__, + ret); + goto failed; + } + + ret =as102_dvb_register_fe (as102_dev,&as102_dev->dvb_fe); +if (ret<0 ) { +err ("%s: as102_dvb_register_frontend() failed (errno = %d)" , + __func__, ret); + goto failed; + } +#endif + +/* init bus mutex for token locking */ +mutex_init (&as102_dev->bus_adap.lock); + +/* init start / stop stream mutex */ +mutex_init (&as102_dev->sem); + +#if defined(CONFIG_FW_LOADER ) || defined(CONFIG_FW_LOADER_MODULE ) +/* +* try to load as102 firmware. If firmware upload failed, we'll be +* able to upload it later. +*/ +if (fw_upload) +try_then_request_module (as102_fw_upload (&as102_dev->bus_adap), +"firmware_class" ); +#endif + +failed: +LEAVE (); +/* FIXME: free dvb_XXX */ +return ret; +} + +void as102_dvb_unregister (struct as102_dev_t *as102_dev) +{ +ENTER (); + +#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) +/* unregister as102 frontend */ +as102_dvb_unregister_fe (&as102_dev->dvb_fe); + +/* unregister demux device */ +dvb_dmxdev_release (&as102_dev->dvb_dmxdev); +dvb_dmx_release (&as102_dev->dvb_dmx); + +/* unregister dvb adapter */ +dvb_unregister_adapter (&as102_dev->dvb_adap); +#endif +LEAVE (); +} + +static int __init as102_driver_init (void ) +{ +int ret =0 ; + +ENTER (); + +/* register this driver with the low level subsystem */ +#if defined(CONFIG_AS102_USB ) + ret =usb_register (&as102_usb_driver); +if (ret) +err ("usb_register failed (ret = %d)" , ret); +#endif +#if defined(CONFIG_AS102_SPI ) + ret =spi_register_driver (&as102_spi_driver); +if (ret) +printk (KERN_ERR "spi_register failed (ret = %d)" , ret); +#endif + +LEAVE (); +return ret; +} + +/* +* Mandatory function : Adds a special section to the module indicating +* where initialisation function is defined +*/ +module_init (as102_driver_init); + +/** +* \brief as102 driver exit point. This function is called when device has +* to be removed. +*/ +static void __exit as102_driver_exit(void) +{ +ENTER (); +/* deregister this driver with the low level bus subsystem */ +#if defined(CONFIG_AS102_USB ) +usb_deregister (&as102_usb_driver); +#endif +#if defined(CONFIG_AS102_SPI ) +spi_unregister_driver (&as102_spi_driver); +#endif +LEAVE (); +} + +/* +* required function for unload: Adds a special section to the module +* indicating where unload function is defined +*/ +module_exit (as102_driver_exit); +/* modinfo details */ +MODULE_DESCRIPTION (DRIVER_FULL_NAME ); +MODULE_LICENSE ("GPL" ); +MODULE_AUTHOR ("Pierrick Hascoet<[email protected]>" ); + +/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as102_drv.h +147 -0
147 lines not on this page · raw message
drivers/staging/as102/as102_fe.c +675 -0
675 lines not on this page · raw message
drivers/staging/as102/as102_fw.c +251 -0
251 lines not on this page · raw message
drivers/staging/as102/as102_fw.h +42 -0
42 lines not on this page · raw message
drivers/staging/as102/as102_usb_drv.c +484 -0
484 lines not on this page · raw message
drivers/staging/as102/as102_usb_drv.h +59 -0
59 lines not on this page · raw message
drivers/staging/as102/as10x_cmd.c +481 -0
481 lines not on this page · raw message
drivers/staging/as102/as10x_cmd_cfg.c +238 -0
238 lines not on this page · raw message
drivers/staging/as102/as10x_cmd.h +540 -0
263 lines not on this page · raw message
drivers/staging/as102/as10x_cmd_stream.c +247 -0
247 lines not on this page · raw message
drivers/staging/as102/as10x_handle.h +58 -0
58 lines not on this page · raw message
drivers/staging/as102/as10x_types.h +198 -0
198 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Quoted 26 lines · On Oct 15 Piotr Chmura wrote:
Staging submission: PCTV 74e driver (as102)
From: Devin Heitmueller<[email protected]>
pull as102 driver from
This is driver for PCTV 74e DVB-T USB tuner, taken from [1], written by Devin Heitmueller using the GPL reference driver provided by Abilis.
The only change needed to compile it in current git tree [2] was changing calls
usb_buffer_alloc()andusb_buffer_free()tousb_alloc_coherent()andusb_free_coherent(). It's included in this patch.Patch was tested by me on amd64.
[1]http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
[2]git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitkernel-3.1.0-git9+Signed-off-by Piotr Chmura<[email protected]>Cc Devin Heitmueller<[email protected]>Cc Greg HK<[email protected]>diff -Nur
linux.clean/drivers/staging/as102/as102_drv.clinux.as102_initial/drivers/staging/as102/as102_drv.c
drivers/staging/as102/as102_drv.c line 4
Quoted 4 lines
drivers/staging/as102/as102_drv.c +4
-0@@ -0,0 +1,360 @@ +/* +* Abilis Systems Single DVB-T Receiver +* Copyright (C) 2008 Pierrick Hascoet<[email protected]> +* Copyright (C) 2010 Devin Heitmueller<[email protected]>
Hi Piotr,
thanks for getting this going again. - I have not yet looked through the source but have some small remarks on the patch format.
- In your changelogs and in the diffs, somehow the space between real name and e-mail address got lost.
- The repetition of the Subject: line as first line in the changelog is unnecessary (and would cause an undesired duplication e.g. when git-am is used, last time I checked).
- AFAICT, author of patch 1/7 is not Devin but you. Hence the From: line right above the changelog is wrong.
- The reference to the source hg tree is very helpful. However, since the as102 related history in there is very well laid out, it may be beneficial to quote some of this prior history. I suggest, include the changelog of "as102: import initial as102 driver",
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/rev/a78bda1e1a0b
(but mark it clearly as a quote from the out-of-tree repo), and include a shortlog from this commit inclusive until the head commit inclusive. (Note, the hg author field appears to be wrong; some of the changes apparently need to be attributed to Pierrick Hascoet as author.) This would IMO improve the picture of who contributed what when this goes into mainline git history, even though the hg history needed to be discarded.
- A diffstat is always very nice to have in a patch posting. Most tools for patch generation make it easy to add, and it helps the recipients of the patch posting.
(Also, a diffstat of all patches combined would be good to have in the introductory PATCH 0/n posting, but not many developers take the time to do so.)
Again, thanks for the effort and also thanks to Devin for making it possible.
Signature · 3 lines
Stefan Richter -=====-==-== =-=- =---- http://arcgraph.de/sr/
Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Quoted 35 lines · Stefan Richter
Hi Piotr,
thanks for getting this going again. - I have not yet looked through the source but have some small remarks on the patch format.
- In your changelogs and in the diffs, somehow the space between real name and e-mail address got lost.
- The repetition of the Subject: line as first line in the changelog is unnecessary (and would cause an undesired duplication e.g. when git-am is used, last time I checked).
- AFAICT, author of patch 1/7 is not Devin but you. Hence the From: line right above the changelog is wrong.
- The reference to the source hg tree is very helpful. However, since the as102 related history in there is very well laid out, it may be beneficial to quote some of this prior history. I suggest, include the changelog of "as102: import initial as102 driver",
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/rev/a78bda1e1a0b
(but mark it clearly as a quote from the out-of-tree repo), and include a shortlog from this commit inclusive until the head commit inclusive. (Note, the hg author field appears to be wrong; some of the changes apparently need to be attributed to Pierrick Hascoet as author.) This would IMO improve the picture of who contributed what when this goes into mainline git history, even though the hg history needed to be discarded.- A diffstat is always very nice to have in a patch posting. Most tools for patch generation make it easy to add, and it helps the recipients of the patch posting.
(Also, a diffstat of all patches combined would be good to have in the introductory PATCH 0/n posting, but not many developers take the time to do so.)
Quoted 2 lines
Again, thanks for the effort and also thanks to Devin for making it possible.
I think collapsing my entire patch series in to a single patch would not be acceptable, as it loses the entire history of what code was originally delivered by Abilis as well as what changes I made. The fact that it's from multiple authors (including a commercial entity contributing the code) makes this worse.
I think the tree does need to be rebased, but I don't think the entire patch series would need to be reworked to be on staging from the beginning. You could probably import the first patch (as102: import initial as102 driver), fix the usb_alloc_coherent() so that it compiles (and put a note in it saying you did), apply the rest of the patch series, and then add a final patch that says something like "moving to staging as code is not production ready". This would allow the history to be preserved without having to rebase every patch to deal with the files being moved to the staging tree.
An alternative would be make a minor tweak to my first patch which removes the driver from the makefile. Then every patch in the patch series wouldn't actually have to compile successfully until the very end when you add it back into the Makefile. This is a luxury you can do when it's a brand new driver.
When it's a brand new driver there is a bit more flexibility as long as you don't break "git bisect". Both of the approaches described above accomplish that.
Mauro, what do you think?
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Em 16-10-2011 09:45, Devin Heitmueller escreveu:
Quoted 46 lines
Quoted 35 lines · Stefan Richter
Hi Piotr,
thanks for getting this going again. - I have not yet looked through the source but have some small remarks on the patch format.
- In your changelogs and in the diffs, somehow the space between real name and e-mail address got lost.
- The repetition of the Subject: line as first line in the changelog is unnecessary (and would cause an undesired duplication e.g. when git-am is used, last time I checked).
- AFAICT, author of patch 1/7 is not Devin but you. Hence the From: line right above the changelog is wrong.
- The reference to the source hg tree is very helpful. However, since the as102 related history in there is very well laid out, it may be beneficial to quote some of this prior history. I suggest, include the changelog of "as102: import initial as102 driver",
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/rev/a78bda1e1a0b
(but mark it clearly as a quote from the out-of-tree repo), and include a shortlog from this commit inclusive until the head commit inclusive. (Note, the hg author field appears to be wrong; some of the changes apparently need to be attributed to Pierrick Hascoet as author.) This would IMO improve the picture of who contributed what when this goes into mainline git history, even though the hg history needed to be discarded.- A diffstat is always very nice to have in a patch posting. Most tools for patch generation make it easy to add, and it helps the recipients of the patch posting.
(Also, a diffstat of all patches combined would be good to have in the introductory PATCH 0/n posting, but not many developers take the time to do so.)Quoted 2 lines
Again, thanks for the effort and also thanks to Devin for making it possible.
I think collapsing my entire patch series in to a single patch would not be acceptable, as it loses the entire history of what code was originally delivered by Abilis as well as what changes I made. The fact that it's from multiple authors (including a commercial entity contributing the code) makes this worse.
Quoted 9 lines
I think the tree does need to be rebased, but I don't think the entire patch series would need to be reworked to be on staging from the beginning. You could probably import the first patch (as102: import initial as102 driver), fix the
usb_alloc_coherent()so that it compiles (and put a note in it saying you did), apply the rest of the patch series, and then add a final patch that says something like "moving to staging as code is not production ready". This would allow the history to be preserved without having to rebase every patch to deal with the files being moved to the staging tree.
Rebasing a changeset to move it to staging is not as complex as it seems. I did it with tm6000 at the time I merged it. A simple bash script could do that. Something like (untested):
$ git export some_base_reference $ for i in 00*.patch; do sed s,/drivers/media/video,/drivers/staging,g <$i >a && mv a $i; done $ mkdir patches/ $ mv 00*.patches patches/ $ (cd patches; ls *.patch > series) $ git quiltimport
Of course, the Makefike/Kconfig patch will need changes, but this is as easy as just dropping the hunks that are touching at /drivers/media/video/Makefile and /drivers/media/video/Kconfig, and then adding a final patch adding it to the /drivers/staging/*.
Quoted 7 lines
An alternative would be make a minor tweak to my first patch which removes the driver from the makefile. Then every patch in the patch series wouldn't actually have to compile successfully until the very end when you add it back into the
Makefile. This is a luxury you can do when it's a brand new driver.
Quoted 5 lines
When it's a brand new driver there is a bit more flexibility as long as you don't break "git bisect". Both of the approaches described above accomplish that.
Mauro, what do you think?
Didn't actually reviewed the changeset, but let me comment about the submission procedure.
Folding patches from different authors generally is not a good idea. As Devin said, things like replacing "foo" by "bar" because "foo" core function were replaced by "bar" upstream is the kind of thing that you could fold, if you properly document it with:
[john@john_email.com: replaced "foo" by "bar" to fix compilation]
So, you should rebase the patchsets, instead of just folding everything. It is up to you to change the patches on each patch, or to do it only at a final patch. Both ways work for me.
I suggest you to remove the Kconfig/Makefile hunks that enables the driver compilation from the original series, and apply it as a final patch at the end. This makes your rebasing work easier, as you won't need to test patch by patch if they are not breaking compilation.
In any case, when analyzing a driver submission like that, I generally just apply everything from a quilt series, see the final result and review it, as:
1) the history doesn't matter for me;
2) it is easier to review a new driver as a hole, as the history
may be full of things that will later be changed by something else;
3) checkpatch will be happier, especially if you've added some
patches to fix checkpatch complains at the end of the series.
Btw, I've agreed with Greg that I'll be moving the media staging stuff into a separate directory. I'll prepare the patches later, probably during the next merge window, in order to avoid merge conflicts between Greg's tree and mine, especially since I intend to move some drivers out of staging, as they seem to be ready to be at drivers/media.
So, if you're submitting a new driver for staging, I suggest you to put it already into drivers/staging/media. This mean one less driver for me to move on my upcoming changeset ;)
I hope that helps.
cover staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Quoted 124 lines · On Sun, 16 Oct 2011 11:44:14 -0200 Mauro Carvalho Chehab <[email protected]>…
Em 16-10-2011 09:45, Devin Heitmueller escreveu:
Quoted 46 lines
Quoted 35 lines · Stefan Richter
Hi Piotr,
thanks for getting this going again. - I have not yet looked through the source but have some small remarks on the patch format.
- In your changelogs and in the diffs, somehow the space between real name and e-mail address got lost.
- The repetition of the Subject: line as first line in the changelog is unnecessary (and would cause an undesired duplication e.g. when git-am is used, last time I checked).
- AFAICT, author of patch 1/7 is not Devin but you. Hence the From: line right above the changelog is wrong.
- The reference to the source hg tree is very helpful. However, since the as102 related history in there is very well laid out, it may be beneficial to quote some of this prior history. I suggest, include the changelog of "as102: import initial as102 driver",
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/rev/a78bda1e1a0b
(but mark it clearly as a quote from the out-of-tree repo), and include a shortlog from this commit inclusive until the head commit inclusive. (Note, the hg author field appears to be wrong; some of the changes apparently need to be attributed to Pierrick Hascoet as author.) This would IMO improve the picture of who contributed what when this goes into mainline git history, even though the hg history needed to be discarded.- A diffstat is always very nice to have in a patch posting. Most tools for patch generation make it easy to add, and it helps the recipients of the patch posting.
(Also, a diffstat of all patches combined would be good to have in the introductory PATCH 0/n posting, but not many developers take the time to do so.)Quoted 2 lines
Again, thanks for the effort and also thanks to Devin for making it possible.
I think collapsing my entire patch series in to a single patch would not be acceptable, as it loses the entire history of what code was originally delivered by Abilis as well as what changes I made. The fact that it's from multiple authors (including a commercial entity contributing the code) makes this worse.
Quoted 9 lines
I think the tree does need to be rebased, but I don't think the entire patch series would need to be reworked to be on staging from the beginning. You could probably import the first patch (as102: import initial as102 driver), fix the
usb_alloc_coherent()so that it compiles (and put a note in it saying you did), apply the rest of the patch series, and then add a final patch that says something like "moving to staging as code is not production ready". This would allow the history to be preserved without having to rebase every patch to deal with the files being moved to the staging tree.Rebasing a changeset to move it to staging is not as complex as it seems. I did it with tm6000 at the time I merged it. A simple bash script could do that. Something like (untested):
$ git export some_base_reference $ for i in 00*.patch; do sed s,/drivers/media/video,/drivers/staging,g <$i >a && mv a $i; done $ mkdir patches/ $ mv 00*.patches patches/ $ (cd patches; ls *.patch > series) $ git quiltimportOf course, the Makefike/Kconfig patch will need changes, but this is as easy as just dropping the hunks that are touching at /drivers/media/video/Makefile and /drivers/media/video/Kconfig, and then adding a final patch adding it to the /drivers/staging/*.
Quoted 7 lines
An alternative would be make a minor tweak to my first patch which removes the driver from the makefile. Then every patch in the patch series wouldn't actually have to compile successfully until the very end when you add it back into the
Makefile. This is a luxury you can do when it's a brand new driver.Quoted 5 lines
When it's a brand new driver there is a bit more flexibility as long as you don't break "git bisect". Both of the approaches described above accomplish that.
Mauro, what do you think?
Didn't actually reviewed the changeset, but let me comment about the submission procedure.
Folding patches from different authors generally is not a good idea. As Devin said, things like replacing "foo" by "bar" because "foo" core function were replaced by "bar" upstream is the kind of thing that you could fold, if you properly document it with:
[john@john_email.com: replaced "foo" by "bar" to fix compilation]
So, you should rebase the patchsets, instead of just folding everything. It is up to you to change the patches on each patch, or to do it only at a final patch. Both ways work for me.
I suggest you to remove the Kconfig/Makefile hunks that enables the driver compilation from the original series, and apply it as a final patch at the end. This makes your rebasing work easier, as you won't need to test patch by patch if they are not breaking compilation.
In any case, when analyzing a driver submission like that, I generally just apply everything from a quilt series, see the final result and review it, as:
1) the history doesn't matter for me;
2) it is easier to review a new driver as a hole, as the history
may be full of things that will later be changed by something else;
3) checkpatch will be happier, especially if you've added some
patches to fix checkpatch complains at the end of the series.Btw, I've agreed with Greg that I'll be moving the media staging stuff into a separate directory. I'll prepare the patches later, probably during the next merge window, in order to avoid merge conflicts between Greg's tree and mine, especially since I intend to move some drivers out of staging, as they seem to be ready to be at
drivers/media.So, if you're submitting a new driver for staging, I suggest you to put it already into
drivers/staging/media. This mean one less driver for me to move on my upcoming changeset ;)
Quoted 5 lines
I hope that helps.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for comments for all of you.
[PATCH 1-12/14] Following your guidelines i exported all changes from hg one by one. This way we will have all history in kernel tree. I moved driver to staging/media and removed Kconfig/Makefile changes in parent directory in first patch.
[PATCH 13/14] Fixes compilation and introduces Kconfig/Makefile changes in staging (which probably you'll need to change anyway in your tree).
[PATCH 14/14] Adds nBox tuner I have, so i can test the driver (works fine).
I think we can take care of making checkpatch happy when the driver will be in place. I'll resend my previous patches (esp. "[PATCH 4/7] as102: cleanup - formatting code" needs some more work).
Stats for package:
drivers/staging/Kconfig | 2 drivers/staging/Makefile | 1 drivers/staging/media/as102/Kconfig | 7 drivers/staging/media/as102/Makefile | 5 drivers/staging/media/as102/as102_drv.c | 454 ++++++++-- drivers/staging/media/as102/as102_drv.h | 147 +++ drivers/staging/media/as102/as102_fe.c | 1131 +++++++++++++++++++------ drivers/staging/media/as102/as102_fw.c | 337 ++++++- drivers/staging/media/as102/as102_fw.h | 42 drivers/staging/media/as102/as102_usb_drv.c | 584 +++++++++++- drivers/staging/media/as102/as102_usb_drv.h | 72 + drivers/staging/media/as102/as10x_cmd.c | 983 ++++++++++++++++----- drivers/staging/media/as102/as10x_cmd.h | 540 +++++++++++ drivers/staging/media/as102/as10x_cmd_cfg.c | 492 ++++++++-- drivers/staging/media/as102/as10x_cmd_stream.c | 555 ++++++++---- drivers/staging/media/as102/as10x_handle.h | 58 + drivers/staging/media/as102/as10x_types.h | 198 ++++ 17 files changed, 4705 insertions(+), 903 deletions(-)
Re: [PATCH 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Quoted 4 lines · Piotr Chmura
Thanks for comments for all of you.
[PATCH 1-12/14] Following your guidelines i exported all changes from hg one by one. This way we will have all history in kernel tree. I moved driver to staging/media and removed Kconfig/Makefile changes in parent directory in first patch.
Hello Piotr,
Not that I want to create more work for you, but it would appear that your patches stripped off all the Signed-off-by lines for both myself and Pierrick Hascoet (the developer from the hardware vendor). You have replaced them with "cc:" lines, which breaks the chain of "Developer's Certificate of Origin".
When you take somebody else's patches, you need to preserve any existing Signed-off-by lines, adding your own at the bottom of the list.
In other words, the first patch should be:
instead of:
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Re: [PATCH 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Quoted 24 lines · On Tue, 18 Oct 2011 11:52:17 -0400 Devin Heitmueller…
Quoted 4 lines · Piotr Chmura
Thanks for comments for all of you.
[PATCH 1-12/14] Following your guidelines i exported all changes from hg one by one. This way we will have all history in kernel tree. I moved driver to staging/media and removed Kconfig/Makefile changes in parent directory in first patch.
Hello Piotr,
Not that I want to create more work for you, but it would appear that your patches stripped off all the Signed-off-by lines for both myself and Pierrick Hascoet (the developer from the hardware vendor). You have replaced them with "cc:" lines, which breaks the chain of "Developer's Certificate of Origin".
When you take somebody else's patches, you need to preserve any existing Signed-off-by lines, adding your own at the bottom of the list.
In other words, the first patch should be:
Signed-off-by Pierrick Hascoet <[email protected]>Signed-off-by Devin Heitmueller <[email protected]>Signed-off-by Piotr Chmura <[email protected]>
Quoted 15 lines
instead of:
Signed-off-by Piotr Chmura <[email protected]>Cc Pierrick Hascoet <[email protected]>Cc Devin Heitmueller <[email protected]>Devin
Signature · 6 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Ok, i'll resend them again.
Should I replay to every patch with something like [RESEND PATCH nn/mm]..., right ?
Peter
Re: [PATCH 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Quoted 43 lines · Piotr Chmura
Quoted 32 lines · On Tue, 18 Oct 2011 11:52:17 -0400 Devin Heitmueller…
Quoted 4 lines · Piotr Chmura
Thanks for comments for all of you.
[PATCH 1-12/14] Following your guidelines i exported all changes from hg one by one. This way we will have all history in kernel tree. I moved driver to staging/media and removed Kconfig/Makefile changes in parent directory in first patch.
Hello Piotr,
Not that I want to create more work for you, but it would appear that your patches stripped off all the Signed-off-by lines for both myself and Pierrick Hascoet (the developer from the hardware vendor). You have replaced them with "cc:" lines, which breaks the chain of "Developer's Certificate of Origin".
When you take somebody else's patches, you need to preserve any existing Signed-off-by lines, adding your own at the bottom of the list.
In other words, the first patch should be:
Signed-off-by Pierrick Hascoet <[email protected]>Signed-off-by Devin Heitmueller <[email protected]>Signed-off-by Piotr Chmura <[email protected]>instead of:
Signed-off-by Piotr Chmura <[email protected]>Cc Pierrick Hascoet <[email protected]>Cc Devin Heitmueller <[email protected]>Devin
Quoted 7 lines
--
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines
Ok, i'll resend them again.
Should I replay to every patch with something like [RESEND PATCH nn/mm]..., right ?
Peter
Hi Peter,
A common convention is to add the version of your patch in the subject like:
[PATCH v2 0/14] staging/media/as102: new driver submission
That way people can know that is actually a resend of a new patch-set and not a resend of the last one.
Anything that is between your Signed-off and the diff get trimmed by Git when applying a patch (that is why Devin and Pierrick Signed-off where stripped in first place). So you can add information about the changes there. Something like:
----
v2: preserve any existing Signed-off-by lines so it doesn't get stripped when applied.
diff -Nur linux.clean/drivers/staging/as102/as102_drv.c linux.as102_initial/drivers/staging/as102/as102_drv.c
--- linux.clean/drivers/staging/as102/as102_drv.c 1970-01-01
01:00:00.000000000 +0100
+++ linux.as102_initial/drivers/staging/as102/as102_drv.c 2011-10-14
17:55:02.000000000 +0200
@@ -0,0 +1,360 @@
+/*
+ * Abilis Systems Single DVB-T Receiver
+ * Copyright (C) 2008 Pierrick Hascoet<pierrick.hascoet@xxxxxxxxxx>
+ * Copyright (C) 2010 Devin Heitmueller<dheitmueller@xxxxxxxxxxxxxx>
Hope it helps,
Signature · 3 lines
Javier Martínez Canillas (+34) 682 39 81 69 Barcelona, Spain
Re: [PATCH 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
Em 19-10-2011 09:41, Javier Martinez Canillas escreveu:
Quoted 50 lines · Piotr Chmura
Quoted 43 lines
Quoted 32 lines · On Tue, 18 Oct 2011 11:52:17 -0400 Devin Heitmueller…
Quoted 4 lines · Piotr Chmura
Thanks for comments for all of you.
[PATCH 1-12/14] Following your guidelines i exported all changes from hg one by one. This way we will have all history in kernel tree. I moved driver to staging/media and removed Kconfig/Makefile changes in parent directory in first patch.
Hello Piotr,
Not that I want to create more work for you, but it would appear that your patches stripped off all the Signed-off-by lines for both myself and Pierrick Hascoet (the developer from the hardware vendor). You have replaced them with "cc:" lines, which breaks the chain of "Developer's Certificate of Origin".
When you take somebody else's patches, you need to preserve any existing Signed-off-by lines, adding your own at the bottom of the list.
In other words, the first patch should be:
Signed-off-by Pierrick Hascoet <[email protected]>Signed-off-by Devin Heitmueller <[email protected]>Signed-off-by Piotr Chmura <[email protected]>instead of:
Signed-off-by Piotr Chmura <[email protected]>Cc Pierrick Hascoet <[email protected]>Cc Devin Heitmueller <[email protected]>Devin
Quoted 7 lines
--
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 5 lines
Ok, i'll resend them again.
Should I replay to every patch with something like [RESEND PATCH nn/mm]..., right ?
Peter
Quoted 8 lines
Hi Peter,
A common convention is to add the version of your patch in the subject like:
[PATCH v2 0/14] staging/media/as102: new driver submission
That way people can know that is actually a resend of a new patch-set and not a resend of the last one.
Yes. Also, it seems that you've submitted only 12 patches of this 14 patch series. Where are the other two missing patches?
Quoted 28 lines
Anything that is between your Signed-off and the diff get trimmed by Git when applying a patch (that is why Devin and Pierrick Signed-off where stripped in first place). So you can add information about the changes there. Something like:
Signed-off-by Pierrick Hascoet <[email protected]>Signed-off-by Devin Heitmueller <[email protected]>Signed-off-by Piotr Chmura <[email protected]>----
v2: preserve any existing Signed-off-by lines so it doesn't get stripped when applied.
diff -Nur
linux.clean/drivers/staging/as102/as102_drv.clinux.as102_initial/drivers/staging/as102/as102_drv.c
---linux.clean/drivers/staging/as102/as102_drv.c1970-01-01
01:00:00.000000000 +0100
+++linux.as102_initial/drivers/staging/as102/as102_drv.c2011-10-14
17:55:02.000000000 +0200(quoted diff) +4
-0@@ -0,0 +1,360 @@ +/* + * Abilis Systems Single DVB-T Receiver + * Copyright (C) 2008 Pierrick Hascoet<pierrick.hascoet@xxxxxxxxxx> + * Copyright (C) 2010 Devin Heitmueller<dheitmueller@xxxxxxxxxxxxxx>Hope it helps,
Re: [PATCH 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)
W dniu 19.10.2011 13:44, Mauro Carvalho Chehab pisze:
Quoted 56 lines
Em 19-10-2011 09:41, Javier Martinez Canillas escreveu:
Quoted 55 lines · Piotr Chmura
Quoted 41 lines
Quoted 31 lines · On Tue, 18 Oct 2011 11:52:17 -0400 Devin…
Quoted 4 lines · Piotr Chmura
Thanks for comments for all of you.
[PATCH 1-12/14] Following your guidelines i exported all changes from hg one by one. This way we will have all history in kernel tree. I moved driver to staging/media and removed Kconfig/Makefile changes in parent directory in first patch.
Hello Piotr,
Not that I want to create more work for you, but it would appear that your patches stripped off all the Signed-off-by lines for both myself and Pierrick Hascoet (the developer from the hardware vendor). You have replaced them with "cc:" lines, which breaks the chain of "Developer's Certificate of Origin".
When you take somebody else's patches, you need to preserve any existing Signed-off-by lines, adding your own at the bottom of the list.
In other words, the first patch should be:
Signed-off-by Pierrick Hascoet<[email protected]>Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>instead of:
Signed-off-by Piotr Chmura<[email protected]>Cc Pierrick Hascoet<[email protected]>Cc Devin Heitmueller<[email protected]>Devin
Quoted 7 lines
--
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 5 lines
Ok, i'll resend them again.
Should I replay to every patch with something like [RESEND PATCH nn/mm]..., right ?
Peter
Hi Peter,
A common convention is to add the version of your patch in the subject like:
[PATCH v2 0/14] staging/media/as102: new driver submission
That way people can know that is actually a resend of a new patch-set and not a resend of the last one.
Thanks, I'll do it this way next time.
Quoted 2 lines
Yes. Also, it seems that you've submitted only 12 patches of this 14 patch series. Where are the other two missing patches?
13 and 14 were written by me, so they didn't suffer "signed-off-by" mistake. Do I need resend them too ?
Peter
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/14 staging/media/as102: initial import from Abilis
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Changes made by me:
1. Driver moved from media/dvb to staging/media
2. Removed Makefile/Kconfig - it doesn't compile in current tree
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318322 18000
# Node ID a78bda1e1a0badc4a1296be958f1f8a49014ae18 # Parent 37581bb7e6f1c5ba92c9b6934b4bf21e0e01cb2b
as102: import initial as102 driver
From: Pierrick Hascoet <[email protected]>
Import the original Abilis Systems as102 driver. The source is unmodified, with the only changes I've made so far were that I created a Kconfig and Makefile so that the code builds in a standard v4l-dvb tree.
This driver requires firmware (which Abilis has provided with redistribution
terms which will allow it to be bundled in the Linux distributions). The
firmware can be downloaded from here:
http://www.kernellabs.com/firmware/as102/
Thanks to Rainer Miethling from PCTV Systems for working to get the driver released (for use with the PCTV 74e) and Pierrick Hascoet from Abilis for authoring the driver.
Priority: normal
drivers/staging/media/as102/Kconfig new file +7 -0
@@ -0,0 +1,7 @@ +config DVB_AS102 + tristate "Abilis AS102 DVB receiver" + depends on DVB_CORE && USB && I2C && INPUT + help + Choose Y or M here if you have a device containing an AS102 + + To compile this driver as a module, choose M here
drivers/staging/media/as102/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +dvb-as102-objs := as102_drv.o as102_fw.o as10x_cmd.o as10x_cmd_stream.o as102_fe.o as102_usb_drv.o as10x_cmd_cfg.o + +obj-$(CONFIG_DVB_AS102) += dvb-as102.o + +EXTRA_CFLAGS += -DLINUX -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core
drivers/staging/media/as102/as102_drv.c new file +356 -0
356 lines not on this page · raw message
drivers/staging/media/as102/as102_drv.h new file +146 -0
146 lines not on this page · raw message
drivers/staging/media/as102/as102_fe.c new file +647 -0
647 lines not on this page · raw message
drivers/staging/media/as102/as102_fw.c new file +236 -0
236 lines not on this page · raw message
drivers/staging/media/as102/as102_fw.h new file +42 -0
42 lines not on this page · raw message
drivers/staging/media/as102/as102_usb_drv.c new file +432 -0
432 lines not on this page · raw message
drivers/staging/media/as102/as102_usb_drv.h new file +54 -0
54 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd.c new file +478 -0
478 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd.h new file +540 -0
540 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd_cfg.c new file +239 -0
57 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd_stream.c new file +256 -0
256 lines not on this page · raw message
drivers/staging/media/as102/as10x_handle.h new file +58 -0
58 lines not on this page · raw message
drivers/staging/media/as102/as10x_types.h new file +198 -0
198 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [PATCH 1/14] staging/media/as102: initial import from Abilis
Quoted 17 lines · Piotr Chmura
drivers/staging/media/as102/Kconfig new file +7
-0@@ -0,0 +1,7 @@ +config DVB_AS102 + tristate "Abilis AS102 DVB receiver" + depends on DVB_CORE && USB && I2C && INPUT + help + Choose Y or M here if you have a device containing an AS102 + + To compile this driver as a module, choose M heredrivers/staging/media/as102/Makefile new file +0
-0
drivers/staging/media/as102/Makefile line 5
Quoted 5 lines
drivers/staging/media/as102/Makefile new file +5
-0@@ -0,0 +1,5 @@ +dvb-as102-objs := as102_drv.o as102_fw.o as10x_cmd.o as10x_cmd_stream.o as102_fe.o as102_usb_drv.o as10x_cmd_cfg.o + +obj-$(CONFIG_DVB_AS102) += dvb-as102.o + +EXTRA_CFLAGS += -DLINUX -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core
It sounds like you're going to do a resend to add in the Signed-off-by lines?
It would be better to separate these two chunks out and put them at the end after you've fixed the compile errors in [PATCH 13/14].
regards,
dan carpenter
Re: [PATCH 1/14] staging/media/as102: initial import from Abilis
Em 18-10-2011 14:24, Dan Carpenter escreveu:
Quoted 27 lines · Piotr Chmura
Quoted 17 lines
drivers/staging/media/as102/Kconfig new file +7
-0@@ -0,0 +1,7 @@ +config DVB_AS102 + tristate "Abilis AS102 DVB receiver" + depends on DVB_CORE && USB && I2C && INPUT + help + Choose Y or M here if you have a device containing an AS102 + + To compile this driver as a module, choose M heredrivers/staging/media/as102/Makefile new file +0
-0drivers/staging/media/as102/Makefile line 5
Quoted 5 lines
drivers/staging/media/as102/Makefile new file +5
-0@@ -0,0 +1,5 @@ +dvb-as102-objs := as102_drv.o as102_fw.o as10x_cmd.o as10x_cmd_stream.o as102_fe.o as102_usb_drv.o as10x_cmd_cfg.o + +obj-$(CONFIG_DVB_AS102) += dvb-as102.o + +EXTRA_CFLAGS += -DLINUX -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-coreIt sounds like you're going to do a resend to add in the Signed-off-by lines?
Quoted 2 lines
It would be better to separate these two chunks out and put them at the end after you've fixed the compile errors in [PATCH 13/14].
This doesn't really matter, as the driver won't be added to the Kernel building system before patch 13/14, as drivers/staging/Makefile wasn't touch on patch 1/14.
Quoted 3 lines
regards,
dan carpenter
Re: [PATCH 1/14] staging/media/as102: initial import from Abilis
Quoted 5 lines · Mauro Carvalho Chehab
Quoted 2 lines
It would be better to separate these two chunks out and put them at the end after you've fixed the compile errors in [PATCH 13/14].
This doesn't really matter, as the driver won't be added to the Kernel building system before patch 13/14, as
drivers/staging/Makefilewasn't touch on patch 1/14.
Ah sorry. My bad.
regards,
dan carpenter
PATCH RESEND 1/14 staging/media/as102: initial import from Abilis
In reply to Piotr ChmuraPatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Changes made by me:
1. Driver moved from media/dvb to staging/media
2. Removed Makefile/Kconfig - it doesn't compile in current tree
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318322 18000
# Node ID a78bda1e1a0badc4a1296be958f1f8a49014ae18 # Parent 37581bb7e6f1c5ba92c9b6934b4bf21e0e01cb2b
as102: import initial as102 driver
From: Pierrick Hascoet <[email protected]>
Import the original Abilis Systems as102 driver. The source is unmodified, with the only changes I've made so far were that I created a Kconfig and Makefile so that the code builds in a standard v4l-dvb tree.
This driver requires firmware (which Abilis has provided with redistribution
terms which will allow it to be bundled in the Linux distributions). The
firmware can be downloaded from here:
http://www.kernellabs.com/firmware/as102/
Thanks to Rainer Miethling from PCTV Systems for working to get the driver released (for use with the PCTV 74e) and Pierrick Hascoet from Abilis for authoring the driver.
Priority: normal
drivers/staging/media/as102/Kconfig new file +7 -0
@@ -0,0 +1,7 @@ +config DVB_AS102 + tristate "Abilis AS102 DVB receiver" + depends on DVB_CORE && USB && I2C && INPUT + help + Choose Y or M here if you have a device containing an AS102 + + To compile this driver as a module, choose M here
drivers/staging/media/as102/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +dvb-as102-objs := as102_drv.o as102_fw.o as10x_cmd.o as10x_cmd_stream.o as102_fe.o as102_usb_drv.o as10x_cmd_cfg.o + +obj-$(CONFIG_DVB_AS102) += dvb-as102.o + +EXTRA_CFLAGS += -DLINUX -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core
drivers/staging/media/as102/as102_drv.c new file +356 -0
356 lines not on this page · raw message
drivers/staging/media/as102/as102_drv.h new file +146 -0
146 lines not on this page · raw message
drivers/staging/media/as102/as102_fe.c new file +647 -0
647 lines not on this page · raw message
drivers/staging/media/as102/as102_fw.c new file +236 -0
236 lines not on this page · raw message
drivers/staging/media/as102/as102_fw.h new file +42 -0
42 lines not on this page · raw message
drivers/staging/media/as102/as102_usb_drv.c new file +432 -0
432 lines not on this page · raw message
drivers/staging/media/as102/as102_usb_drv.h new file +54 -0
54 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd.c new file +478 -0
478 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd.h new file +540 -0
540 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd_cfg.c new file +239 -0
57 lines not on this page · raw message
drivers/staging/media/as102/as10x_cmd_stream.c new file +256 -0
256 lines not on this page · raw message
drivers/staging/media/as102/as10x_handle.h new file +58 -0
58 lines not on this page · raw message
drivers/staging/media/as102/as10x_types.h new file +198 -0
198 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Re: [RESEND PATCH 1/14] staging/media/as102: initial import from Abilis
W dniu 18.10.2011 21:46, Piotr Chmura pisze:
Quoted 5 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Changes made by me:
1. Driver moved from media/dvb to staging/media
2. Removed Makefile/Kconfig - it doesn't compile in current tree
(...)
drivers/staging/media/as102/as102_fe.c line 238
Quoted 8 lines
drivers/staging/media/as102/as102_fe.c new file +8
-0+ +/* +* Note: +* - in AS102 SNR=MER +* - the SNR will be returned in linear terms, i.e. not in dB +* - the accuracy equals ±2dB for a SNR range from 4dB to 30dB +* - the accuracy is>2dB for SNR values outside this range +*/
I found another issue here.
In this comment "±" is from upper ASCII (0xF1). Should I change it into sth. like "+/-" in this patch (1/14) or leave it and just resend without "Â" (wasn't there in original patch, don't know where it came from) ?
Peter
P.S. Thanks to Sylwester Nawrocki for pointing me out, that there is something wrong with patch 6/14, which was caused by this comment in 1/14.
Re: [RESEND PATCH 1/14] staging/media/as102: initial import from Abilis
Quoted 11 lines · On Oct 30 Piotr Chmura wrote:
Quoted 6 lines
+ * Note:
+ * - in AS102 SNR=MER+ * - the SNR will be returned in linear terms, i.e. not in dB + * - the accuracy equals ±2dB for a SNR range from 4dB to 30dB + * - the accuracy is>2dB for SNR values outside this range+ */
I found another issue here.
In this comment "±" is from upper ASCII (0xF1). Should I change it into sth. like "+/-" in this patch (1/14) or leave it and just resend without "Â" (wasn't there in original patch, don't know where it came from) ?
Special characters can be used in comments, provided that they are UTF-8 encoded. In case of names of persons or companies, it is very much desirable to preserve special characters. In case like this one on the other hand, sticking with ASCII (the 7 bit character table) might not be such a bad idea to keep things simple. But since you are passing on a patch from somebody else, the right thing to do is IMO to keep the special characters that the author chose and only make sure that the file (and the patch mailing) are UTF-8 encoded.
Signature · 3 lines
Stefan Richter -=====-==-== =-=- ====- http://arcgraph.de/sr/
Re: [RESEND PATCH 1/14] staging/media/as102: initial import from Abilis
In reply to Piotr ChmuraQuoted 7 lines · Piotr Chmura
W dniu 18.10.2011 21:46, Piotr Chmura pisze:
Quoted 5 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Changes made by me:
1. Driver moved from media/dvb to staging/media
2. Removed Makefile/Kconfig - it doesn't compile in current tree(...)
Quoted 13 lines
drivers/staging/media/as102/as102_fe.c line 238
Quoted 8 lines
drivers/staging/media/as102/as102_fe.c new file +8
-0+ +/* +* Note: +* - in AS102 SNR=MER +* - the SNR will be returned in linear terms, i.e. not in dB +* - the accuracy equals ±2dB for a SNR range from 4dB to 30dB +* - the accuracy is>2dB for SNR values outside this range +*/ I found another issue here.
In this comment "±" is from upper ASCII (0xF1). Should I change it into sth. like "+/-" in this patch (1/14) or leave it and just resend without "Â" (wasn't there in original patch, don't know where it came from) ?
I collected all your patches (1..14/14, as we agreed in private), did a bit of cleanup myself, re-edited the changelogs and I'm going to post the series which is hopefully ready for initial pull into staging/media. I've also removed that odd  character right from the first patch.
Quoted 5 lines
Peter
P.S. Thanks to Sylwester Nawrocki for pointing me out, that there is something wrong with patch 6/14, which was caused by this comment in 1/14.
---
Regards,
Sylwester
PATCH 2/14 staging/media/as102: checkpatch fixes
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318502 18000
# Node ID e2ba344c99936bddc46722f1f1efec5600c58659 # Parent a78bda1e1a0badc4a1296be958f1f8a49014ae18
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_drv.c
Priority: normal
drivers/staging/media/as102/as102_drv.c +50 -46
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -36,23 +37,23 @@#warning >>> DVB_CORE not defined !!! <<<#endif -int debug =0 ; +int debug;module_param_named (debug, debug, int,0644 );MODULE_PARM_DESC (debug,"Turn on/off debugging (default: off)" ); -int dual_tuner =0 ; +int dual_tuner;module_param_named (dual_tuner, dual_tuner, int,0644 ); -MODULE_PARM_DESC (dual_tuner,"Activate Dual-Tuner configuration (default: off)" ); +MODULE_PARM_DESC (dual_tuner,"Activate Dual-Tuner config (default: off)" );static int fw_upload =1 ;module_param_named (fw_upload, fw_upload, int,0644 );MODULE_PARM_DESC (fw_upload,"Turn on/off default FW upload (default: on)" ); -static int pid_filtering =0 ; +static int pid_filtering;module_param_named (pid_filtering, pid_filtering, int,0644 );MODULE_PARM_DESC (pid_filtering,"Activate HW PID filtering (default: off)" ); -static int ts_auto_disable =0 ; +static int ts_auto_disable;module_param_named (ts_auto_disable, ts_auto_disable, int,0644 );MODULE_PARM_DESC (ts_auto_disable,"Stream Auto Enable on FW (default: off)" );
@@ -65,7 +66,8 @@#endif #if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) -static void as102_stop_stream (struct as102_dev_t *dev) { +static void as102_stop_stream (struct as102_dev_t *dev) +{struct as102_bus_adapter_t *bus_adap;if (dev !=NULL )
@@ -80,16 +82,15 @@if (mutex_lock_interruptible (&dev->bus_adap.lock))return ; -if (as10x_cmd_stop_streaming (bus_adap) <0 ) { +if (as10x_cmd_stop_streaming (bus_adap) <0 )dprintk (debug,"as10x_cmd_stop_streaming failed\n" ); - }mutex_unlock (&dev->bus_adap.lock); } } -static int as102_start_stream (struct as102_dev_t *dev) { - +static int as102_start_stream (struct as102_dev_t *dev) +{struct as102_bus_adapter_t *bus_adap;int ret = -EFAULT ;
@@ -98,9 +99,8 @@else return ret; -if (bus_adap->ops->start_stream !=NULL ) { +if (bus_adap->ops->start_stream !=NULL ) ret = bus_adap->ops->start_stream (dev); - }if (ts_auto_disable) {if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -127,25 +127,25 @@return -EBUSY ; } -switch (onoff) { -case 0 : - ret =as10x_cmd_del_PID_filter (bus_adap, (uint16_t ) pid); -dprintk (debug,"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n" , - index, pid, ret); -break ; -case 1 : - { -struct as10x_ts_filter filter; +switch (onoff) { +case 0 : + ret =as10x_cmd_del_PID_filter (bus_adap, (uint16_t ) pid); +dprintk (debug,"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n" , + index, pid, ret); +break ; +case 1 : + { +struct as10x_ts_filter filter; - filter.type =TS_PID_TYPE_TS ; - filter.idx =0xFF ; - filter.pid = pid; + filter.type =TS_PID_TYPE_TS ; + filter.idx =0xFF ; + filter.pid = pid; - ret =as10x_cmd_add_PID_filter (bus_adap, &filter); -dprintk (debug,"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n" , - index, filter.idx, filter.pid, ret); -break ; - } + ret =as10x_cmd_add_PID_filter (bus_adap, &filter); +dprintk (debug,"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n" , + index, filter.idx, filter.pid, ret); +break ; + } }mutex_unlock (&dev->bus_adap.lock);
@@ -154,7 +154,8 @@return ret; } -static int as102_dvb_dmx_start_feed (struct dvb_demux_feed *dvbdmxfeed) { +static int as102_dvb_dmx_start_feed (struct dvb_demux_feed *dvbdmxfeed) +{int ret =0 ;struct dvb_demux *demux = dvbdmxfeed->demux;struct as102_dev_t *as102_dev = demux->priv;
@@ -169,16 +170,16 @@ dvbdmxfeed->index, dvbdmxfeed->pid, 1); } -if (as102_dev->streaming++ ==0 ) { +if (as102_dev->streaming++ ==0 ) ret =as102_start_stream (as102_dev); - }mutex_unlock (&as102_dev->sem);LEAVE ();return ret; } -static int as102_dvb_dmx_stop_feed (struct dvb_demux_feed *dvbdmxfeed) { +static int as102_dvb_dmx_stop_feed (struct dvb_demux_feed *dvbdmxfeed) +{struct dvb_demux *demux = dvbdmxfeed->demux;struct as102_dev_t *as102_dev = demux->priv;
@@ -187,9 +188,8 @@if (mutex_lock_interruptible (&as102_dev->sem))return -ERESTARTSYS ; -if (--as102_dev->streaming ==0 ) { +if (--as102_dev->streaming ==0 )as102_stop_stream (as102_dev); - }if (pid_filtering) { as10x_pid_filter(as102_dev,
@@ -202,7 +202,8 @@ }#endif -int as102_dvb_register (struct as102_dev_t *as102_dev) { +int as102_dvb_register (struct as102_dev_t *as102_dev) +{int ret =0 ;ENTER ();
@@ -223,7 +224,7 @@ );if (ret <0 ) {err ("%s: dvb_register_adapter() failed (errno = %d)" , - __FUNCTION__, ret); + __func__, ret); goto failed; }
@@ -240,23 +241,23 @@ as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx; as102_dev->dvb_dmxdev.capabilities =0 ; -if ((ret =dvb_dmx_init (&as102_dev->dvb_dmx)) <0 ) { -err ("%s: dvb_dmx_init() failed (errno = %d)" , - __FUNCTION__, ret); + ret =dvb_dmx_init (&as102_dev->dvb_dmx); +if (ret <0 ) { +err ("%s: dvb_dmx_init() failed (errno = %d)" , __func__, ret); goto failed; } ret =dvb_dmxdev_init (&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap);if (ret <0 ) { -err ("%s: dvb_dmxdev_init() failed (errno = %d)" , - __FUNCTION__, ret); +err ("%s: dvb_dmxdev_init() failed (errno = %d)" , __func__, + ret); goto failed; } ret =as102_dvb_register_fe (as102_dev, &as102_dev->dvb_fe);if (ret <0 ) {err ("%s: as102_dvb_register_frontend() failed (errno = %d)" , - __FUNCTION__, ret); + __func__, ret); goto failed; }#endif
@@ -283,7 +284,8 @@return ret; } -void as102_dvb_unregister (struct as102_dev_t *as102_dev) { +void as102_dvb_unregister (struct as102_dev_t *as102_dev) +{ENTER ();#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE )
@@ -300,7 +302,8 @@LEAVE (); } -static int __init as102_driver_init (void ) { +static int __init as102_driver_init (void ) +{int ret =0 ;ENTER ();
@@ -331,7 +334,8 @@* \brief as102 driver exit point. This function is called when device has * to be removed. */ -static void __exit as102_driver_exit(void) { +static void __exit as102_driver_exit(void) +{ENTER ();/* deregister this driver with the low level bus subsystem */ #if defined(CONFIG_AS102_USB )
PATCH RESEND 2/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318502 18000
# Node ID e2ba344c99936bddc46722f1f1efec5600c58659 # Parent a78bda1e1a0badc4a1296be958f1f8a49014ae18
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_drv.c
Priority: normal
drivers/staging/media/as102/as102_drv.c +50 -46
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -36,23 +37,23 @@#warning >>> DVB_CORE not defined !!! <<<#endif -int debug =0 ; +int debug;module_param_named (debug, debug, int,0644 );MODULE_PARM_DESC (debug,"Turn on/off debugging (default: off)" ); -int dual_tuner =0 ; +int dual_tuner;module_param_named (dual_tuner, dual_tuner, int,0644 ); -MODULE_PARM_DESC (dual_tuner,"Activate Dual-Tuner configuration (default: off)" ); +MODULE_PARM_DESC (dual_tuner,"Activate Dual-Tuner config (default: off)" );static int fw_upload =1 ;module_param_named (fw_upload, fw_upload, int,0644 );MODULE_PARM_DESC (fw_upload,"Turn on/off default FW upload (default: on)" ); -static int pid_filtering =0 ; +static int pid_filtering;module_param_named (pid_filtering, pid_filtering, int,0644 );MODULE_PARM_DESC (pid_filtering,"Activate HW PID filtering (default: off)" ); -static int ts_auto_disable =0 ; +static int ts_auto_disable;module_param_named (ts_auto_disable, ts_auto_disable, int,0644 );MODULE_PARM_DESC (ts_auto_disable,"Stream Auto Enable on FW (default: off)" );
@@ -65,7 +66,8 @@#endif #if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) -static void as102_stop_stream (struct as102_dev_t *dev) { +static void as102_stop_stream (struct as102_dev_t *dev) +{struct as102_bus_adapter_t *bus_adap;if (dev !=NULL )
@@ -80,16 +82,15 @@if (mutex_lock_interruptible (&dev->bus_adap.lock))return ; -if (as10x_cmd_stop_streaming (bus_adap) <0 ) { +if (as10x_cmd_stop_streaming (bus_adap) <0 )dprintk (debug,"as10x_cmd_stop_streaming failed\n" ); - }mutex_unlock (&dev->bus_adap.lock); } } -static int as102_start_stream (struct as102_dev_t *dev) { - +static int as102_start_stream (struct as102_dev_t *dev) +{struct as102_bus_adapter_t *bus_adap;int ret = -EFAULT ;
@@ -98,9 +99,8 @@else return ret; -if (bus_adap->ops->start_stream !=NULL ) { +if (bus_adap->ops->start_stream !=NULL ) ret = bus_adap->ops->start_stream (dev); - }if (ts_auto_disable) {if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -127,25 +127,25 @@return -EBUSY ; } -switch (onoff) { -case 0 : - ret =as10x_cmd_del_PID_filter (bus_adap, (uint16_t ) pid); -dprintk (debug,"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n" , - index, pid, ret); -break ; -case 1 : - { -struct as10x_ts_filter filter; +switch (onoff) { +case 0 : + ret =as10x_cmd_del_PID_filter (bus_adap, (uint16_t ) pid); +dprintk (debug,"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n" , + index, pid, ret); +break ; +case 1 : + { +struct as10x_ts_filter filter; - filter.type =TS_PID_TYPE_TS ; - filter.idx =0xFF ; - filter.pid = pid; + filter.type =TS_PID_TYPE_TS ; + filter.idx =0xFF ; + filter.pid = pid; - ret =as10x_cmd_add_PID_filter (bus_adap, &filter); -dprintk (debug,"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n" , - index, filter.idx, filter.pid, ret); -break ; - } + ret =as10x_cmd_add_PID_filter (bus_adap, &filter); +dprintk (debug,"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n" , + index, filter.idx, filter.pid, ret); +break ; + } }mutex_unlock (&dev->bus_adap.lock);
@@ -154,7 +154,8 @@return ret; } -static int as102_dvb_dmx_start_feed (struct dvb_demux_feed *dvbdmxfeed) { +static int as102_dvb_dmx_start_feed (struct dvb_demux_feed *dvbdmxfeed) +{int ret =0 ;struct dvb_demux *demux = dvbdmxfeed->demux;struct as102_dev_t *as102_dev = demux->priv;
@@ -169,16 +170,16 @@ dvbdmxfeed->index, dvbdmxfeed->pid, 1); } -if (as102_dev->streaming++ ==0 ) { +if (as102_dev->streaming++ ==0 ) ret =as102_start_stream (as102_dev); - }mutex_unlock (&as102_dev->sem);LEAVE ();return ret; } -static int as102_dvb_dmx_stop_feed (struct dvb_demux_feed *dvbdmxfeed) { +static int as102_dvb_dmx_stop_feed (struct dvb_demux_feed *dvbdmxfeed) +{struct dvb_demux *demux = dvbdmxfeed->demux;struct as102_dev_t *as102_dev = demux->priv;
@@ -187,9 +188,8 @@if (mutex_lock_interruptible (&as102_dev->sem))return -ERESTARTSYS ; -if (--as102_dev->streaming ==0 ) { +if (--as102_dev->streaming ==0 )as102_stop_stream (as102_dev); - }if (pid_filtering) { as10x_pid_filter(as102_dev,
@@ -202,7 +202,8 @@ }#endif -int as102_dvb_register (struct as102_dev_t *as102_dev) { +int as102_dvb_register (struct as102_dev_t *as102_dev) +{int ret =0 ;ENTER ();
@@ -223,7 +224,7 @@ );if (ret <0 ) {err ("%s: dvb_register_adapter() failed (errno = %d)" , - __FUNCTION__, ret); + __func__, ret); goto failed; }
@@ -240,23 +241,23 @@ as102_dev->dvb_dmxdev.demux = &as102_dev->dvb_dmx.dmx; as102_dev->dvb_dmxdev.capabilities =0 ; -if ((ret =dvb_dmx_init (&as102_dev->dvb_dmx)) <0 ) { -err ("%s: dvb_dmx_init() failed (errno = %d)" , - __FUNCTION__, ret); + ret =dvb_dmx_init (&as102_dev->dvb_dmx); +if (ret <0 ) { +err ("%s: dvb_dmx_init() failed (errno = %d)" , __func__, ret); goto failed; } ret =dvb_dmxdev_init (&as102_dev->dvb_dmxdev, &as102_dev->dvb_adap);if (ret <0 ) { -err ("%s: dvb_dmxdev_init() failed (errno = %d)" , - __FUNCTION__, ret); +err ("%s: dvb_dmxdev_init() failed (errno = %d)" , __func__, + ret); goto failed; } ret =as102_dvb_register_fe (as102_dev, &as102_dev->dvb_fe);if (ret <0 ) {err ("%s: as102_dvb_register_frontend() failed (errno = %d)" , - __FUNCTION__, ret); + __func__, ret); goto failed; }#endif
@@ -283,7 +284,8 @@return ret; } -void as102_dvb_unregister (struct as102_dev_t *as102_dev) { +void as102_dvb_unregister (struct as102_dev_t *as102_dev) +{ENTER ();#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE )
@@ -300,7 +302,8 @@LEAVE (); } -static int __init as102_driver_init (void ) { +static int __init as102_driver_init (void ) +{int ret =0 ;ENTER ();
@@ -331,7 +334,8 @@* \brief as102 driver exit point. This function is called when device has * to be removed. */ -static void __exit as102_driver_exit(void) { +static void __exit as102_driver_exit(void) +{ENTER ();/* deregister this driver with the low level bus subsystem */ #if defined(CONFIG_AS102_USB )
PATCH 3/14 staging/media/as102: checkpatch fixes
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318626 18000
# Node ID b91e96a07bee27c1d421b4c3702e33ee8075de83 # Parent e2ba344c99936bddc46722f1f1efec5600c58659
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_fw.c.
Priority: normal
drivers/staging/media/as102/as102_fw.c +58 -43
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -31,15 +32,16 @@char as102_dt_fw1[] ="as102_data1_dt.hex" ;char as102_dt_fw2[] ="as102_data2_dt.hex" ; -static unsigned char atohx (unsigned char *dst,char *src) { +static unsigned char atohx (unsigned char *dst,char *src) +{unsigned char value =0 ;char msb =tolower (*src) -'0' ; -char lsb =tolower (*(src +1 )) -'0' ; +char lsb =tolower (*(src +1 )) -'0' ; -if (msb >9 ) +if (msb >9 ) msb -=7 ; -if (lsb >9 ) +if (lsb >9 ) lsb -=7 ; *dst = value = ((msb &0xF ) <<4 ) | (lsb &0xF );
@@ -62,43 +64,42 @@ }/* locate end of line */ -for (src=fw_data; *src !='\n' ; src +=2 ) { +for (src = fw_data; *src !='\n' ; src +=2 ) {atohx (&dst, src);/* parse line to split addr / data */ switch (count) { -case 0 : - *dataLength = dst; -break ; -case 1 : - addr[2 ] = dst; -break ; -case 2 : - addr[3 ] = dst; -break ; -case 3 : -/* check if data is an address */ -if (dst ==0x04 ) - *addr_has_changed =1 ; -else - *addr_has_changed =0 ; -break ; -case 4 : -case 5 : -if (*addr_has_changed) { - addr[(count -4 )] = dst; - }else { - data[(count -4 )] = dst; - } -break ; -default : +case 0 : + *dataLength = dst; +break ; +case 1 : + addr[2 ] = dst; +break ; +case 2 : + addr[3 ] = dst; +break ; +case 3 : +/* check if data is an address */ +if (dst ==0x04 ) + *addr_has_changed =1 ; +else + *addr_has_changed =0 ; +break ; +case 4 : +case 5 : +if (*addr_has_changed) + addr[(count -4 )] = dst; +else data[(count -4 )] = dst; -break ; +break ; +default : + data[(count -4 )] = dst; +break ; } count++; }/* return read value + ':' + '\n' */ -return ((count *2 ) +2 ); +return (count *2 ) +2 ; } static int as102_firmware_upload(struct as102_bus_adapter_t *bus_adap,
@@ -122,17 +123,20 @@ &data_len, &addr_has_changed); -if (read_bytes <=0 ) { +if (read_bytes <=0 ) goto error; - }/* detect the end of file */ -if ((total_read_bytes += read_bytes) == firmware->size) { + total_read_bytes += read_bytes; +if (total_read_bytes == firmware->size) { fw_pkt.u.request[0 ] =0x00 ; fw_pkt.u.request[1 ] =0x03 ;/* send EOF command */ -if ((errno = bus_adap->ops->upload_fw_pkt (bus_adap,(uint8_t *) &fw_pkt,2 ,0 )) <0 ) + errno = bus_adap->ops->upload_fw_pkt (bus_adap, + (uint8_t *) + &fw_pkt,2 ,0 ); +if (errno <0 ) goto error; }else {if (!addr_has_changed) {
@@ -144,7 +148,12 @@ data_len +=sizeof (fw_pkt.raw.address);/* send cmd to device */ -if ((errno = bus_adap->ops->upload_fw_pkt (bus_adap, (uint8_t *) &fw_pkt, data_len,0 )) <0 ) + errno = bus_adap->ops->upload_fw_pkt (bus_adap, + (uint8_t *) + &fw_pkt, + data_len, +0 ); +if (errno <0 ) goto error; } }
@@ -154,7 +163,8 @@return (errno ==0 ) ? total_read_bytes : errno; } -int as102_fw_upload (struct as102_bus_adapter_t *bus_adap) { +int as102_fw_upload (struct as102_bus_adapter_t *bus_adap) +{int errno = -EFAULT ;const struct firmware *firmware;unsigned char *cmd_buf =NULL ;
@@ -179,20 +189,23 @@#if defined(CONFIG_FW_LOADER ) || defined(CONFIG_FW_LOADER_MODULE )/* allocate buffer to store firmware upload command and data */ -if ((cmd_buf =kzalloc (MAX_FW_PKT_SIZE ,GFP_KERNEL )) ==NULL ) { + cmd_buf =kzalloc (MAX_FW_PKT_SIZE ,GFP_KERNEL ); +if (cmd_buf ==NULL ) { errno = -ENOMEM ; goto error; }/* request kernel to locate firmware file: part1 */ -if ((errno =request_firmware (&firmware, fw1, &dev->dev)) <0 ) { + errno =request_firmware (&firmware, fw1, &dev->dev); +if (errno <0 ) {printk (KERN_ERR "%s: unable to locate firmware file: %s\n" ,DRIVER_NAME , fw1); goto error; }/* initiate firmware upload */ -if ((errno =as102_firmware_upload (bus_adap, cmd_buf, firmware)) <0 ) { + errno =as102_firmware_upload (bus_adap, cmd_buf, firmware); +if (errno <0 ) {printk (KERN_ERR "%s: error during firmware upload part1\n" ,DRIVER_NAME ); goto error;
@@ -206,14 +219,16 @@mdelay (100 );/* request kernel to locate firmware file: part2 */ -if ((errno =request_firmware (&firmware, fw2, &dev->dev)) <0 ) { + errno =request_firmware (&firmware, fw2, &dev->dev); +if (errno <0 ) {printk (KERN_ERR "%s: unable to locate firmware file: %s\n" ,DRIVER_NAME , fw2); goto error; }/* initiate firmware upload */ -if ((errno =as102_firmware_upload (bus_adap, cmd_buf, firmware)) <0 ) { + errno =as102_firmware_upload (bus_adap, cmd_buf, firmware); +if (errno <0 ) {printk (KERN_ERR "%s: error during firmware upload part2\n" ,DRIVER_NAME ); goto error;
PATCH RESEND 3/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318626 18000
# Node ID b91e96a07bee27c1d421b4c3702e33ee8075de83 # Parent e2ba344c99936bddc46722f1f1efec5600c58659
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_fw.c.
Priority: normal
drivers/staging/media/as102/as102_fw.c +58 -43
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -31,15 +32,16 @@char as102_dt_fw1[] ="as102_data1_dt.hex" ;char as102_dt_fw2[] ="as102_data2_dt.hex" ; -static unsigned char atohx (unsigned char *dst,char *src) { +static unsigned char atohx (unsigned char *dst,char *src) +{unsigned char value =0 ;char msb =tolower (*src) -'0' ; -char lsb =tolower (*(src +1 )) -'0' ; +char lsb =tolower (*(src +1 )) -'0' ; -if (msb >9 ) +if (msb >9 ) msb -=7 ; -if (lsb >9 ) +if (lsb >9 ) lsb -=7 ; *dst = value = ((msb &0xF ) <<4 ) | (lsb &0xF );
@@ -62,43 +64,42 @@ }/* locate end of line */ -for (src=fw_data; *src !='\n' ; src +=2 ) { +for (src = fw_data; *src !='\n' ; src +=2 ) {atohx (&dst, src);/* parse line to split addr / data */ switch (count) { -case 0 : - *dataLength = dst; -break ; -case 1 : - addr[2 ] = dst; -break ; -case 2 : - addr[3 ] = dst; -break ; -case 3 : -/* check if data is an address */ -if (dst ==0x04 ) - *addr_has_changed =1 ; -else - *addr_has_changed =0 ; -break ; -case 4 : -case 5 : -if (*addr_has_changed) { - addr[(count -4 )] = dst; - }else { - data[(count -4 )] = dst; - } -break ; -default : +case 0 : + *dataLength = dst; +break ; +case 1 : + addr[2 ] = dst; +break ; +case 2 : + addr[3 ] = dst; +break ; +case 3 : +/* check if data is an address */ +if (dst ==0x04 ) + *addr_has_changed =1 ; +else + *addr_has_changed =0 ; +break ; +case 4 : +case 5 : +if (*addr_has_changed) + addr[(count -4 )] = dst; +else data[(count -4 )] = dst; -break ; +break ; +default : + data[(count -4 )] = dst; +break ; } count++; }/* return read value + ':' + '\n' */ -return ((count *2 ) +2 ); +return (count *2 ) +2 ; } static int as102_firmware_upload(struct as102_bus_adapter_t *bus_adap,
@@ -122,17 +123,20 @@ &data_len, &addr_has_changed); -if (read_bytes <=0 ) { +if (read_bytes <=0 ) goto error; - }/* detect the end of file */ -if ((total_read_bytes += read_bytes) == firmware->size) { + total_read_bytes += read_bytes; +if (total_read_bytes == firmware->size) { fw_pkt.u.request[0 ] =0x00 ; fw_pkt.u.request[1 ] =0x03 ;/* send EOF command */ -if ((errno = bus_adap->ops->upload_fw_pkt (bus_adap,(uint8_t *) &fw_pkt,2 ,0 )) <0 ) + errno = bus_adap->ops->upload_fw_pkt (bus_adap, + (uint8_t *) + &fw_pkt,2 ,0 ); +if (errno <0 ) goto error; }else {if (!addr_has_changed) {
@@ -144,7 +148,12 @@ data_len +=sizeof (fw_pkt.raw.address);/* send cmd to device */ -if ((errno = bus_adap->ops->upload_fw_pkt (bus_adap, (uint8_t *) &fw_pkt, data_len,0 )) <0 ) + errno = bus_adap->ops->upload_fw_pkt (bus_adap, + (uint8_t *) + &fw_pkt, + data_len, +0 ); +if (errno <0 ) goto error; } }
@@ -154,7 +163,8 @@return (errno ==0 ) ? total_read_bytes : errno; } -int as102_fw_upload (struct as102_bus_adapter_t *bus_adap) { +int as102_fw_upload (struct as102_bus_adapter_t *bus_adap) +{int errno = -EFAULT ;const struct firmware *firmware;unsigned char *cmd_buf =NULL ;
@@ -179,20 +189,23 @@#if defined(CONFIG_FW_LOADER ) || defined(CONFIG_FW_LOADER_MODULE )/* allocate buffer to store firmware upload command and data */ -if ((cmd_buf =kzalloc (MAX_FW_PKT_SIZE ,GFP_KERNEL )) ==NULL ) { + cmd_buf =kzalloc (MAX_FW_PKT_SIZE ,GFP_KERNEL ); +if (cmd_buf ==NULL ) { errno = -ENOMEM ; goto error; }/* request kernel to locate firmware file: part1 */ -if ((errno =request_firmware (&firmware, fw1, &dev->dev)) <0 ) { + errno =request_firmware (&firmware, fw1, &dev->dev); +if (errno <0 ) {printk (KERN_ERR "%s: unable to locate firmware file: %s\n" ,DRIVER_NAME , fw1); goto error; }/* initiate firmware upload */ -if ((errno =as102_firmware_upload (bus_adap, cmd_buf, firmware)) <0 ) { + errno =as102_firmware_upload (bus_adap, cmd_buf, firmware); +if (errno <0 ) {printk (KERN_ERR "%s: error during firmware upload part1\n" ,DRIVER_NAME ); goto error;
@@ -206,14 +219,16 @@mdelay (100 );/* request kernel to locate firmware file: part2 */ -if ((errno =request_firmware (&firmware, fw2, &dev->dev)) <0 ) { + errno =request_firmware (&firmware, fw2, &dev->dev); +if (errno <0 ) {printk (KERN_ERR "%s: unable to locate firmware file: %s\n" ,DRIVER_NAME , fw2); goto error; }/* initiate firmware upload */ -if ((errno =as102_firmware_upload (bus_adap, cmd_buf, firmware)) <0 ) { + errno =as102_firmware_upload (bus_adap, cmd_buf, firmware); +if (errno <0 ) {printk (KERN_ERR "%s: error during firmware upload part2\n" ,DRIVER_NAME ); goto error;
PATCH 4/14 staging/media/as102: checkpatch fixes
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f # Parent b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as10x_cmd.c.
Priority: normal
drivers/staging/media/as102/as10x_cmd.c +254 -251
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,8 @@#include <linux/kernel.h> #include "as102_drv.h" #elif defined(WIN32 ) -#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)/* win32 ddk implementation */ +#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) +/* win32 ddk implementation */ #include "wdm.h" #include "Device.h" #include "endian_mgmt.h" /* FIXME */
@@ -51,43 +53,42 @@*/ int as10x_cmd_turn_on (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.turn_on.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.turn_on.req)); -/* fill command */ - pcmd->body.turn_on.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNON ); +/* fill command */ + pcmd->body.turn_on.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNON ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( - phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.turn_on.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.turn_on.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.turn_on.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.turn_on.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNON_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNON_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -98,42 +99,41 @@*/ int as10x_cmd_turn_off (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.turn_off.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.turn_off.req)); -/* fill command */ - pcmd->body.turn_off.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNOFF ); +/* fill command */ + pcmd->body.turn_off.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNOFF ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd ( phandle, (uint8_t *) pcmd,sizeof (pcmd->body.turn_off.req) +HEADER_SIZE , - (uint8_t *) prsp, + (uint8_t *) prsp,sizeof (prsp->body.turn_off.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNOFF_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNOFF_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -145,50 +145,54 @@*/ int as10x_cmd_set_tune (as10x_handle_t *phandle,struct as10x_tune_args *ptune) { -int error; -struct as10x_cmd_t *preq, *prsp; +int error; +struct as10x_cmd_t *preq, *prsp; -ENTER (); +ENTER (); - preq = phandle->cmd; - prsp = phandle->rsp; + preq = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (preq,(++phandle->cmd_xid),sizeof (preq->body.set_tune.req)); +/* prepare command */ +as10x_cmd_build (preq, (++phandle->cmd_xid), +sizeof (preq->body.set_tune.req)); -/* fill command */ - preq->body.set_tune.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETTUNE ); - preq->body.set_tune.req.args.freq =cpu_to_le32 (ptune->freq); - preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; - preq->body.set_tune.req.args.hier_select = ptune->hier_select; - preq->body.set_tune.req.args.constellation = ptune->constellation; - preq->body.set_tune.req.args.hierarchy = ptune->hierarchy; - preq->body.set_tune.req.args.interleaving_mode = ptune->interleaving_mode; - preq->body.set_tune.req.args.code_rate = ptune->code_rate; - preq->body.set_tune.req.args.guard_interval = ptune->guard_interval; - preq->body.set_tune.req.args.transmission_mode = ptune->transmission_mode; +/* fill command */ + preq->body.set_tune.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETTUNE ); + preq->body.set_tune.req.args.freq =cpu_to_le32 (ptune->freq); + preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; + preq->body.set_tune.req.args.hier_select = ptune->hier_select; + preq->body.set_tune.req.args.constellation = ptune->constellation; + preq->body.set_tune.req.args.hierarchy = ptune->hierarchy; + preq->body.set_tune.req.args.interleaving_mode = + ptune->interleaving_mode; + preq->body.set_tune.req.args.code_rate = ptune->code_rate; + preq->body.set_tune.req.args.guard_interval = ptune->guard_interval; + preq->body.set_tune.req.args.transmission_mode = + ptune->transmission_mode; -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) preq, -sizeof (preq->body.set_tune.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.set_tune.rsp) +HEADER_SIZE ); - }else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) preq, +sizeof (preq->body.set_tune.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.set_tune.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_SETTUNE_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_SETTUNE_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -198,57 +202,55 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_get_tune_status (as10x_handle_t *phandle,struct as10x_tune_status *pstatus) +int as10x_cmd_get_tune_status (as10x_handle_t *phandle, +struct as10x_tune_status *pstatus) { -int error; -struct as10x_cmd_t *preq, *prsp; +int error; +struct as10x_cmd_t *preq, *prsp; -ENTER (); +ENTER (); - preq = phandle->cmd; - prsp = phandle->rsp; + preq = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (preq,(++phandle->cmd_xid), -sizeof (preq->body.get_tune_status.req)); +/* prepare command */ +as10x_cmd_build (preq, (++phandle->cmd_xid), +sizeof (preq->body.get_tune_status.req)); -/* fill command */ - preq->body.get_tune_status.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GETTUNESTAT ); +/* fill command */ + preq->body.get_tune_status.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GETTUNESTAT ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd ( phandle, (uint8_t *) preq,sizeof (preq->body.get_tune_status.req) +HEADER_SIZE , (uint8_t *) prsp,sizeof (prsp->body.get_tune_status.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTUNESTAT_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTUNESTAT_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; - pstatus->signal_strength = -le16_to_cpu (prsp->body.get_tune_status.rsp.sts.signal_strength); - pstatus->PER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.PER); - pstatus->BER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.BER); +/* Response OK -> get response data */ + pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; + pstatus->signal_strength = +le16_to_cpu (prsp->body.get_tune_status.rsp.sts.signal_strength); + pstatus->PER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.PER); + pstatus->BER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.BER); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -260,56 +262,58 @@*/ int as10x_cmd_get_tps (as10x_handle_t *phandle,struct as10x_tps *ptps) { +int error; +struct as10x_cmd_t *pcmd, *prsp; -int error; -struct as10x_cmd_t *pcmd, *prsp; +ENTER (); -ENTER (); + pcmd = phandle->cmd; + prsp = phandle->rsp; - pcmd = phandle->cmd; - prsp = phandle->rsp; +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_tps.req)); -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid),sizeof (pcmd->body.get_tps.req)); +/* fill command */ + pcmd->body.get_tune_status.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GETTPS ); -/* fill command */ - pcmd->body.get_tune_status.req.proc_id =cpu_to_le16 (CONTROL_PROC_GETTPS ); +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_tps.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_tps.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd,sizeof (pcmd->body.get_tps.req) +HEADER_SIZE , - (uint8_t *) prsp,sizeof (prsp->body.get_tps.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +if (error <0 ) + goto out; -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTPS_RSP ); +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTPS_RSP ); -if (error <0 ) { - goto out; - } - -/* Response OK -> get response data */ - ptps->constellation = prsp->body.get_tps.rsp.tps.constellation; - ptps->hierarchy = prsp->body.get_tps.rsp.tps.hierarchy; - ptps->interleaving_mode = prsp->body.get_tps.rsp.tps.interleaving_mode; - ptps->code_rate_HP = prsp->body.get_tps.rsp.tps.code_rate_HP; - ptps->code_rate_LP = prsp->body.get_tps.rsp.tps.code_rate_LP; - ptps->guard_interval = prsp->body.get_tps.rsp.tps.guard_interval; - ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; - ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; - ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; - ptps->cell_ID =le16_to_cpu (prsp->body.get_tps.rsp.tps.cell_ID); +/* Response OK -> get response data */ + ptps->constellation = prsp->body.get_tps.rsp.tps.constellation; + ptps->hierarchy = prsp->body.get_tps.rsp.tps.hierarchy; + ptps->interleaving_mode = prsp->body.get_tps.rsp.tps.interleaving_mode; + ptps->code_rate_HP = prsp->body.get_tps.rsp.tps.code_rate_HP; + ptps->code_rate_LP = prsp->body.get_tps.rsp.tps.code_rate_LP; + ptps->guard_interval = prsp->body.get_tps.rsp.tps.guard_interval; + ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; + ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; + ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; + ptps->cell_ID =le16_to_cpu (prsp->body.get_tps.rsp.tps.cell_ID); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -322,59 +326,58 @@int as10x_cmd_get_demod_stats (as10x_handle_t *phandle,struct as10x_demod_stats *pdemod_stats) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.get_demod_stats.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_demod_stats.req)); -/* fill command */ - pcmd->body.get_demod_stats.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GET_DEMOD_STATS ); +/* fill command */ + pcmd->body.get_demod_stats.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GET_DEMOD_STATS ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.get_demod_stats.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.get_demod_stats.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_demod_stats.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_demod_stats.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_DEMOD_STATS_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_DEMOD_STATS_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - pdemod_stats->frame_count = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.frame_count); - pdemod_stats->bad_frame_count = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bad_frame_count); - pdemod_stats->bytes_fixed_by_rs = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); - pdemod_stats->mer = -le16_to_cpu (prsp->body.get_demod_stats.rsp.stats.mer); - pdemod_stats->has_started = - prsp->body.get_demod_stats.rsp.stats.has_started; +/* Response OK -> get response data */ + pdemod_stats->frame_count = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.frame_count); + pdemod_stats->bad_frame_count = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bad_frame_count); + pdemod_stats->bytes_fixed_by_rs = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); + pdemod_stats->mer = +le16_to_cpu (prsp->body.get_demod_stats.rsp.stats.mer); + pdemod_stats->has_started = + prsp->body.get_demod_stats.rsp.stats.has_started; out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -388,50 +391,49 @@int as10x_cmd_get_impulse_resp (as10x_handle_t *phandle,uint8_t *is_ready) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.get_impulse_rsp.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_impulse_rsp.req)); -/* fill command */ - pcmd->body.get_impulse_rsp.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GET_IMPULSE_RESP ); +/* fill command */ + pcmd->body.get_impulse_rsp.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GET_IMPULSE_RESP ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.get_impulse_rsp.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.get_impulse_rsp.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_impulse_rsp.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_impulse_rsp.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_IMPULSE_RESP_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_IMPULSE_RESP_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - *is_ready = prsp->body.get_impulse_rsp.rsp.is_ready; +/* Response OK -> get response data */ + *is_ready = prsp->body.get_impulse_rsp.rsp.is_ready; out: -LEAVE (); -return (error); +LEAVE (); +return error; }
@@ -447,10 +449,10 @@void as10x_cmd_build (struct as10x_cmd_t *pcmd,uint16_t xid,uint16_t cmd_len) { - pcmd->header.req_id =cpu_to_le16 (xid); - pcmd->header.prog =cpu_to_le16 (SERVICE_PROG_ID ); - pcmd->header.version =cpu_to_le16 (SERVICE_PROG_VERSION ); - pcmd->header.data_len =cpu_to_le16 (cmd_len); + pcmd->header.req_id =cpu_to_le16 (xid); + pcmd->header.prog =cpu_to_le16 (SERVICE_PROG_ID ); + pcmd->header.version =cpu_to_le16 (SERVICE_PROG_VERSION ); + pcmd->header.data_len =cpu_to_le16 (cmd_len); }/**
@@ -463,16 +465,17 @@*/ int as10x_rsp_parse (struct as10x_cmd_t *prsp,uint16_t proc_id) { -int error; +int error; -/* extract command error code */ - error = prsp->body.common.rsp.error; +/* extract command error code */ + error = prsp->body.common.rsp.error; -if ((error ==0 ) && (le16_to_cpu (prsp->body.common.rsp.proc_id) == proc_id)) { -return 0 ; - } +if ((error ==0 ) && + (le16_to_cpu (prsp->body.common.rsp.proc_id) == proc_id)) { +return 0 ; + } -return AS10X_CMD_ERROR ; +return AS10X_CMD_ERROR ; }
PATCH RESEND 4/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f # Parent b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as10x_cmd.c.
Priority: normal
drivers/staging/media/as102/as10x_cmd.c +254 -251
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,8 @@#include <linux/kernel.h> #include "as102_drv.h" #elif defined(WIN32 ) -#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)/* win32 ddk implementation */ +#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) +/* win32 ddk implementation */ #include "wdm.h" #include "Device.h" #include "endian_mgmt.h" /* FIXME */
@@ -51,43 +53,42 @@*/ int as10x_cmd_turn_on (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.turn_on.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.turn_on.req)); -/* fill command */ - pcmd->body.turn_on.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNON ); +/* fill command */ + pcmd->body.turn_on.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNON ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( - phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.turn_on.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.turn_on.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.turn_on.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.turn_on.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNON_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNON_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -98,42 +99,41 @@*/ int as10x_cmd_turn_off (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.turn_off.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.turn_off.req)); -/* fill command */ - pcmd->body.turn_off.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNOFF ); +/* fill command */ + pcmd->body.turn_off.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNOFF ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd ( phandle, (uint8_t *) pcmd,sizeof (pcmd->body.turn_off.req) +HEADER_SIZE , - (uint8_t *) prsp, + (uint8_t *) prsp,sizeof (prsp->body.turn_off.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNOFF_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNOFF_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -145,50 +145,54 @@*/ int as10x_cmd_set_tune (as10x_handle_t *phandle,struct as10x_tune_args *ptune) { -int error; -struct as10x_cmd_t *preq, *prsp; +int error; +struct as10x_cmd_t *preq, *prsp; -ENTER (); +ENTER (); - preq = phandle->cmd; - prsp = phandle->rsp; + preq = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (preq,(++phandle->cmd_xid),sizeof (preq->body.set_tune.req)); +/* prepare command */ +as10x_cmd_build (preq, (++phandle->cmd_xid), +sizeof (preq->body.set_tune.req)); -/* fill command */ - preq->body.set_tune.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETTUNE ); - preq->body.set_tune.req.args.freq =cpu_to_le32 (ptune->freq); - preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; - preq->body.set_tune.req.args.hier_select = ptune->hier_select; - preq->body.set_tune.req.args.constellation = ptune->constellation; - preq->body.set_tune.req.args.hierarchy = ptune->hierarchy; - preq->body.set_tune.req.args.interleaving_mode = ptune->interleaving_mode; - preq->body.set_tune.req.args.code_rate = ptune->code_rate; - preq->body.set_tune.req.args.guard_interval = ptune->guard_interval; - preq->body.set_tune.req.args.transmission_mode = ptune->transmission_mode; +/* fill command */ + preq->body.set_tune.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETTUNE ); + preq->body.set_tune.req.args.freq =cpu_to_le32 (ptune->freq); + preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; + preq->body.set_tune.req.args.hier_select = ptune->hier_select; + preq->body.set_tune.req.args.constellation = ptune->constellation; + preq->body.set_tune.req.args.hierarchy = ptune->hierarchy; + preq->body.set_tune.req.args.interleaving_mode = + ptune->interleaving_mode; + preq->body.set_tune.req.args.code_rate = ptune->code_rate; + preq->body.set_tune.req.args.guard_interval = ptune->guard_interval; + preq->body.set_tune.req.args.transmission_mode = + ptune->transmission_mode; -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) preq, -sizeof (preq->body.set_tune.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.set_tune.rsp) +HEADER_SIZE ); - }else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) preq, +sizeof (preq->body.set_tune.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.set_tune.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_SETTUNE_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_SETTUNE_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -198,57 +202,55 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_get_tune_status (as10x_handle_t *phandle,struct as10x_tune_status *pstatus) +int as10x_cmd_get_tune_status (as10x_handle_t *phandle, +struct as10x_tune_status *pstatus) { -int error; -struct as10x_cmd_t *preq, *prsp; +int error; +struct as10x_cmd_t *preq, *prsp; -ENTER (); +ENTER (); - preq = phandle->cmd; - prsp = phandle->rsp; + preq = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (preq,(++phandle->cmd_xid), -sizeof (preq->body.get_tune_status.req)); +/* prepare command */ +as10x_cmd_build (preq, (++phandle->cmd_xid), +sizeof (preq->body.get_tune_status.req)); -/* fill command */ - preq->body.get_tune_status.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GETTUNESTAT ); +/* fill command */ + preq->body.get_tune_status.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GETTUNESTAT ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd ( phandle, (uint8_t *) preq,sizeof (preq->body.get_tune_status.req) +HEADER_SIZE , (uint8_t *) prsp,sizeof (prsp->body.get_tune_status.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTUNESTAT_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTUNESTAT_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; - pstatus->signal_strength = -le16_to_cpu (prsp->body.get_tune_status.rsp.sts.signal_strength); - pstatus->PER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.PER); - pstatus->BER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.BER); +/* Response OK -> get response data */ + pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; + pstatus->signal_strength = +le16_to_cpu (prsp->body.get_tune_status.rsp.sts.signal_strength); + pstatus->PER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.PER); + pstatus->BER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.BER); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -260,56 +262,58 @@*/ int as10x_cmd_get_tps (as10x_handle_t *phandle,struct as10x_tps *ptps) { +int error; +struct as10x_cmd_t *pcmd, *prsp; -int error; -struct as10x_cmd_t *pcmd, *prsp; +ENTER (); -ENTER (); + pcmd = phandle->cmd; + prsp = phandle->rsp; - pcmd = phandle->cmd; - prsp = phandle->rsp; +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_tps.req)); -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid),sizeof (pcmd->body.get_tps.req)); +/* fill command */ + pcmd->body.get_tune_status.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GETTPS ); -/* fill command */ - pcmd->body.get_tune_status.req.proc_id =cpu_to_le16 (CONTROL_PROC_GETTPS ); +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_tps.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_tps.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd,sizeof (pcmd->body.get_tps.req) +HEADER_SIZE , - (uint8_t *) prsp,sizeof (prsp->body.get_tps.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +if (error <0 ) + goto out; -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTPS_RSP ); +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTPS_RSP ); -if (error <0 ) { - goto out; - } - -/* Response OK -> get response data */ - ptps->constellation = prsp->body.get_tps.rsp.tps.constellation; - ptps->hierarchy = prsp->body.get_tps.rsp.tps.hierarchy; - ptps->interleaving_mode = prsp->body.get_tps.rsp.tps.interleaving_mode; - ptps->code_rate_HP = prsp->body.get_tps.rsp.tps.code_rate_HP; - ptps->code_rate_LP = prsp->body.get_tps.rsp.tps.code_rate_LP; - ptps->guard_interval = prsp->body.get_tps.rsp.tps.guard_interval; - ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; - ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; - ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; - ptps->cell_ID =le16_to_cpu (prsp->body.get_tps.rsp.tps.cell_ID); +/* Response OK -> get response data */ + ptps->constellation = prsp->body.get_tps.rsp.tps.constellation; + ptps->hierarchy = prsp->body.get_tps.rsp.tps.hierarchy; + ptps->interleaving_mode = prsp->body.get_tps.rsp.tps.interleaving_mode; + ptps->code_rate_HP = prsp->body.get_tps.rsp.tps.code_rate_HP; + ptps->code_rate_LP = prsp->body.get_tps.rsp.tps.code_rate_LP; + ptps->guard_interval = prsp->body.get_tps.rsp.tps.guard_interval; + ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; + ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; + ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; + ptps->cell_ID =le16_to_cpu (prsp->body.get_tps.rsp.tps.cell_ID); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -322,59 +326,58 @@int as10x_cmd_get_demod_stats (as10x_handle_t *phandle,struct as10x_demod_stats *pdemod_stats) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.get_demod_stats.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_demod_stats.req)); -/* fill command */ - pcmd->body.get_demod_stats.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GET_DEMOD_STATS ); +/* fill command */ + pcmd->body.get_demod_stats.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GET_DEMOD_STATS ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.get_demod_stats.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.get_demod_stats.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_demod_stats.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_demod_stats.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_DEMOD_STATS_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_DEMOD_STATS_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - pdemod_stats->frame_count = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.frame_count); - pdemod_stats->bad_frame_count = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bad_frame_count); - pdemod_stats->bytes_fixed_by_rs = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); - pdemod_stats->mer = -le16_to_cpu (prsp->body.get_demod_stats.rsp.stats.mer); - pdemod_stats->has_started = - prsp->body.get_demod_stats.rsp.stats.has_started; +/* Response OK -> get response data */ + pdemod_stats->frame_count = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.frame_count); + pdemod_stats->bad_frame_count = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bad_frame_count); + pdemod_stats->bytes_fixed_by_rs = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); + pdemod_stats->mer = +le16_to_cpu (prsp->body.get_demod_stats.rsp.stats.mer); + pdemod_stats->has_started = + prsp->body.get_demod_stats.rsp.stats.has_started; out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -388,50 +391,49 @@int as10x_cmd_get_impulse_resp (as10x_handle_t *phandle,uint8_t *is_ready) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.get_impulse_rsp.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_impulse_rsp.req)); -/* fill command */ - pcmd->body.get_impulse_rsp.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GET_IMPULSE_RESP ); +/* fill command */ + pcmd->body.get_impulse_rsp.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GET_IMPULSE_RESP ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.get_impulse_rsp.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.get_impulse_rsp.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_impulse_rsp.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_impulse_rsp.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_IMPULSE_RESP_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_IMPULSE_RESP_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - *is_ready = prsp->body.get_impulse_rsp.rsp.is_ready; +/* Response OK -> get response data */ + *is_ready = prsp->body.get_impulse_rsp.rsp.is_ready; out: -LEAVE (); -return (error); +LEAVE (); +return error; }
@@ -447,10 +449,10 @@void as10x_cmd_build (struct as10x_cmd_t *pcmd,uint16_t xid,uint16_t cmd_len) { - pcmd->header.req_id =cpu_to_le16 (xid); - pcmd->header.prog =cpu_to_le16 (SERVICE_PROG_ID ); - pcmd->header.version =cpu_to_le16 (SERVICE_PROG_VERSION ); - pcmd->header.data_len =cpu_to_le16 (cmd_len); + pcmd->header.req_id =cpu_to_le16 (xid); + pcmd->header.prog =cpu_to_le16 (SERVICE_PROG_ID ); + pcmd->header.version =cpu_to_le16 (SERVICE_PROG_VERSION ); + pcmd->header.data_len =cpu_to_le16 (cmd_len); }/**
@@ -463,16 +465,17 @@*/ int as10x_rsp_parse (struct as10x_cmd_t *prsp,uint16_t proc_id) { -int error; +int error; -/* extract command error code */ - error = prsp->body.common.rsp.error; +/* extract command error code */ + error = prsp->body.common.rsp.error; -if ((error ==0 ) && (le16_to_cpu (prsp->body.common.rsp.proc_id) == proc_id)) { -return 0 ; - } +if ((error ==0 ) && + (le16_to_cpu (prsp->body.common.rsp.proc_id) == proc_id)) { +return 0 ; + } -return AS10X_CMD_ERROR ; +return AS10X_CMD_ERROR ; }
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
Quoted 10 lines · Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes
Quoted 8 lines
From: Devin Heitmueller<[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>
Hi Piotr,
starting from this patch the series doesn't apply cleanly to staging/for_v3.2 tree. Which branch is it based on ?
---
Thanks,
Sylwester
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:
Quoted 19 lines · Piotr Chmura
Quoted 10 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixesQuoted 8 lines
From: Devin Heitmueller<[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>
Quoted 8 lines
Hi Piotr,
starting from this patch the series doesn't apply cleanly to staging/for_v3.2 tree. Which branch is it based on ?
---
Thanks,
Sylwester
Hi Sylwester,
I'is based ongit://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git kernel-3.1.0-git9+
All patches are working on newly created driver directory drivers/staging/media/as102 (exception is 13/14: staging/Makefile and staging/Kconfig) and they apply cleanly in my tree. Let me know why they doesn't on yours and i'll try to fix them.
Thanks,
Piotr
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
Hi,
Quoted 29 lines · Piotr Chmura
W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:
Quoted 19 lines · Piotr Chmura
Quoted 10 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixesQuoted 8 lines
From: Devin Heitmueller<[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>Quoted 8 lines
Hi Piotr,
starting from this patch the series doesn't apply cleanly to staging/for_v3.2 tree. Which branch is it based on ?
---
Thanks,
Sylwester
Quoted 8 lines
Hi Sylwester,
I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitkernel-3.1.0-git9+All patches are working on newly created driver directory
drivers/staging/media/as102(exception is 13/14: staging/Makefile and staging/Kconfig) and they apply cleanly in my tree. Let me know why they doesn't on yours and i'll try to fix them.
I suspect the patch got mangled. The base tree shouldn't matter that much since the patches are touching only the newly created directory.
With you previous patch set I'm getting an error at patch 5/11.
snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-1-14-staging-media-as102-initial-import-from-Abilis.patch Applying: staging/media/as102: initial import from Abilis snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-2-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-3-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-4-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes fatal: corrupt patch at line 664 Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 staging/media/as102: checkpatch fixes When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". snawrocki@vostro:~/linux/media_tree$ git apply --verbose --reject RESEND-4-14-staging-media-as102-checkpatch-fixes.patch fatal: corrupt patch at line 702 snawrocki@vostro:~/linux/media_tree$ git ll cbcbb4b staging/media/as102: checkpatch fixes acde12d staging/media/as102: checkpatch fixes d47fc51 staging/media/as102: initial import from Abilis ...
You are not using git send-email to send the patches, are you ?
Signature · 2 lines
Regards, Sylwester
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
W dniu 29.10.2011 18:14, Sylwester Nawrocki pisze:
Quoted 44 lines
Hi,
Quoted 28 lines · Piotr Chmura
W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:
Quoted 19 lines · Piotr Chmura
Quoted 10 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixesQuoted 8 lines
From: Devin Heitmueller<[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>Quoted 8 lines
Hi Piotr,
starting from this patch the series doesn't apply cleanly to staging/for_v3.2 tree. Which branch is it based on ?
---
Thanks,
SylwesterQuoted 8 lines
Hi Sylwester,
I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitkernel-3.1.0-git9+All patches are working on newly created driver directory
drivers/staging/media/as102(exception is 13/14: staging/Makefile and staging/Kconfig) and they apply cleanly in my tree. Let me know why they doesn't on yours and i'll try to fix them.I suspect the patch got mangled. The base tree shouldn't matter that much since the patches are touching only the newly created directory.
With you previous patch set I'm getting an error at patch 5/11.
Quoted 15 lines
snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-1-14-staging-media-as102-initial-import-from-Abilis.patch Applying: staging/media/as102: initial import from Abilis snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-2-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-3-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-4-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes fatal: corrupt patch at line 664 Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 staging/media/as102: checkpatch fixes When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
I've downloaded patches from patchwork, as expected by you:
dom@darkstar ~/src/kernel/linux.trynew $ patch -p1 -i RESEND-4-14-staging-media-as102-checkpatch-fixes.patch patching file drivers/staging/media/as102/as10x_cmd.c
patch: **** malformed patch at line 664: To unsubscribe from this list: send the line "unsubscribe linux-media" in
after removing
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
from end of file:
dom@darkstar ~/src/kernel/linux.trynew $ patch -p1 -i RESEND-4-14-staging-media-as102-checkpatch-fixes.patch patching file drivers/staging/media/as102/as10x_cmd.c
Works fine, so looks like footer of mailing list IS an issue here (there are less then 3 lines in patch because of end of file).
Quoted 10 lines
snawrocki@vostro:~/linux/media_tree$ git apply --verbose --reject RESEND-4-14-staging-media-as102-checkpatch-fixes.patch fatal: corrupt patch at line 702 snawrocki@vostro:~/linux/media_tree$ git ll cbcbb4b staging/media/as102: checkpatch fixes acde12d staging/media/as102: checkpatch fixes d47fc51 staging/media/as102: initial import from Abilis ...You are not using git send-email to send the patches, are you ?
I'm not using git for sending patches.
Peter
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
Quoted 58 lines · Piotr Chmura
W dniu 29.10.2011 18:14, Sylwester Nawrocki pisze:
Quoted 42 lines · Piotr Chmura
Quoted 28 lines
W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:
Quoted 19 lines · Piotr Chmura
Quoted 10 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixesQuoted 8 lines
From: Devin Heitmueller<[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>Quoted 8 lines
Hi Piotr,
starting from this patch the series doesn't apply cleanly to staging/for_v3.2 tree. Which branch is it based on ?
---
Thanks,
SylwesterQuoted 8 lines
Hi Sylwester,
I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitkernel-3.1.0-git9+All patches are working on newly created driver directory
drivers/staging/media/as102(exception is 13/14: staging/Makefile and staging/Kconfig) and they apply cleanly in my tree. Let me know why they doesn't on yours and i'll try to fix them.I suspect the patch got mangled. The base tree shouldn't matter that much since the patches are touching only the newly created directory.
With you previous patch set I'm getting an error at patch 5/11.Quoted 15 lines
snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-1-14-staging-media-as102-initial-import-from-Abilis.patch Applying: staging/media/as102: initial import from Abilis snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-2-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-3-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes snawrocki@vostro:~/linux/media_tree$ git am -3 RESEND-4-14-staging-media-as102-checkpatch-fixes.patch Applying: staging/media/as102: checkpatch fixes fatal: corrupt patch at line 664 Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 staging/media/as102: checkpatch fixes When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
Quoted 16 lines
I've downloaded patches from patchwork, as expected by you:
dom@darkstar ~/src/kernel/linux.trynew $ patch -p1 -i RESEND-4-14-staging-media-as102-checkpatch-fixes.patch patching file
drivers/staging/media/as102/as10x_cmd.c
patch: **** malformed patch at line 664: To unsubscribe from this list: send the line "unsubscribe linux-media" inafter removing
Signature · 8 lines
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected] from end of file: dom@darkstar ~/src/kernel/linux.trynew $ patch -p1 -i RESEND-4-14-staging-media-as102-checkpatch-fixes.patch patching file drivers/staging/media/as102/as10x_cmd.c Works fine, so looks like footer of mailing list IS an issue here (there are less then 3 lines in patch because of end of file).
Yes, I confirm removing the footer solves the problem when using 'patch' rather than 'git am'.
But then even 'patch' gives up at the subsequent patch:
$ patch -p1 -i RESEND-5-14-staging-media-as102-checkpatch-fixes.patch patching file drivers/staging/media/as102/as10x_cmd_stream.c Hunk #3 FAILED at 111. 1 out of 3 hunks FAILED -- saving rejects to file drivers/staging/media/as102/as10x_cmd_stream.c.rej
Anyway, thanks for your work, I ended up applying patches 1..3/14, 7..10 (RESEND), and 13..14/14 onto staging/for_v3.2 branch (http://git.linuxtv.org/media_tree.git).
The driver works fine then with my PCTV 74e stick.
Quoted 9 lines
Quoted 9 lines
snawrocki@vostro:~/linux/media_tree$ git apply --verbose --reject RESEND-4-14-staging-media-as102-checkpatch-fixes.patch fatal: corrupt patch at line 702 snawrocki@vostro:~/linux/media_tree$ git ll cbcbb4b staging/media/as102: checkpatch fixes acde12d staging/media/as102: checkpatch fixes d47fc51 staging/media/as102: initial import from Abilis ...
Quoted 3 lines
Quoted 2 lines
You are not using git send-email to send the patches, are you ?
I'm not using git for sending patches.
I have never had any issues with git send-email, and it's quite easy to setup and convenient to use with larger patch series.
Signature · 2 lines
Regards, Sylwester
PATCH v3 4/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f # Parent b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as10x_cmd.c.
Priority: normal
----
Added missing empty lines at end of patch
Sylwester could you check if it applies cleanly now ?
drivers/staging/media/as102/as10x_cmd.c +254 -251
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,8 @@#include <linux/kernel.h> #include "as102_drv.h" #elif defined(WIN32 ) -#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)/* win32 ddk implementation */ +#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) +/* win32 ddk implementation */ #include "wdm.h" #include "Device.h" #include "endian_mgmt.h" /* FIXME */
@@ -51,43 +53,42 @@*/ int as10x_cmd_turn_on (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.turn_on.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.turn_on.req)); -/* fill command */ - pcmd->body.turn_on.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNON ); +/* fill command */ + pcmd->body.turn_on.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNON ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( - phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.turn_on.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.turn_on.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.turn_on.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.turn_on.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNON_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNON_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -98,42 +99,41 @@*/ int as10x_cmd_turn_off (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.turn_off.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.turn_off.req)); -/* fill command */ - pcmd->body.turn_off.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNOFF ); +/* fill command */ + pcmd->body.turn_off.req.proc_id =cpu_to_le16 (CONTROL_PROC_TURNOFF ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd ( phandle, (uint8_t *) pcmd,sizeof (pcmd->body.turn_off.req) +HEADER_SIZE , - (uint8_t *) prsp, + (uint8_t *) prsp,sizeof (prsp->body.turn_off.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNOFF_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_TURNOFF_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -145,50 +145,54 @@*/ int as10x_cmd_set_tune (as10x_handle_t *phandle,struct as10x_tune_args *ptune) { -int error; -struct as10x_cmd_t *preq, *prsp; +int error; +struct as10x_cmd_t *preq, *prsp; -ENTER (); +ENTER (); - preq = phandle->cmd; - prsp = phandle->rsp; + preq = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (preq,(++phandle->cmd_xid),sizeof (preq->body.set_tune.req)); +/* prepare command */ +as10x_cmd_build (preq, (++phandle->cmd_xid), +sizeof (preq->body.set_tune.req)); -/* fill command */ - preq->body.set_tune.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETTUNE ); - preq->body.set_tune.req.args.freq =cpu_to_le32 (ptune->freq); - preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; - preq->body.set_tune.req.args.hier_select = ptune->hier_select; - preq->body.set_tune.req.args.constellation = ptune->constellation; - preq->body.set_tune.req.args.hierarchy = ptune->hierarchy; - preq->body.set_tune.req.args.interleaving_mode = ptune->interleaving_mode; - preq->body.set_tune.req.args.code_rate = ptune->code_rate; - preq->body.set_tune.req.args.guard_interval = ptune->guard_interval; - preq->body.set_tune.req.args.transmission_mode = ptune->transmission_mode; +/* fill command */ + preq->body.set_tune.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETTUNE ); + preq->body.set_tune.req.args.freq =cpu_to_le32 (ptune->freq); + preq->body.set_tune.req.args.bandwidth = ptune->bandwidth; + preq->body.set_tune.req.args.hier_select = ptune->hier_select; + preq->body.set_tune.req.args.constellation = ptune->constellation; + preq->body.set_tune.req.args.hierarchy = ptune->hierarchy; + preq->body.set_tune.req.args.interleaving_mode = + ptune->interleaving_mode; + preq->body.set_tune.req.args.code_rate = ptune->code_rate; + preq->body.set_tune.req.args.guard_interval = ptune->guard_interval; + preq->body.set_tune.req.args.transmission_mode = + ptune->transmission_mode; -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) preq, -sizeof (preq->body.set_tune.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.set_tune.rsp) +HEADER_SIZE ); - }else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) preq, +sizeof (preq->body.set_tune.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.set_tune.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_SETTUNE_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_SETTUNE_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -198,57 +202,55 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_get_tune_status (as10x_handle_t *phandle,struct as10x_tune_status *pstatus) +int as10x_cmd_get_tune_status (as10x_handle_t *phandle, +struct as10x_tune_status *pstatus) { -int error; -struct as10x_cmd_t *preq, *prsp; +int error; +struct as10x_cmd_t *preq, *prsp; -ENTER (); +ENTER (); - preq = phandle->cmd; - prsp = phandle->rsp; + preq = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (preq,(++phandle->cmd_xid), -sizeof (preq->body.get_tune_status.req)); +/* prepare command */ +as10x_cmd_build (preq, (++phandle->cmd_xid), +sizeof (preq->body.get_tune_status.req)); -/* fill command */ - preq->body.get_tune_status.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GETTUNESTAT ); +/* fill command */ + preq->body.get_tune_status.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GETTUNESTAT ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd ( +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd ( phandle, (uint8_t *) preq,sizeof (preq->body.get_tune_status.req) +HEADER_SIZE , (uint8_t *) prsp,sizeof (prsp->body.get_tune_status.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTUNESTAT_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTUNESTAT_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; - pstatus->signal_strength = -le16_to_cpu (prsp->body.get_tune_status.rsp.sts.signal_strength); - pstatus->PER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.PER); - pstatus->BER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.BER); +/* Response OK -> get response data */ + pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state; + pstatus->signal_strength = +le16_to_cpu (prsp->body.get_tune_status.rsp.sts.signal_strength); + pstatus->PER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.PER); + pstatus->BER =le16_to_cpu (prsp->body.get_tune_status.rsp.sts.BER); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -260,56 +262,58 @@*/ int as10x_cmd_get_tps (as10x_handle_t *phandle,struct as10x_tps *ptps) { +int error; +struct as10x_cmd_t *pcmd, *prsp; -int error; -struct as10x_cmd_t *pcmd, *prsp; +ENTER (); -ENTER (); + pcmd = phandle->cmd; + prsp = phandle->rsp; - pcmd = phandle->cmd; - prsp = phandle->rsp; +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_tps.req)); -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid),sizeof (pcmd->body.get_tps.req)); +/* fill command */ + pcmd->body.get_tune_status.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GETTPS ); -/* fill command */ - pcmd->body.get_tune_status.req.proc_id =cpu_to_le16 (CONTROL_PROC_GETTPS ); +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_tps.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_tps.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd,sizeof (pcmd->body.get_tps.req) +HEADER_SIZE , - (uint8_t *) prsp,sizeof (prsp->body.get_tps.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +if (error <0 ) + goto out; -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTPS_RSP ); +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GETTPS_RSP ); -if (error <0 ) { - goto out; - } - -/* Response OK -> get response data */ - ptps->constellation = prsp->body.get_tps.rsp.tps.constellation; - ptps->hierarchy = prsp->body.get_tps.rsp.tps.hierarchy; - ptps->interleaving_mode = prsp->body.get_tps.rsp.tps.interleaving_mode; - ptps->code_rate_HP = prsp->body.get_tps.rsp.tps.code_rate_HP; - ptps->code_rate_LP = prsp->body.get_tps.rsp.tps.code_rate_LP; - ptps->guard_interval = prsp->body.get_tps.rsp.tps.guard_interval; - ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; - ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; - ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; - ptps->cell_ID =le16_to_cpu (prsp->body.get_tps.rsp.tps.cell_ID); +/* Response OK -> get response data */ + ptps->constellation = prsp->body.get_tps.rsp.tps.constellation; + ptps->hierarchy = prsp->body.get_tps.rsp.tps.hierarchy; + ptps->interleaving_mode = prsp->body.get_tps.rsp.tps.interleaving_mode; + ptps->code_rate_HP = prsp->body.get_tps.rsp.tps.code_rate_HP; + ptps->code_rate_LP = prsp->body.get_tps.rsp.tps.code_rate_LP; + ptps->guard_interval = prsp->body.get_tps.rsp.tps.guard_interval; + ptps->transmission_mode = prsp->body.get_tps.rsp.tps.transmission_mode; + ptps->DVBH_mask_HP = prsp->body.get_tps.rsp.tps.DVBH_mask_HP; + ptps->DVBH_mask_LP = prsp->body.get_tps.rsp.tps.DVBH_mask_LP; + ptps->cell_ID =le16_to_cpu (prsp->body.get_tps.rsp.tps.cell_ID); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -322,59 +326,58 @@int as10x_cmd_get_demod_stats (as10x_handle_t *phandle,struct as10x_demod_stats *pdemod_stats) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.get_demod_stats.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_demod_stats.req)); -/* fill command */ - pcmd->body.get_demod_stats.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GET_DEMOD_STATS ); +/* fill command */ + pcmd->body.get_demod_stats.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GET_DEMOD_STATS ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.get_demod_stats.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.get_demod_stats.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_demod_stats.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_demod_stats.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_DEMOD_STATS_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_DEMOD_STATS_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - pdemod_stats->frame_count = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.frame_count); - pdemod_stats->bad_frame_count = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bad_frame_count); - pdemod_stats->bytes_fixed_by_rs = -le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); - pdemod_stats->mer = -le16_to_cpu (prsp->body.get_demod_stats.rsp.stats.mer); - pdemod_stats->has_started = - prsp->body.get_demod_stats.rsp.stats.has_started; +/* Response OK -> get response data */ + pdemod_stats->frame_count = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.frame_count); + pdemod_stats->bad_frame_count = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bad_frame_count); + pdemod_stats->bytes_fixed_by_rs = +le32_to_cpu (prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs); + pdemod_stats->mer = +le16_to_cpu (prsp->body.get_demod_stats.rsp.stats.mer); + pdemod_stats->has_started = + prsp->body.get_demod_stats.rsp.stats.has_started; out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -388,50 +391,49 @@int as10x_cmd_get_impulse_resp (as10x_handle_t *phandle,uint8_t *is_ready) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.get_impulse_rsp.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.get_impulse_rsp.req)); -/* fill command */ - pcmd->body.get_impulse_rsp.req.proc_id = -cpu_to_le16 (CONTROL_PROC_GET_IMPULSE_RESP ); +/* fill command */ + pcmd->body.get_impulse_rsp.req.proc_id = +cpu_to_le16 (CONTROL_PROC_GET_IMPULSE_RESP ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.get_impulse_rsp.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.get_impulse_rsp.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.get_impulse_rsp.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.get_impulse_rsp.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_IMPULSE_RESP_RSP ); -if (error <0 ) { - goto out; - } +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_GET_IMPULSE_RESP_RSP ); +if (error <0 ) + goto out; -/* Response OK -> get response data */ - *is_ready = prsp->body.get_impulse_rsp.rsp.is_ready; +/* Response OK -> get response data */ + *is_ready = prsp->body.get_impulse_rsp.rsp.is_ready; out: -LEAVE (); -return (error); +LEAVE (); +return error; }
@@ -447,10 +449,10 @@void as10x_cmd_build (struct as10x_cmd_t *pcmd,uint16_t xid,uint16_t cmd_len) { - pcmd->header.req_id =cpu_to_le16 (xid); - pcmd->header.prog =cpu_to_le16 (SERVICE_PROG_ID ); - pcmd->header.version =cpu_to_le16 (SERVICE_PROG_VERSION ); - pcmd->header.data_len =cpu_to_le16 (cmd_len); + pcmd->header.req_id =cpu_to_le16 (xid); + pcmd->header.prog =cpu_to_le16 (SERVICE_PROG_ID ); + pcmd->header.version =cpu_to_le16 (SERVICE_PROG_VERSION ); + pcmd->header.data_len =cpu_to_le16 (cmd_len); }/**
@@ -463,16 +465,17 @@*/ int as10x_rsp_parse (struct as10x_cmd_t *prsp,uint16_t proc_id) { -int error; +int error; -/* extract command error code */ - error = prsp->body.common.rsp.error; +/* extract command error code */ + error = prsp->body.common.rsp.error; -if ((error ==0 ) && (le16_to_cpu (prsp->body.common.rsp.proc_id) == proc_id)) { -return 0 ; - } +if ((error ==0 ) && + (le16_to_cpu (prsp->body.common.rsp.proc_id) == proc_id)) { +return 0 ; + } -return AS10X_CMD_ERROR ; +return AS10X_CMD_ERROR ; }
Re: [PATCH v3 4/14] staging/media/as102: checkpatch fixes
drivers/staging/media/as102/as10x_cmd.c
Quoted 27 lines · On Oct 30 Piotr Chmura wrote:
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixesFrom: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller <[email protected]>Signed-off-by Piotr Chmura <[email protected]>----
Added missing empty lines at end of patchSylwester could you check if it applies cleanly now ?
drivers/staging/media/as102/as10x_cmd.c +0
-0
[...]
"man git-am" says: "'From: ' [...] lines *starting* the body override the respective commit author name and title values taken from the headers." (Emphasis mine.) So, if the author field of the commit is meant to be set to Devin Heitmueller, the line "From: Devin [...]" needs to be placed as the first body of the mail message body.
Or more correctly spoken, lines in a format like RFC 2822 mail headers may appear in the mail body and are recognized by "git am" as input for commit metadata
- if they are "From: ", "Subject: ", or "Date: " header-like lines,
- if they appear before any other kinds of lines of the mail body.
A pro pos, it would be good to not only preserve author name and address that way, but also authorship date. I.e. if possible transform the line "# Date 1267318701 18000" into an RFC 2822 date-header like line and put it together with the From: line at the beginning of the body. I am not sure which date-time specification formats "git am" understands, but at least the one per RFC 2822 clause 3.3 works.
The date thing would be icing on the cake. In current practice, not many kernel developers who forward patches by mail seem to be aware of it.
On the rest of the changelog, the part that you added:
- The URL of the original repo was of some interest in the first patch which adds all the entire driver. But it is hardly interesting in a checkpatch cleanup.
- The information that this was once a HG changeset (before it became a mailed patch and hopefully eventually becomes a git commit...) as well as the original commit ID and parent commit ID are not of interest for the git changelog.
On the rest of the changelog, the part written by Devin:
- Well, that doesn't say a lot. /What/ kinds of checkpatch issues were "fixed", and why? In my opinion, the fact that a certain script called checkpatch was involved at all is one of the last interesting facts about this change. There was nothing "fixed" here. From a quick look at it, this patch reformats whitespace and changes perhaps some other code formatting to bring it closer to normal Linux code format.
- We don't have "Priority" lines in mainline changelogs.
However, since the kind of changes done in this patch appears to be mostly or entirely trivial, it is not a drama to have a less than perfect changelog (to say it mildly). But please consider for future
contributions: When writing a changelog always describe the reason or impact of the change. E.g. here whitespace changes (and more?) without (?) change of functionality (without change of generated machine code even?). --- This criticism goes primarily to Devin, but also to Piotr who had the chance to improve the changelog.
A very brief guide about good changelogs can be found in Andrew Morton's "The Perfect Patch", e.g. http://kerneltrap.org/node/3737. It takes a bit of consideration how to apply it to a patch like this one though. Hint:
The answer to "why the kernel needed patching" in this case is *not* "because checkpatch told so". ;-)
Take this criticism of the changelog not as a request to change this particular one, but as something to keep in mind in future contributions.
On the part after changelog, before the diff:
- The delimiter is supposed to be *three* dashes, immediately followed by end-of-line, not four dashes. See "man git-am" for lines that are recognized as beginning the patch == ending the changelog.
- Please always insert a diffstat here. This is a help to anybody wanting to review or handle a patch posting.
On the diff:
- In typical patches which only touch a small part of a file, it is very important to generate the patch like "diff --show-c-function [...]" a.k.a. "diff -p [...]" would do. While this information is ignored by any tool which applies the patch, it highly increases the human- readability of the diff.
Of course in this patch here which changes almost the entire file, this bit is not important for readability. But keep it in mind for future patch postings.
Signature · 3 lines
Stefan Richter -=====-==-== =-=- ====- http://arcgraph.de/sr/
Re: [PATCH v3 4/14] staging/media/as102: checkpatch fixes
Quoted 5 lines · On Oct 30 Piotr Chmura wrote:
Quoted 4 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
By the way, the brand new git 1.7.8.rc0 features some HG support in "git am":
https://code.google.com/p/git-core/source/detail?spec=svnbe3fa9125e708348c7baf04ebe9507a72a9d1800&r=0cfd112032017ab68ed576f6bb5258452084ebf1
This converts the "# User" and "# Date" lines of HG patches into RFC 2822 "From: " and "Date: " lines which are then used as authorship metadata.
Signature · 3 lines
Stefan Richter -=====-==-== =-=- ===== http://arcgraph.de/sr/
Re: [PATCH v3 4/14] staging/media/as102: checkpatch fixes
Em 31-10-2011 08:48, Stefan Richter escreveu:
Quoted 11 lines
Quoted 5 lines · On Oct 30 Piotr Chmura wrote:
Quoted 4 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patchBy the way, the brand new git 1.7.8.rc0 features some HG support in "git am":
https://code.google.com/p/git-core/source/detail?spec=svnbe3fa9125e708348c7baf04ebe9507a72a9d1800&r=0cfd112032017ab68ed576f6bb5258452084ebf1This converts the "# User" and "# Date" lines of HG patches into RFC 2822 "From: " and "Date: " lines which are then used as authorship metadata.
hg headers are fine. As we moved from hg a few years, the scripts I use here already handles hg headers, converting them to rfc-2822 (it also does other neat things like calling checkpatch.pl ;) ).
Cheers,
Mauro
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
In reply to Piotr ChmuraW dniu 29.10.2011 15:17, Piotr Chmura pisze:
Quoted 30 lines
W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:
Quoted 19 lines · Piotr Chmura
Quoted 10 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixesQuoted 8 lines
From: Devin Heitmueller<[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>Quoted 8 lines
Hi Piotr,
starting from this patch the series doesn't apply cleanly to staging/for_v3.2 tree. Which branch is it based on ?
---
Thanks,
Sylwester
Quoted 6 lines
Hi Sylwester,
I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitkernel-3.1.0-git9+All patches are working on newly created driver directory
drivers/staging/media/as102(exception is 13/14: staging/Makefile and staging/Kconfig) and they apply cleanly in my tree. Let me know why they doesn't on yours and i'll try to fix them.
One more thing... patches starting from 4/14 in patchwork have
"To unsubscribe from this list: send the line "unsubscribe linux-media" in..."
on the end.
Isn't this making them wrong ?
Peter
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
Quoted 39 lines · Piotr Chmura
W dniu 29.10.2011 15:17, Piotr Chmura pisze:
Quoted 29 lines
W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:
Quoted 19 lines · Piotr Chmura
Quoted 10 lines
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267318701 18000
# Node ID69c8f5172790784738bcc18f8301919ef3d5373f# Parentb91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixesQuoted 8 lines
From: Devin Heitmueller<[email protected]>
Fix make checkpatch issues reported against
as10x_cmd.c.Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>Quoted 8 lines
Hi Piotr,
starting from this patch the series doesn't apply cleanly to staging/for_v3.2 tree. Which branch is it based on ?
---
Thanks,
SylwesterQuoted 8 lines
Hi Sylwester,
I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitkernel-3.1.0-git9+All patches are working on newly created driver directory
drivers/staging/media/as102(exception is 13/14: staging/Makefile and staging/Kconfig) and they apply cleanly in
my tree. Let me know why they doesn't on yours and i'll try to fix them.
Quoted 7 lines
One more thing... patches starting from 4/14 in patchwork have
"To unsubscribe from this list: send the line "unsubscribe linux-media" in..."
on the end.
Isn't this making them wrong ?
This shouldn't be an issue, I've also used patches saved directly form an e-mail client which didn't have this text appended and the patch didn't apply in same way.
Re: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes
Quoted 10 lines · Sylwester Nawrocki
Quoted 10 lines
Quoted 8 lines
Hi Sylwester,
I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitkernel-3.1.0-git9+All patches are working on newly created driver directory
drivers/staging/media/as102(exception is 13/14: staging/Makefile and staging/Kconfig) and they apply cleanly in
my tree. Let me know why they doesn't on yours and i'll try to fix them.One more thing... patches starting from 4/14 in patchwork have
Quoted 8 lines
Quoted 5 lines
"To unsubscribe from this list: send the line "unsubscribe linux-media" in..."
on the end.
Isn't this making them wrong ?
This shouldn't be an issue, I've also used patches saved directly form an e-mail client which didn't have this text appended and the patch didn't apply in same way.
I get this error when I try apply them.
patching file drivers/staging/media/as102/as10x_cmd.c
patch: **** malformed patch at line 696: _______________________________________________
I'm applying with "patch" not with "git am".
regards,
dan carpenter
PATCH 5/14 staging/media/as102: checkpatch fixes
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318751 18000
# Node ID 1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2 # Parent 69c8f5172790784738bcc18f8301919ef3d5373f
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as10x_cmd_stream.c.
Priority: normal
drivers/staging/media/as102/as10x_cmd_stream.c +127 -135
@@ -2,8 +2,6 @@ \file as10x_cmd_stream.c - \version $Id$ - \author: S. Martinelli ----------------------------------------------------------------------------\n
@@ -53,57 +51,57 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_add_PID_filter (as10x_handle_t * phandle, -struct as10x_ts_filter *filter) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int as10x_cmd_add_PID_filter (as10x_handle_t *phandle, +struct as10x_ts_filter *filter) +{ +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.add_pid_filter.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.add_pid_filter.req)); -/* fill command */ - pcmd->body.add_pid_filter.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETFILTER ); - pcmd->body.add_pid_filter.req.pid =cpu_to_le16 (filter->pid); - pcmd->body.add_pid_filter.req.stream_type = filter->type; +/* fill command */ + pcmd->body.add_pid_filter.req.proc_id = +cpu_to_le16 (CONTROL_PROC_SETFILTER ); + pcmd->body.add_pid_filter.req.pid =cpu_to_le16 (filter->pid); + pcmd->body.add_pid_filter.req.stream_type = filter->type; -if (filter->idx <16 ) - pcmd->body.add_pid_filter.req.idx = filter->idx; -else - pcmd->body.add_pid_filter.req.idx =0xFF ; +if (filter->idx <16 ) + pcmd->body.add_pid_filter.req.idx = filter->idx; +else + pcmd->body.add_pid_filter.req.idx =0xFF ; -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.add_pid_filter.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.add_pid_filter.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.add_pid_filter.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.add_pid_filter.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_SETFILTER_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_SETFILTER_RSP ); -if (error ==0 ) { -/* Response OK -> get response data */ - filter->idx = prsp->body.add_pid_filter.rsp.filter_id; - } +if (error ==0 ) { +/* Response OK -> get response data */ + filter->idx = prsp->body.add_pid_filter.rsp.filter_id; + } out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -113,144 +111,138 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_del_PID_filter (as10x_handle_t * phandle, +int as10x_cmd_del_PID_filter (as10x_handle_t *phandle,uint16_t pid_value) { +int error; +struct as10x_cmd_t *pcmd, *prsp; -int error; -struct as10x_cmd_t *pcmd, *prsp; +ENTER (); -ENTER (); + pcmd = phandle->cmd; + prsp = phandle->rsp; - pcmd = phandle->cmd; - prsp = phandle->rsp; +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.del_pid_filter.req)); -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.del_pid_filter.req)); +/* fill command */ + pcmd->body.del_pid_filter.req.proc_id = +cpu_to_le16 (CONTROL_PROC_REMOVEFILTER ); + pcmd->body.del_pid_filter.req.pid =cpu_to_le16 (pid_value); -/* fill command */ - pcmd->body.del_pid_filter.req.proc_id =cpu_to_le16 (CONTROL_PROC_REMOVEFILTER ); - pcmd->body.del_pid_filter.req.pid =cpu_to_le16 (pid_value); +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.del_pid_filter.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.del_pid_filter.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.del_pid_filter.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.del_pid_filter.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +if (error <0 ) + goto out; -if (error <0 ) { - goto out; - } - -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_REMOVEFILTER_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_REMOVEFILTER_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/** \brief Send start streaming command to AS10x \param phandle: pointer to AS10x handle -\return 0 when no error, < 0 in case of error._ +\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_start_streaming (as10x_handle_t * phandle) +int as10x_cmd_start_streaming (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.start_streaming.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.start_streaming.req)); -/* fill command */ - pcmd->body.start_streaming.req.proc_id = -cpu_to_le16 (CONTROL_PROC_START_STREAMING ); +/* fill command */ + pcmd->body.start_streaming.req.proc_id = +cpu_to_le16 (CONTROL_PROC_START_STREAMING ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.start_streaming.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.start_streaming.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.start_streaming.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.start_streaming.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_START_STREAMING_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_START_STREAMING_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/** \brief Send stop streaming command to AS10x \param phandle: pointer to AS10x handle -\return 0 when no error, < 0 in case of error._ +\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_stop_streaming (as10x_handle_t * phandle) +int as10x_cmd_stop_streaming (as10x_handle_t *phandle) { -int8_t error; -struct as10x_cmd_t *pcmd, *prsp; +int8_t error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.stop_streaming.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.stop_streaming.req)); -/* fill command */ - pcmd->body.stop_streaming.req.proc_id = -cpu_to_le16 (CONTROL_PROC_STOP_STREAMING ); +/* fill command */ + pcmd->body.stop_streaming.req.proc_id = +cpu_to_le16 (CONTROL_PROC_STOP_STREAMING ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.stop_streaming.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.stop_streaming.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.stop_streaming.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.stop_streaming.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_STOP_STREAMING_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_STOP_STREAMING_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }
PATCH RESEND 5/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318751 18000
# Node ID 1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2 # Parent 69c8f5172790784738bcc18f8301919ef3d5373f
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as10x_cmd_stream.c.
Priority: normal
drivers/staging/media/as102/as10x_cmd_stream.c +127 -135
@@ -2,8 +2,6 @@ \file as10x_cmd_stream.c - \version $Id$ - \author: S. Martinelli ----------------------------------------------------------------------------\n
@@ -53,57 +51,57 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_add_PID_filter (as10x_handle_t * phandle, -struct as10x_ts_filter *filter) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int as10x_cmd_add_PID_filter (as10x_handle_t *phandle, +struct as10x_ts_filter *filter) +{ +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.add_pid_filter.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.add_pid_filter.req)); -/* fill command */ - pcmd->body.add_pid_filter.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETFILTER ); - pcmd->body.add_pid_filter.req.pid =cpu_to_le16 (filter->pid); - pcmd->body.add_pid_filter.req.stream_type = filter->type; +/* fill command */ + pcmd->body.add_pid_filter.req.proc_id = +cpu_to_le16 (CONTROL_PROC_SETFILTER ); + pcmd->body.add_pid_filter.req.pid =cpu_to_le16 (filter->pid); + pcmd->body.add_pid_filter.req.stream_type = filter->type; -if (filter->idx <16 ) - pcmd->body.add_pid_filter.req.idx = filter->idx; -else - pcmd->body.add_pid_filter.req.idx =0xFF ; +if (filter->idx <16 ) + pcmd->body.add_pid_filter.req.idx = filter->idx; +else + pcmd->body.add_pid_filter.req.idx =0xFF ; -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.add_pid_filter.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.add_pid_filter.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.add_pid_filter.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.add_pid_filter.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_SETFILTER_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_SETFILTER_RSP ); -if (error ==0 ) { -/* Response OK -> get response data */ - filter->idx = prsp->body.add_pid_filter.rsp.filter_id; - } +if (error ==0 ) { +/* Response OK -> get response data */ + filter->idx = prsp->body.add_pid_filter.rsp.filter_id; + } out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -113,144 +111,138 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_del_PID_filter (as10x_handle_t * phandle, +int as10x_cmd_del_PID_filter (as10x_handle_t *phandle,uint16_t pid_value) { +int error; +struct as10x_cmd_t *pcmd, *prsp; -int error; -struct as10x_cmd_t *pcmd, *prsp; +ENTER (); -ENTER (); + pcmd = phandle->cmd; + prsp = phandle->rsp; - pcmd = phandle->cmd; - prsp = phandle->rsp; +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.del_pid_filter.req)); -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.del_pid_filter.req)); +/* fill command */ + pcmd->body.del_pid_filter.req.proc_id = +cpu_to_le16 (CONTROL_PROC_REMOVEFILTER ); + pcmd->body.del_pid_filter.req.pid =cpu_to_le16 (pid_value); -/* fill command */ - pcmd->body.del_pid_filter.req.proc_id =cpu_to_le16 (CONTROL_PROC_REMOVEFILTER ); - pcmd->body.del_pid_filter.req.pid =cpu_to_le16 (pid_value); +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.del_pid_filter.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.del_pid_filter.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.del_pid_filter.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.del_pid_filter.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +if (error <0 ) + goto out; -if (error <0 ) { - goto out; - } - -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_REMOVEFILTER_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_REMOVEFILTER_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/** \brief Send start streaming command to AS10x \param phandle: pointer to AS10x handle -\return 0 when no error, < 0 in case of error._ +\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_start_streaming (as10x_handle_t * phandle) +int as10x_cmd_start_streaming (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.start_streaming.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.start_streaming.req)); -/* fill command */ - pcmd->body.start_streaming.req.proc_id = -cpu_to_le16 (CONTROL_PROC_START_STREAMING ); +/* fill command */ + pcmd->body.start_streaming.req.proc_id = +cpu_to_le16 (CONTROL_PROC_START_STREAMING ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.start_streaming.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.start_streaming.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.start_streaming.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.start_streaming.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_START_STREAMING_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_START_STREAMING_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/** \brief Send stop streaming command to AS10x \param phandle: pointer to AS10x handle -\return 0 when no error, < 0 in case of error._ +\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_stop_streaming (as10x_handle_t * phandle) +int as10x_cmd_stop_streaming (as10x_handle_t *phandle) { -int8_t error; -struct as10x_cmd_t *pcmd, *prsp; +int8_t error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.stop_streaming.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.stop_streaming.req)); -/* fill command */ - pcmd->body.stop_streaming.req.proc_id = -cpu_to_le16 (CONTROL_PROC_STOP_STREAMING ); +/* fill command */ + pcmd->body.stop_streaming.req.proc_id = +cpu_to_le16 (CONTROL_PROC_STOP_STREAMING ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.stop_streaming.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.stop_streaming.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.stop_streaming.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.stop_streaming.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_STOP_STREAMING_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_STOP_STREAMING_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }
PATCH v3 5/14 staging/media/as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Reformats as10x_cmd_stream.c to take it closer to linux format code.
---
v3: added missing empty lines on end of patch.
drivers/staging/media/as102/as10x_cmd_stream.c +127 -135
@@ -2,8 +2,6 @@ \file as10x_cmd_stream.c - \version $Id$ - \author: S. Martinelli ----------------------------------------------------------------------------\n
@@ -53,57 +51,57 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_add_PID_filter (as10x_handle_t * phandle, -struct as10x_ts_filter *filter) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int as10x_cmd_add_PID_filter (as10x_handle_t *phandle, +struct as10x_ts_filter *filter) +{ +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.add_pid_filter.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.add_pid_filter.req)); -/* fill command */ - pcmd->body.add_pid_filter.req.proc_id =cpu_to_le16 (CONTROL_PROC_SETFILTER ); - pcmd->body.add_pid_filter.req.pid =cpu_to_le16 (filter->pid); - pcmd->body.add_pid_filter.req.stream_type = filter->type; +/* fill command */ + pcmd->body.add_pid_filter.req.proc_id = +cpu_to_le16 (CONTROL_PROC_SETFILTER ); + pcmd->body.add_pid_filter.req.pid =cpu_to_le16 (filter->pid); + pcmd->body.add_pid_filter.req.stream_type = filter->type; -if (filter->idx <16 ) - pcmd->body.add_pid_filter.req.idx = filter->idx; -else - pcmd->body.add_pid_filter.req.idx =0xFF ; +if (filter->idx <16 ) + pcmd->body.add_pid_filter.req.idx = filter->idx; +else + pcmd->body.add_pid_filter.req.idx =0xFF ; -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.add_pid_filter.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.add_pid_filter.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.add_pid_filter.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.add_pid_filter.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_SETFILTER_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_SETFILTER_RSP ); -if (error ==0 ) { -/* Response OK -> get response data */ - filter->idx = prsp->body.add_pid_filter.rsp.filter_id; - } +if (error ==0 ) { +/* Response OK -> get response data */ + filter->idx = prsp->body.add_pid_filter.rsp.filter_id; + } out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -113,144 +111,138 @@\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_del_PID_filter (as10x_handle_t * phandle, +int as10x_cmd_del_PID_filter (as10x_handle_t *phandle,uint16_t pid_value) { +int error; +struct as10x_cmd_t *pcmd, *prsp; -int error; -struct as10x_cmd_t *pcmd, *prsp; +ENTER (); -ENTER (); + pcmd = phandle->cmd; + prsp = phandle->rsp; - pcmd = phandle->cmd; - prsp = phandle->rsp; +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.del_pid_filter.req)); -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.del_pid_filter.req)); +/* fill command */ + pcmd->body.del_pid_filter.req.proc_id = +cpu_to_le16 (CONTROL_PROC_REMOVEFILTER ); + pcmd->body.del_pid_filter.req.pid =cpu_to_le16 (pid_value); -/* fill command */ - pcmd->body.del_pid_filter.req.proc_id =cpu_to_le16 (CONTROL_PROC_REMOVEFILTER ); - pcmd->body.del_pid_filter.req.pid =cpu_to_le16 (pid_value); +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.del_pid_filter.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.del_pid_filter.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.del_pid_filter.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.del_pid_filter.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +if (error <0 ) + goto out; -if (error <0 ) { - goto out; - } - -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_REMOVEFILTER_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_REMOVEFILTER_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/** \brief Send start streaming command to AS10x \param phandle: pointer to AS10x handle -\return 0 when no error, < 0 in case of error. +\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_start_streaming (as10x_handle_t * phandle) +int as10x_cmd_start_streaming (as10x_handle_t *phandle) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.start_streaming.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.start_streaming.req)); -/* fill command */ - pcmd->body.start_streaming.req.proc_id = -cpu_to_le16 (CONTROL_PROC_START_STREAMING ); +/* fill command */ + pcmd->body.start_streaming.req.proc_id = +cpu_to_le16 (CONTROL_PROC_START_STREAMING ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.start_streaming.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.start_streaming.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.start_streaming.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.start_streaming.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_START_STREAMING_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_START_STREAMING_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/** \brief Send stop streaming command to AS10x \param phandle: pointer to AS10x handle -\return 0 when no error, < 0 in case of error. +\return 0 when no error, < 0 in case of error. \callgraph */ -int as10x_cmd_stop_streaming (as10x_handle_t * phandle) +int as10x_cmd_stop_streaming (as10x_handle_t *phandle) { -int8_t error; -struct as10x_cmd_t *pcmd, *prsp; +int8_t error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.stop_streaming.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.stop_streaming.req)); -/* fill command */ - pcmd->body.stop_streaming.req.proc_id = -cpu_to_le16 (CONTROL_PROC_STOP_STREAMING ); +/* fill command */ + pcmd->body.stop_streaming.req.proc_id = +cpu_to_le16 (CONTROL_PROC_STOP_STREAMING ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.stop_streaming.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.stop_streaming.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.stop_streaming.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.stop_streaming.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_STOP_STREAMING_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_STOP_STREAMING_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }
PATCH 6/14 staging/media/as102: checkpatch fixes
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318799 18000
# Node ID 5916edd6739e9b8e02ff8a1e93161c4d23b50b3e # Parent 1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_fe.c.
Priority: normal
drivers/staging/media/as102/as102_fe.c +252 -224
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -31,12 +32,14 @@static void as102_fe_copy_tune_parameters (struct as10x_tune_args *dst,struct dvb_frontend_parameters *src); -static void as102_fe_release (struct dvb_frontend *fe) { +static void as102_fe_release (struct dvb_frontend *fe) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return ;#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))
@@ -64,13 +67,15 @@ }#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 )) -static int as102_fe_init (struct dvb_frontend *fe) { +static int as102_fe_init (struct dvb_frontend *fe) +{int ret =0 ;struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -90,14 +95,16 @@#endif static int as102_fe_set_frontend (struct dvb_frontend *fe, -struct dvb_frontend_parameters *params) { +struct dvb_frontend_parameters *params) +{int ret =0 ;struct as102_dev_t *dev;struct as10x_tune_args tune_args = {0 };ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -107,9 +114,8 @@/* send abilis command: SET_TUNE */ ret =as10x_cmd_set_tune (&dev->bus_adap, &tune_args); -if (ret !=0 ) { +if (ret !=0 )dprintk (debug,"as10x_cmd_set_tune failed. (err = %d)\n" , ret); - }mutex_unlock (&dev->bus_adap.lock);
@@ -117,7 +123,7 @@return (ret <0 ) ? -EINVAL :0 ; } -static int as102_fe_get_frontend (struct dvb_frontend * fe, +static int as102_fe_get_frontend (struct dvb_frontend *fe,struct dvb_frontend_parameters *p) {int ret =0 ;struct as102_dev_t *dev;
@@ -125,7 +131,8 @@ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -EINVAL ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -150,7 +157,8 @@#if 0 dprintk (debug,"step_size = %d\n" , settings->step_size);dprintk (debug,"max_drift = %d\n" , settings->max_drift); -dprintk (debug,"min_delay_ms = %d -> %d\n" , settings->min_delay_ms,1000 ); +dprintk (debug,"min_delay_ms = %d -> %d\n" , settings->min_delay_ms, +1000 );#endif settings->min_delay_ms =1000 ;
@@ -160,14 +168,16 @@ } -static int as102_fe_read_status (struct dvb_frontend *fe,fe_status_t *status) { +static int as102_fe_read_status (struct dvb_frontend *fe,fe_status_t *status) +{int ret =0 ;struct as102_dev_t *dev;struct as10x_tune_status tstate = {0 };ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -176,48 +186,47 @@/* send abilis command: GET_TUNE_STATUS */ ret =as10x_cmd_get_tune_status (&dev->bus_adap, &tstate);if (ret <0 ) { -dprintk (debug,"as10x_cmd_get_tune_status failed (err = %d)\n" , ret); +dprintk (debug,"as10x_cmd_get_tune_status failed (err = %d)\n" , + ret); goto out; } dev->signal_strength = tstate.signal_strength; dev->ber = tstate.BER; -switch (tstate.tune_state) { -case TUNE_STATUS_SIGNAL_DVB_OK : - *status =FE_HAS_SIGNAL | -FE_HAS_CARRIER ; -break ; -case TUNE_STATUS_STREAM_DETECTED : - *status =FE_HAS_SIGNAL | -FE_HAS_CARRIER | -FE_HAS_SYNC ; -break ; -case TUNE_STATUS_STREAM_TUNED : - *status =FE_HAS_SIGNAL | -FE_HAS_CARRIER | -FE_HAS_SYNC | -FE_HAS_LOCK ; -break ; -default : - *status =TUNE_STATUS_NOT_TUNED ; +switch (tstate.tune_state) { +case TUNE_STATUS_SIGNAL_DVB_OK : + *status =FE_HAS_SIGNAL |FE_HAS_CARRIER ; +break ; +case TUNE_STATUS_STREAM_DETECTED : + *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_SYNC ; +break ; +case TUNE_STATUS_STREAM_TUNED : + *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_SYNC | +FE_HAS_LOCK ; +break ; +default : + *status =TUNE_STATUS_NOT_TUNED ; } -dprintk (debug,"tuner status: 0x%02x , strength %d , per: %d , ber: %d\n" , +dprintk (debug,"tuner status: 0x%02x, strength %d, per: %d, ber: %d\n" , tstate.tune_state, tstate.signal_strength, tstate.PER, tstate.BER);if (*status &FE_HAS_LOCK ) {if (as10x_cmd_get_demod_stats (&dev->bus_adap, - (struct as10x_demod_stats *) &dev->demod_stats) <0 ) { + (struct as10x_demod_stats *) &dev->demod_stats) <0 ) {memset (&dev->demod_stats,0 ,sizeof (dev->demod_stats)); -dprintk (debug,"as10x_cmd_get_demod_stats failed (probably not tuned)\n" ); +dprintk (debug,"as10x_cmd_get_demod_stats failed " +"(probably not tuned)\n" ); }else { -dprintk (debug,"demod status: fc: 0x%08x , bad fc: 0x%08x , bytes corrected: 0x%08x , MER: 0x%04x\n" , - dev->demod_stats.frame_count, - dev->demod_stats.bad_frame_count, - dev->demod_stats.bytes_fixed_by_rs, - dev->demod_stats.mer); +dprintk (debug, +"demod status: fc: 0x%08x, bad fc: 0x%08x, " +"bytes corrected: 0x%08x , MER: 0x%04x\n" , + dev->demod_stats.frame_count, + dev->demod_stats.bad_frame_count, + dev->demod_stats.bytes_fixed_by_rs, + dev->demod_stats.mer); } }else {memset (&dev->demod_stats,0 ,sizeof (dev->demod_stats));
@@ -236,12 +245,14 @@* - the accuracy equals ±2dB for a SNR range from 4dB to 30dB * - the accuracy is >2dB for SNR values outside this range */ -static int as102_fe_read_snr (struct dvb_frontend * fe,u16 * snr) { +static int as102_fe_read_snr (struct dvb_frontend *fe,u16 *snr) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ; *snr = dev->demod_stats.mer;
@@ -250,12 +261,14 @@return 0 ; } -static int as102_fe_read_ber (struct dvb_frontend * fe,u32 * ber) { +static int as102_fe_read_ber (struct dvb_frontend *fe,u32 *ber) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ; *ber = dev->ber;
@@ -264,12 +277,15 @@return 0 ; } -static int as102_fe_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { +static int as102_fe_read_signal_strength (struct dvb_frontend *fe, +u16 *strength) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ; *strength = (((0xffff *400 ) * dev->signal_strength +41000 ) *2 );
@@ -278,12 +294,14 @@return 0 ; } -static int as102_fe_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { +static int as102_fe_read_ucblocks (struct dvb_frontend *fe,u32 *ucblocks) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (dev->demod_stats.has_started)
@@ -296,13 +314,15 @@ }#if (LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,19 )) -static int as102_fe_ts_bus_ctrl (struct dvb_frontend * fe,int acquire) { +static int as102_fe_ts_bus_ctrl (struct dvb_frontend *fe,int acquire) +{struct as102_dev_t *dev;int ret;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -362,8 +382,8 @@#endif }; -int as102_dvb_unregister_fe (struct dvb_frontend *fe) { - +int as102_dvb_unregister_fe (struct dvb_frontend *fe) +{/* unregister frontend */ dvb_unregister_frontend (fe);
@@ -374,11 +394,13 @@return 0 ; } -int as102_dvb_register_fe (struct as102_dev_t *as102_dev,struct dvb_frontend *dvb_fe) { +int as102_dvb_register_fe (struct as102_dev_t *as102_dev, +struct dvb_frontend *dvb_fe) +{int errno;struct dvb_adapter *dvb_adap; -if (as102_dev ==NULL ) +if (as102_dev ==NULL )return -EINVAL ;/* extract dvb_adapter */
@@ -389,140 +411,143 @@/* register dbvb frontend */ errno =dvb_register_frontend (dvb_adap, dvb_fe); -if (errno ==0 ) +if (errno ==0 ) dvb_fe->tuner_priv = as102_dev;return errno; }static void as10x_fe_copy_tps_parameters (struct dvb_frontend_parameters *dst, -struct as10x_tps *as10x_tps) { +struct as10x_tps *as10x_tps) +{struct dvb_ofdm_parameters *fe_tps = &dst->u.ofdm;/* extract consteallation */ -switch (as10x_tps->constellation) { -case CONST_QPSK : - fe_tps->constellation =QPSK ; -break ; -case CONST_QAM16 : - fe_tps->constellation =QAM_16 ; -break ; -case CONST_QAM64 : - fe_tps->constellation =QAM_64 ; -break ; +switch (as10x_tps->constellation) { +case CONST_QPSK : + fe_tps->constellation =QPSK ; +break ; +case CONST_QAM16 : + fe_tps->constellation =QAM_16 ; +break ; +case CONST_QAM64 : + fe_tps->constellation =QAM_64 ; +break ; }/* extract hierarchy */ -switch (as10x_tps->hierarchy) { -case HIER_NONE : - fe_tps->hierarchy_information =HIERARCHY_NONE ; -break ; -case HIER_ALPHA_1 : - fe_tps->hierarchy_information =HIERARCHY_1 ; -break ; -case HIER_ALPHA_2 : - fe_tps->hierarchy_information =HIERARCHY_2 ; -break ; -case HIER_ALPHA_4 : - fe_tps->hierarchy_information =HIERARCHY_4 ; -break ; +switch (as10x_tps->hierarchy) { +case HIER_NONE : + fe_tps->hierarchy_information =HIERARCHY_NONE ; +break ; +case HIER_ALPHA_1 : + fe_tps->hierarchy_information =HIERARCHY_1 ; +break ; +case HIER_ALPHA_2 : + fe_tps->hierarchy_information =HIERARCHY_2 ; +break ; +case HIER_ALPHA_4 : + fe_tps->hierarchy_information =HIERARCHY_4 ; +break ; }/* extract code rate HP */ -switch (as10x_tps->code_rate_HP) { -case CODE_RATE_1_2 : - fe_tps->code_rate_HP =FEC_1_2 ; -break ; -case CODE_RATE_2_3 : - fe_tps->code_rate_HP =FEC_2_3 ; -break ; -case CODE_RATE_3_4 : - fe_tps->code_rate_HP =FEC_3_4 ; -break ; -case CODE_RATE_5_6 : - fe_tps->code_rate_HP =FEC_5_6 ; -break ; -case CODE_RATE_7_8 : - fe_tps->code_rate_HP =FEC_7_8 ; -break ; +switch (as10x_tps->code_rate_HP) { +case CODE_RATE_1_2 : + fe_tps->code_rate_HP =FEC_1_2 ; +break ; +case CODE_RATE_2_3 : + fe_tps->code_rate_HP =FEC_2_3 ; +break ; +case CODE_RATE_3_4 : + fe_tps->code_rate_HP =FEC_3_4 ; +break ; +case CODE_RATE_5_6 : + fe_tps->code_rate_HP =FEC_5_6 ; +break ; +case CODE_RATE_7_8 : + fe_tps->code_rate_HP =FEC_7_8 ; +break ; }/* extract code rate LP */ -switch (as10x_tps->code_rate_LP) { -case CODE_RATE_1_2 : - fe_tps->code_rate_LP =FEC_1_2 ; -break ; -case CODE_RATE_2_3 : - fe_tps->code_rate_LP =FEC_2_3 ; -break ; -case CODE_RATE_3_4 : - fe_tps->code_rate_LP =FEC_3_4 ; -break ; -case CODE_RATE_5_6 : - fe_tps->code_rate_LP =FEC_5_6 ; -break ; -case CODE_RATE_7_8 : - fe_tps->code_rate_LP =FEC_7_8 ; -break ; +switch (as10x_tps->code_rate_LP) { +case CODE_RATE_1_2 : + fe_tps->code_rate_LP =FEC_1_2 ; +break ; +case CODE_RATE_2_3 : + fe_tps->code_rate_LP =FEC_2_3 ; +break ; +case CODE_RATE_3_4 : + fe_tps->code_rate_LP =FEC_3_4 ; +break ; +case CODE_RATE_5_6 : + fe_tps->code_rate_LP =FEC_5_6 ; +break ; +case CODE_RATE_7_8 : + fe_tps->code_rate_LP =FEC_7_8 ; +break ; }/* extract guard interval */ -switch (as10x_tps->guard_interval) { -case GUARD_INT_1_32 : - fe_tps->guard_interval =GUARD_INTERVAL_1_32 ; -break ; -case GUARD_INT_1_16 : - fe_tps->guard_interval =GUARD_INTERVAL_1_16 ; -break ; -case GUARD_INT_1_8 : - fe_tps->guard_interval =GUARD_INTERVAL_1_8 ; -break ; -case GUARD_INT_1_4 : - fe_tps->guard_interval =GUARD_INTERVAL_1_4 ; -break ; +switch (as10x_tps->guard_interval) { +case GUARD_INT_1_32 : + fe_tps->guard_interval =GUARD_INTERVAL_1_32 ; +break ; +case GUARD_INT_1_16 : + fe_tps->guard_interval =GUARD_INTERVAL_1_16 ; +break ; +case GUARD_INT_1_8 : + fe_tps->guard_interval =GUARD_INTERVAL_1_8 ; +break ; +case GUARD_INT_1_4 : + fe_tps->guard_interval =GUARD_INTERVAL_1_4 ; +break ; }/* extract transmission mode */ -switch (as10x_tps->transmission_mode) { -case TRANS_MODE_2K : - fe_tps->transmission_mode =TRANSMISSION_MODE_2K ; -break ; -case TRANS_MODE_8K : - fe_tps->transmission_mode =TRANSMISSION_MODE_8K ; -break ; +switch (as10x_tps->transmission_mode) { +case TRANS_MODE_2K : + fe_tps->transmission_mode =TRANSMISSION_MODE_2K ; +break ; +case TRANS_MODE_8K : + fe_tps->transmission_mode =TRANSMISSION_MODE_8K ; +break ; } } -static uint8_t as102_fe_get_code_rate (fe_code_rate_t arg) { +static uint8_t as102_fe_get_code_rate (fe_code_rate_t arg) +{uint8_t c; -switch (arg) { -case FEC_1_2 : - c =CODE_RATE_1_2 ; -break ; -case FEC_2_3 : - c =CODE_RATE_2_3 ; -break ; -case FEC_3_4 : - c =CODE_RATE_3_4 ; -break ; -case FEC_5_6 : - c =CODE_RATE_5_6 ; -break ; -case FEC_7_8 : - c =CODE_RATE_7_8 ; -break ; -default : - c =CODE_RATE_UNKNOWN ; -break ; +switch (arg) { +case FEC_1_2 : + c =CODE_RATE_1_2 ; +break ; +case FEC_2_3 : + c =CODE_RATE_2_3 ; +break ; +case FEC_3_4 : + c =CODE_RATE_3_4 ; +break ; +case FEC_5_6 : + c =CODE_RATE_5_6 ; +break ; +case FEC_7_8 : + c =CODE_RATE_7_8 ; +break ; +default : + c =CODE_RATE_UNKNOWN ; +break ; }return c; }static void as102_fe_copy_tune_parameters (struct as10x_tune_args *tune_args, -struct dvb_frontend_parameters *params) { +struct dvb_frontend_parameters *params) +{/* set frequency */ tune_args->freq = params->frequency /1000 ;
@@ -530,81 +555,81 @@/* fix interleaving_mode */ tune_args->interleaving_mode =INTLV_NATIVE ; -switch (params->u.ofdm.bandwidth) { -case BANDWIDTH_8_MHZ : - tune_args->bandwidth =BW_8_MHZ ; -break ; -case BANDWIDTH_7_MHZ : - tune_args->bandwidth =BW_7_MHZ ; -break ; -case BANDWIDTH_6_MHZ : - tune_args->bandwidth =BW_6_MHZ ; -break ; -default : - tune_args->bandwidth =BW_8_MHZ ; +switch (params->u.ofdm.bandwidth) { +case BANDWIDTH_8_MHZ : + tune_args->bandwidth =BW_8_MHZ ; +break ; +case BANDWIDTH_7_MHZ : + tune_args->bandwidth =BW_7_MHZ ; +break ; +case BANDWIDTH_6_MHZ : + tune_args->bandwidth =BW_6_MHZ ; +break ; +default : + tune_args->bandwidth =BW_8_MHZ ; } -switch (params->u.ofdm.guard_interval) { -case GUARD_INTERVAL_1_32 : - tune_args->guard_interval =GUARD_INT_1_32 ; -break ; -case GUARD_INTERVAL_1_16 : - tune_args->guard_interval =GUARD_INT_1_16 ; -break ; -case GUARD_INTERVAL_1_8 : - tune_args->guard_interval =GUARD_INT_1_8 ; -break ; -case GUARD_INTERVAL_1_4 : - tune_args->guard_interval =GUARD_INT_1_4 ; -break ; -case GUARD_INTERVAL_AUTO : -default : - tune_args->guard_interval =GUARD_UNKNOWN ; -break ; +switch (params->u.ofdm.guard_interval) { +case GUARD_INTERVAL_1_32 : + tune_args->guard_interval =GUARD_INT_1_32 ; +break ; +case GUARD_INTERVAL_1_16 : + tune_args->guard_interval =GUARD_INT_1_16 ; +break ; +case GUARD_INTERVAL_1_8 : + tune_args->guard_interval =GUARD_INT_1_8 ; +break ; +case GUARD_INTERVAL_1_4 : + tune_args->guard_interval =GUARD_INT_1_4 ; +break ; +case GUARD_INTERVAL_AUTO : +default : + tune_args->guard_interval =GUARD_UNKNOWN ; +break ; } -switch (params->u.ofdm.constellation) { -case QPSK : - tune_args->constellation =CONST_QPSK ; -break ; -case QAM_16 : - tune_args->constellation =CONST_QAM16 ; -break ; -case QAM_64 : - tune_args->constellation =CONST_QAM64 ; -break ; -default : - tune_args->constellation =CONST_UNKNOWN ; -break ; +switch (params->u.ofdm.constellation) { +case QPSK : + tune_args->constellation =CONST_QPSK ; +break ; +case QAM_16 : + tune_args->constellation =CONST_QAM16 ; +break ; +case QAM_64 : + tune_args->constellation =CONST_QAM64 ; +break ; +default : + tune_args->constellation =CONST_UNKNOWN ; +break ; } -switch (params->u.ofdm.transmission_mode) { -case TRANSMISSION_MODE_2K : - tune_args->transmission_mode =TRANS_MODE_2K ; -break ; -case TRANSMISSION_MODE_8K : - tune_args->transmission_mode =TRANS_MODE_8K ; -break ; -default : - tune_args->transmission_mode =TRANS_MODE_UNKNOWN ; +switch (params->u.ofdm.transmission_mode) { +case TRANSMISSION_MODE_2K : + tune_args->transmission_mode =TRANS_MODE_2K ; +break ; +case TRANSMISSION_MODE_8K : + tune_args->transmission_mode =TRANS_MODE_8K ; +break ; +default : + tune_args->transmission_mode =TRANS_MODE_UNKNOWN ; } -switch (params->u.ofdm.hierarchy_information) { -case HIERARCHY_NONE : - tune_args->hierarchy =HIER_NONE ; -break ; -case HIERARCHY_1 : - tune_args->hierarchy =HIER_ALPHA_1 ; -break ; -case HIERARCHY_2 : - tune_args->hierarchy =HIER_ALPHA_2 ; -break ; -case HIERARCHY_4 : - tune_args->hierarchy =HIER_ALPHA_4 ; -break ; -case HIERARCHY_AUTO : - tune_args->hierarchy =HIER_UNKNOWN ; -break ; +switch (params->u.ofdm.hierarchy_information) { +case HIERARCHY_NONE : + tune_args->hierarchy =HIER_NONE ; +break ; +case HIERARCHY_1 : + tune_args->hierarchy =HIER_ALPHA_1 ; +break ; +case HIERARCHY_2 : + tune_args->hierarchy =HIER_ALPHA_2 ; +break ; +case HIERARCHY_4 : + tune_args->hierarchy =HIER_ALPHA_4 ; +break ; +case HIERARCHY_AUTO : + tune_args->hierarchy =HIER_UNKNOWN ; +break ; } dprintk(debug, "tuner parameters: freq: %d bw: 0x%02x gi: 0x%02x\n",
@@ -623,23 +648,26 @@if (params->u.ofdm.code_rate_LP ==FEC_NONE ) { tune_args->hier_select =HIER_HIGH_PRIORITY ; tune_args->code_rate = -as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); +as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); }if (params->u.ofdm.code_rate_HP ==FEC_NONE ) { tune_args->hier_select =HIER_LOW_PRIORITY ; tune_args->code_rate = -as102_fe_get_code_rate (params->u.ofdm.code_rate_LP); +as102_fe_get_code_rate (params->u.ofdm.code_rate_LP); }dprintk (debug,"\thierarchy: 0x%02x " "selected: %s code_rate_%s: 0x%02x\n" , tune_args->hierarchy, - tune_args->hier_select ==HIER_HIGH_PRIORITY ?"HP" :"LP" , - tune_args->hier_select ==HIER_HIGH_PRIORITY ?"HP" :"LP" , + tune_args->hier_select ==HIER_HIGH_PRIORITY ? +"HP" :"LP" , + tune_args->hier_select ==HIER_HIGH_PRIORITY ? +"HP" :"LP" , tune_args->code_rate); }else { - tune_args->code_rate =as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); + tune_args->code_rate = +as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); } }#endif
PATCH RESEND 6/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318799 18000
# Node ID 5916edd6739e9b8e02ff8a1e93161c4d23b50b3e # Parent 1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_fe.c.
Priority: normal
drivers/staging/media/as102/as102_fe.c +252 -224
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -31,12 +32,14 @@static void as102_fe_copy_tune_parameters (struct as10x_tune_args *dst,struct dvb_frontend_parameters *src); -static void as102_fe_release (struct dvb_frontend *fe) { +static void as102_fe_release (struct dvb_frontend *fe) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return ;#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))
@@ -64,13 +67,15 @@ }#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 )) -static int as102_fe_init (struct dvb_frontend *fe) { +static int as102_fe_init (struct dvb_frontend *fe) +{int ret =0 ;struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -90,14 +95,16 @@#endif static int as102_fe_set_frontend (struct dvb_frontend *fe, -struct dvb_frontend_parameters *params) { +struct dvb_frontend_parameters *params) +{int ret =0 ;struct as102_dev_t *dev;struct as10x_tune_args tune_args = {0 };ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -107,9 +114,8 @@/* send abilis command: SET_TUNE */ ret =as10x_cmd_set_tune (&dev->bus_adap, &tune_args); -if (ret !=0 ) { +if (ret !=0 )dprintk (debug,"as10x_cmd_set_tune failed. (err = %d)\n" , ret); - }mutex_unlock (&dev->bus_adap.lock);
@@ -117,7 +123,7 @@return (ret <0 ) ? -EINVAL :0 ; } -static int as102_fe_get_frontend (struct dvb_frontend * fe, +static int as102_fe_get_frontend (struct dvb_frontend *fe,struct dvb_frontend_parameters *p) {int ret =0 ;struct as102_dev_t *dev;
@@ -125,7 +131,8 @@ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -EINVAL ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -150,7 +157,8 @@#if 0 dprintk (debug,"step_size = %d\n" , settings->step_size);dprintk (debug,"max_drift = %d\n" , settings->max_drift); -dprintk (debug,"min_delay_ms = %d -> %d\n" , settings->min_delay_ms,1000 ); +dprintk (debug,"min_delay_ms = %d -> %d\n" , settings->min_delay_ms, +1000 );#endif settings->min_delay_ms =1000 ;
@@ -160,14 +168,16 @@ } -static int as102_fe_read_status (struct dvb_frontend *fe,fe_status_t *status) { +static int as102_fe_read_status (struct dvb_frontend *fe,fe_status_t *status) +{int ret =0 ;struct as102_dev_t *dev;struct as10x_tune_status tstate = {0 };ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -176,48 +186,47 @@/* send abilis command: GET_TUNE_STATUS */ ret =as10x_cmd_get_tune_status (&dev->bus_adap, &tstate);if (ret <0 ) { -dprintk (debug,"as10x_cmd_get_tune_status failed (err = %d)\n" , ret); +dprintk (debug,"as10x_cmd_get_tune_status failed (err = %d)\n" , + ret); goto out; } dev->signal_strength = tstate.signal_strength; dev->ber = tstate.BER; -switch (tstate.tune_state) { -case TUNE_STATUS_SIGNAL_DVB_OK : - *status =FE_HAS_SIGNAL | -FE_HAS_CARRIER ; -break ; -case TUNE_STATUS_STREAM_DETECTED : - *status =FE_HAS_SIGNAL | -FE_HAS_CARRIER | -FE_HAS_SYNC ; -break ; -case TUNE_STATUS_STREAM_TUNED : - *status =FE_HAS_SIGNAL | -FE_HAS_CARRIER | -FE_HAS_SYNC | -FE_HAS_LOCK ; -break ; -default : - *status =TUNE_STATUS_NOT_TUNED ; +switch (tstate.tune_state) { +case TUNE_STATUS_SIGNAL_DVB_OK : + *status =FE_HAS_SIGNAL |FE_HAS_CARRIER ; +break ; +case TUNE_STATUS_STREAM_DETECTED : + *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_SYNC ; +break ; +case TUNE_STATUS_STREAM_TUNED : + *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_SYNC | +FE_HAS_LOCK ; +break ; +default : + *status =TUNE_STATUS_NOT_TUNED ; } -dprintk (debug,"tuner status: 0x%02x , strength %d , per: %d , ber: %d\n" , +dprintk (debug,"tuner status: 0x%02x, strength %d, per: %d, ber: %d\n" , tstate.tune_state, tstate.signal_strength, tstate.PER, tstate.BER);if (*status &FE_HAS_LOCK ) {if (as10x_cmd_get_demod_stats (&dev->bus_adap, - (struct as10x_demod_stats *) &dev->demod_stats) <0 ) { + (struct as10x_demod_stats *) &dev->demod_stats) <0 ) {memset (&dev->demod_stats,0 ,sizeof (dev->demod_stats)); -dprintk (debug,"as10x_cmd_get_demod_stats failed (probably not tuned)\n" ); +dprintk (debug,"as10x_cmd_get_demod_stats failed " +"(probably not tuned)\n" ); }else { -dprintk (debug,"demod status: fc: 0x%08x , bad fc: 0x%08x , bytes corrected: 0x%08x , MER: 0x%04x\n" , - dev->demod_stats.frame_count, - dev->demod_stats.bad_frame_count, - dev->demod_stats.bytes_fixed_by_rs, - dev->demod_stats.mer); +dprintk (debug, +"demod status: fc: 0x%08x, bad fc: 0x%08x, " +"bytes corrected: 0x%08x , MER: 0x%04x\n" , + dev->demod_stats.frame_count, + dev->demod_stats.bad_frame_count, + dev->demod_stats.bytes_fixed_by_rs, + dev->demod_stats.mer); } }else {memset (&dev->demod_stats,0 ,sizeof (dev->demod_stats));
@@ -236,12 +245,14 @@* - the accuracy equals ±2dB for a SNR range from 4dB to 30dB * - the accuracy is >2dB for SNR values outside this range */ -static int as102_fe_read_snr (struct dvb_frontend * fe,u16 * snr) { +static int as102_fe_read_snr (struct dvb_frontend *fe,u16 *snr) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ; *snr = dev->demod_stats.mer;
@@ -250,12 +261,14 @@return 0 ; } -static int as102_fe_read_ber (struct dvb_frontend * fe,u32 * ber) { +static int as102_fe_read_ber (struct dvb_frontend *fe,u32 *ber) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ; *ber = dev->ber;
@@ -264,12 +277,15 @@return 0 ; } -static int as102_fe_read_signal_strength (struct dvb_frontend * fe,u16 * strength) { +static int as102_fe_read_signal_strength (struct dvb_frontend *fe, +u16 *strength) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ; *strength = (((0xffff *400 ) * dev->signal_strength +41000 ) *2 );
@@ -278,12 +294,14 @@return 0 ; } -static int as102_fe_read_ucblocks (struct dvb_frontend * fe,u32 * ucblocks) { +static int as102_fe_read_ucblocks (struct dvb_frontend *fe,u32 *ucblocks) +{struct as102_dev_t *dev;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (dev->demod_stats.has_started)
@@ -296,13 +314,15 @@ }#if (LINUX_VERSION_CODE >=KERNEL_VERSION (2 ,6 ,19 )) -static int as102_fe_ts_bus_ctrl (struct dvb_frontend * fe,int acquire) { +static int as102_fe_ts_bus_ctrl (struct dvb_frontend *fe,int acquire) +{struct as102_dev_t *dev;int ret;ENTER (); -if ((dev = (struct as102_dev_t *) fe->tuner_priv) ==NULL ) + dev = (struct as102_dev_t *) fe->tuner_priv; +if (dev ==NULL )return -ENODEV ;if (mutex_lock_interruptible (&dev->bus_adap.lock))
@@ -362,8 +382,8 @@#endif }; -int as102_dvb_unregister_fe (struct dvb_frontend *fe) { - +int as102_dvb_unregister_fe (struct dvb_frontend *fe) +{/* unregister frontend */ dvb_unregister_frontend (fe);
@@ -374,11 +394,13 @@return 0 ; } -int as102_dvb_register_fe (struct as102_dev_t *as102_dev,struct dvb_frontend *dvb_fe) { +int as102_dvb_register_fe (struct as102_dev_t *as102_dev, +struct dvb_frontend *dvb_fe) +{int errno;struct dvb_adapter *dvb_adap; -if (as102_dev ==NULL ) +if (as102_dev ==NULL )return -EINVAL ;/* extract dvb_adapter */
@@ -389,140 +411,143 @@/* register dbvb frontend */ errno =dvb_register_frontend (dvb_adap, dvb_fe); -if (errno ==0 ) +if (errno ==0 ) dvb_fe->tuner_priv = as102_dev;return errno; }static void as10x_fe_copy_tps_parameters (struct dvb_frontend_parameters *dst, -struct as10x_tps *as10x_tps) { +struct as10x_tps *as10x_tps) +{struct dvb_ofdm_parameters *fe_tps = &dst->u.ofdm;/* extract consteallation */ -switch (as10x_tps->constellation) { -case CONST_QPSK : - fe_tps->constellation =QPSK ; -break ; -case CONST_QAM16 : - fe_tps->constellation =QAM_16 ; -break ; -case CONST_QAM64 : - fe_tps->constellation =QAM_64 ; -break ; +switch (as10x_tps->constellation) { +case CONST_QPSK : + fe_tps->constellation =QPSK ; +break ; +case CONST_QAM16 : + fe_tps->constellation =QAM_16 ; +break ; +case CONST_QAM64 : + fe_tps->constellation =QAM_64 ; +break ; }/* extract hierarchy */ -switch (as10x_tps->hierarchy) { -case HIER_NONE : - fe_tps->hierarchy_information =HIERARCHY_NONE ; -break ; -case HIER_ALPHA_1 : - fe_tps->hierarchy_information =HIERARCHY_1 ; -break ; -case HIER_ALPHA_2 : - fe_tps->hierarchy_information =HIERARCHY_2 ; -break ; -case HIER_ALPHA_4 : - fe_tps->hierarchy_information =HIERARCHY_4 ; -break ; +switch (as10x_tps->hierarchy) { +case HIER_NONE : + fe_tps->hierarchy_information =HIERARCHY_NONE ; +break ; +case HIER_ALPHA_1 : + fe_tps->hierarchy_information =HIERARCHY_1 ; +break ; +case HIER_ALPHA_2 : + fe_tps->hierarchy_information =HIERARCHY_2 ; +break ; +case HIER_ALPHA_4 : + fe_tps->hierarchy_information =HIERARCHY_4 ; +break ; }/* extract code rate HP */ -switch (as10x_tps->code_rate_HP) { -case CODE_RATE_1_2 : - fe_tps->code_rate_HP =FEC_1_2 ; -break ; -case CODE_RATE_2_3 : - fe_tps->code_rate_HP =FEC_2_3 ; -break ; -case CODE_RATE_3_4 : - fe_tps->code_rate_HP =FEC_3_4 ; -break ; -case CODE_RATE_5_6 : - fe_tps->code_rate_HP =FEC_5_6 ; -break ; -case CODE_RATE_7_8 : - fe_tps->code_rate_HP =FEC_7_8 ; -break ; +switch (as10x_tps->code_rate_HP) { +case CODE_RATE_1_2 : + fe_tps->code_rate_HP =FEC_1_2 ; +break ; +case CODE_RATE_2_3 : + fe_tps->code_rate_HP =FEC_2_3 ; +break ; +case CODE_RATE_3_4 : + fe_tps->code_rate_HP =FEC_3_4 ; +break ; +case CODE_RATE_5_6 : + fe_tps->code_rate_HP =FEC_5_6 ; +break ; +case CODE_RATE_7_8 : + fe_tps->code_rate_HP =FEC_7_8 ; +break ; }/* extract code rate LP */ -switch (as10x_tps->code_rate_LP) { -case CODE_RATE_1_2 : - fe_tps->code_rate_LP =FEC_1_2 ; -break ; -case CODE_RATE_2_3 : - fe_tps->code_rate_LP =FEC_2_3 ; -break ; -case CODE_RATE_3_4 : - fe_tps->code_rate_LP =FEC_3_4 ; -break ; -case CODE_RATE_5_6 : - fe_tps->code_rate_LP =FEC_5_6 ; -break ; -case CODE_RATE_7_8 : - fe_tps->code_rate_LP =FEC_7_8 ; -break ; +switch (as10x_tps->code_rate_LP) { +case CODE_RATE_1_2 : + fe_tps->code_rate_LP =FEC_1_2 ; +break ; +case CODE_RATE_2_3 : + fe_tps->code_rate_LP =FEC_2_3 ; +break ; +case CODE_RATE_3_4 : + fe_tps->code_rate_LP =FEC_3_4 ; +break ; +case CODE_RATE_5_6 : + fe_tps->code_rate_LP =FEC_5_6 ; +break ; +case CODE_RATE_7_8 : + fe_tps->code_rate_LP =FEC_7_8 ; +break ; }/* extract guard interval */ -switch (as10x_tps->guard_interval) { -case GUARD_INT_1_32 : - fe_tps->guard_interval =GUARD_INTERVAL_1_32 ; -break ; -case GUARD_INT_1_16 : - fe_tps->guard_interval =GUARD_INTERVAL_1_16 ; -break ; -case GUARD_INT_1_8 : - fe_tps->guard_interval =GUARD_INTERVAL_1_8 ; -break ; -case GUARD_INT_1_4 : - fe_tps->guard_interval =GUARD_INTERVAL_1_4 ; -break ; +switch (as10x_tps->guard_interval) { +case GUARD_INT_1_32 : + fe_tps->guard_interval =GUARD_INTERVAL_1_32 ; +break ; +case GUARD_INT_1_16 : + fe_tps->guard_interval =GUARD_INTERVAL_1_16 ; +break ; +case GUARD_INT_1_8 : + fe_tps->guard_interval =GUARD_INTERVAL_1_8 ; +break ; +case GUARD_INT_1_4 : + fe_tps->guard_interval =GUARD_INTERVAL_1_4 ; +break ; }/* extract transmission mode */ -switch (as10x_tps->transmission_mode) { -case TRANS_MODE_2K : - fe_tps->transmission_mode =TRANSMISSION_MODE_2K ; -break ; -case TRANS_MODE_8K : - fe_tps->transmission_mode =TRANSMISSION_MODE_8K ; -break ; +switch (as10x_tps->transmission_mode) { +case TRANS_MODE_2K : + fe_tps->transmission_mode =TRANSMISSION_MODE_2K ; +break ; +case TRANS_MODE_8K : + fe_tps->transmission_mode =TRANSMISSION_MODE_8K ; +break ; } } -static uint8_t as102_fe_get_code_rate (fe_code_rate_t arg) { +static uint8_t as102_fe_get_code_rate (fe_code_rate_t arg) +{uint8_t c; -switch (arg) { -case FEC_1_2 : - c =CODE_RATE_1_2 ; -break ; -case FEC_2_3 : - c =CODE_RATE_2_3 ; -break ; -case FEC_3_4 : - c =CODE_RATE_3_4 ; -break ; -case FEC_5_6 : - c =CODE_RATE_5_6 ; -break ; -case FEC_7_8 : - c =CODE_RATE_7_8 ; -break ; -default : - c =CODE_RATE_UNKNOWN ; -break ; +switch (arg) { +case FEC_1_2 : + c =CODE_RATE_1_2 ; +break ; +case FEC_2_3 : + c =CODE_RATE_2_3 ; +break ; +case FEC_3_4 : + c =CODE_RATE_3_4 ; +break ; +case FEC_5_6 : + c =CODE_RATE_5_6 ; +break ; +case FEC_7_8 : + c =CODE_RATE_7_8 ; +break ; +default : + c =CODE_RATE_UNKNOWN ; +break ; }return c; }static void as102_fe_copy_tune_parameters (struct as10x_tune_args *tune_args, -struct dvb_frontend_parameters *params) { +struct dvb_frontend_parameters *params) +{/* set frequency */ tune_args->freq = params->frequency /1000 ;
@@ -530,81 +555,81 @@/* fix interleaving_mode */ tune_args->interleaving_mode =INTLV_NATIVE ; -switch (params->u.ofdm.bandwidth) { -case BANDWIDTH_8_MHZ : - tune_args->bandwidth =BW_8_MHZ ; -break ; -case BANDWIDTH_7_MHZ : - tune_args->bandwidth =BW_7_MHZ ; -break ; -case BANDWIDTH_6_MHZ : - tune_args->bandwidth =BW_6_MHZ ; -break ; -default : - tune_args->bandwidth =BW_8_MHZ ; +switch (params->u.ofdm.bandwidth) { +case BANDWIDTH_8_MHZ : + tune_args->bandwidth =BW_8_MHZ ; +break ; +case BANDWIDTH_7_MHZ : + tune_args->bandwidth =BW_7_MHZ ; +break ; +case BANDWIDTH_6_MHZ : + tune_args->bandwidth =BW_6_MHZ ; +break ; +default : + tune_args->bandwidth =BW_8_MHZ ; } -switch (params->u.ofdm.guard_interval) { -case GUARD_INTERVAL_1_32 : - tune_args->guard_interval =GUARD_INT_1_32 ; -break ; -case GUARD_INTERVAL_1_16 : - tune_args->guard_interval =GUARD_INT_1_16 ; -break ; -case GUARD_INTERVAL_1_8 : - tune_args->guard_interval =GUARD_INT_1_8 ; -break ; -case GUARD_INTERVAL_1_4 : - tune_args->guard_interval =GUARD_INT_1_4 ; -break ; -case GUARD_INTERVAL_AUTO : -default : - tune_args->guard_interval =GUARD_UNKNOWN ; -break ; +switch (params->u.ofdm.guard_interval) { +case GUARD_INTERVAL_1_32 : + tune_args->guard_interval =GUARD_INT_1_32 ; +break ; +case GUARD_INTERVAL_1_16 : + tune_args->guard_interval =GUARD_INT_1_16 ; +break ; +case GUARD_INTERVAL_1_8 : + tune_args->guard_interval =GUARD_INT_1_8 ; +break ; +case GUARD_INTERVAL_1_4 : + tune_args->guard_interval =GUARD_INT_1_4 ; +break ; +case GUARD_INTERVAL_AUTO : +default : + tune_args->guard_interval =GUARD_UNKNOWN ; +break ; } -switch (params->u.ofdm.constellation) { -case QPSK : - tune_args->constellation =CONST_QPSK ; -break ; -case QAM_16 : - tune_args->constellation =CONST_QAM16 ; -break ; -case QAM_64 : - tune_args->constellation =CONST_QAM64 ; -break ; -default : - tune_args->constellation =CONST_UNKNOWN ; -break ; +switch (params->u.ofdm.constellation) { +case QPSK : + tune_args->constellation =CONST_QPSK ; +break ; +case QAM_16 : + tune_args->constellation =CONST_QAM16 ; +break ; +case QAM_64 : + tune_args->constellation =CONST_QAM64 ; +break ; +default : + tune_args->constellation =CONST_UNKNOWN ; +break ; } -switch (params->u.ofdm.transmission_mode) { -case TRANSMISSION_MODE_2K : - tune_args->transmission_mode =TRANS_MODE_2K ; -break ; -case TRANSMISSION_MODE_8K : - tune_args->transmission_mode =TRANS_MODE_8K ; -break ; -default : - tune_args->transmission_mode =TRANS_MODE_UNKNOWN ; +switch (params->u.ofdm.transmission_mode) { +case TRANSMISSION_MODE_2K : + tune_args->transmission_mode =TRANS_MODE_2K ; +break ; +case TRANSMISSION_MODE_8K : + tune_args->transmission_mode =TRANS_MODE_8K ; +break ; +default : + tune_args->transmission_mode =TRANS_MODE_UNKNOWN ; } -switch (params->u.ofdm.hierarchy_information) { -case HIERARCHY_NONE : - tune_args->hierarchy =HIER_NONE ; -break ; -case HIERARCHY_1 : - tune_args->hierarchy =HIER_ALPHA_1 ; -break ; -case HIERARCHY_2 : - tune_args->hierarchy =HIER_ALPHA_2 ; -break ; -case HIERARCHY_4 : - tune_args->hierarchy =HIER_ALPHA_4 ; -break ; -case HIERARCHY_AUTO : - tune_args->hierarchy =HIER_UNKNOWN ; -break ; +switch (params->u.ofdm.hierarchy_information) { +case HIERARCHY_NONE : + tune_args->hierarchy =HIER_NONE ; +break ; +case HIERARCHY_1 : + tune_args->hierarchy =HIER_ALPHA_1 ; +break ; +case HIERARCHY_2 : + tune_args->hierarchy =HIER_ALPHA_2 ; +break ; +case HIERARCHY_4 : + tune_args->hierarchy =HIER_ALPHA_4 ; +break ; +case HIERARCHY_AUTO : + tune_args->hierarchy =HIER_UNKNOWN ; +break ; } dprintk(debug, "tuner parameters: freq: %d bw: 0x%02x gi: 0x%02x\n",
@@ -623,23 +648,26 @@if (params->u.ofdm.code_rate_LP ==FEC_NONE ) { tune_args->hier_select =HIER_HIGH_PRIORITY ; tune_args->code_rate = -as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); +as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); }if (params->u.ofdm.code_rate_HP ==FEC_NONE ) { tune_args->hier_select =HIER_LOW_PRIORITY ; tune_args->code_rate = -as102_fe_get_code_rate (params->u.ofdm.code_rate_LP); +as102_fe_get_code_rate (params->u.ofdm.code_rate_LP); }dprintk (debug,"\thierarchy: 0x%02x " "selected: %s code_rate_%s: 0x%02x\n" , tune_args->hierarchy, - tune_args->hier_select ==HIER_HIGH_PRIORITY ?"HP" :"LP" , - tune_args->hier_select ==HIER_HIGH_PRIORITY ?"HP" :"LP" , + tune_args->hier_select ==HIER_HIGH_PRIORITY ? +"HP" :"LP" , + tune_args->hier_select ==HIER_HIGH_PRIORITY ? +"HP" :"LP" , tune_args->code_rate); }else { - tune_args->code_rate =as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); + tune_args->code_rate = +as102_fe_get_code_rate (params->u.ofdm.code_rate_HP); } }#endif
PATCH 7/14 staging/media/as102: checkpatch fixes
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318867 18000
# Node ID 152825226bec049f947a844bea2c530fc9269ae5 # Parent 5916edd6739e9b8e02ff8a1e93161c4d23b50b3e
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_usb_drv.c.
Priority: normal
drivers/staging/media/as102/as102_usb_drv.c +71 -47
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -49,7 +50,7 @@ .id_table = as102_usb_id_table }; -struct file_operations as102_dev_fops = { +static const struct file_operations as102_dev_fops = { .owner =THIS_MODULE , .open = as102_open, .release = as102_release,
@@ -63,46 +64,48 @@static int as102_usb_xfer_cmd (struct as102_bus_adapter_t *bus_adap,unsigned char *send_buf,int send_buf_len, -unsigned char *recv_buf,int recv_buf_len) { - +unsigned char *recv_buf,int recv_buf_len) +{int ret =0 ;ENTER (); -if (send_buf !=NULL ) { +if (send_buf !=NULL ) { ret =usb_control_msg (bus_adap->usb_dev,usb_sndctrlpipe (bus_adap->usb_dev,0 ),AS102_USB_DEVICE_TX_CTRL_CMD , -USB_DIR_OUT |USB_TYPE_VENDOR |USB_RECIP_DEVICE , +USB_DIR_OUT |USB_TYPE_VENDOR | +USB_RECIP_DEVICE , bus_adap->cmd_xid,/* value */ 0 ,/* index */ send_buf, send_buf_len,USB_CTRL_SET_TIMEOUT /* 200 */ ); -if (ret <0 ) { +if (ret <0 ) {dprintk (debug,"usb_control_msg(send) failed, err %i\n" , ret);return ret; } -if (ret != send_buf_len) { +if (ret != send_buf_len) {dprintk (debug,"only wrote %d of %d bytes\n" , ret, send_buf_len);return -1 ; } } -if (recv_buf !=NULL ) { +if (recv_buf !=NULL ) {#ifdef TRACE dprintk (debug,"want to read: %d bytes\n" , recv_buf_len);#endif ret =usb_control_msg (bus_adap->usb_dev,usb_rcvctrlpipe (bus_adap->usb_dev,0 ),AS102_USB_DEVICE_RX_CTRL_CMD , -USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_DEVICE , +USB_DIR_IN |USB_TYPE_VENDOR | +USB_RECIP_DEVICE , bus_adap->cmd_xid,/* value */ 0 ,/* index */ recv_buf, recv_buf_len,USB_CTRL_GET_TIMEOUT /* 200 */ ); -if (ret <0 ) { +if (ret <0 ) {dprintk (debug,"usb_control_msg(recv) failed, err %i\n" , ret);return ret;
@@ -119,18 +122,19 @@static int as102_send_ep1 (struct as102_bus_adapter_t *bus_adap,unsigned char *send_buf,int send_buf_len, -int swap32) { - +int swap32) +{int ret =0 , actual_len; - ret =usb_bulk_msg (bus_adap->usb_dev,usb_sndbulkpipe (bus_adap->usb_dev,1 ), + ret =usb_bulk_msg (bus_adap->usb_dev, +usb_sndbulkpipe (bus_adap->usb_dev,1 ), send_buf, send_buf_len, &actual_len,200 ); -if (ret) { +if (ret) {dprintk (debug,"usb_bulk_msg(send) failed, err %i\n" , ret);return ret; } -if (actual_len != send_buf_len) { +if (actual_len != send_buf_len) {dprintk (debug,"only wrote %d of %d bytes\n" , actual_len, send_buf_len);return -1 ;
@@ -139,21 +143,22 @@ }static int as102_read_ep2 (struct as102_bus_adapter_t *bus_adap, -unsigned char *recv_buf,int recv_buf_len) { - +unsigned char *recv_buf,int recv_buf_len) +{int ret =0 , actual_len; -if (recv_buf ==NULL ) +if (recv_buf ==NULL )return -EINVAL ; - ret =usb_bulk_msg (bus_adap->usb_dev,usb_rcvbulkpipe (bus_adap->usb_dev,2 ), + ret =usb_bulk_msg (bus_adap->usb_dev, +usb_rcvbulkpipe (bus_adap->usb_dev,2 ), recv_buf, recv_buf_len, &actual_len,200 ); -if (ret) { +if (ret) {dprintk (debug,"usb_bulk_msg(recv) failed, err %i\n" , ret);return ret; } -if (actual_len != recv_buf_len) { +if (actual_len != recv_buf_len) {dprintk (debug,"only read %d of %d bytes\n" , actual_len, recv_buf_len);return -1 ;
@@ -169,7 +174,8 @@ .stop_stream = as102_usb_stop_stream, }; -static int as102_submit_urb_stream (struct as102_dev_t *dev,struct urb *urb) { +static int as102_submit_urb_stream (struct as102_dev_t *dev,struct urb *urb) +{int err; usb_fill_bulk_urb(urb,
@@ -180,8 +186,9 @@ as102_urb_stream_irq, dev); -if ((err =usb_submit_urb (urb,GFP_ATOMIC ))) -dprintk (debug,"%s: usb_submit_urb failed\n" , __FUNCTION__); + err =usb_submit_urb (urb,GFP_ATOMIC ); +if (err) +dprintk (debug,"%s: usb_submit_urb failed\n" , __func__);return err; }
@@ -203,7 +210,7 @@/* do nothing ? */ #endif }else { -if (urb->actual_length ==0 ) +if (urb->actual_length ==0 )memset (urb->transfer_buffer,0 ,AS102_USB_BUF_SIZE ); }
@@ -212,7 +219,8 @@as102_submit_urb_stream (as102_dev, urb); } -static void as102_free_usb_stream_buffer (struct as102_dev_t *dev) { +static void as102_free_usb_stream_buffer (struct as102_dev_t *dev) +{int i;ENTER ();
@@ -227,7 +235,8 @@LEAVE (); } -static int as102_alloc_usb_stream_buffer (struct as102_dev_t *dev) { +static int as102_alloc_usb_stream_buffer (struct as102_dev_t *dev) +{int i, ret =0 ;ENTER ();
@@ -237,7 +246,7 @@GFP_KERNEL , &dev->dma_addr);if (!dev->stream) { -dprintk (debug,"%s: usb_buffer_alloc failed\n" , __FUNCTION__); +dprintk (debug,"%s: usb_buffer_alloc failed\n" , __func__);return -ENOMEM ; }
@@ -247,8 +256,9 @@for (i =0 ; i <MAX_STREAM_URB ; i++) {struct urb *urb; -if (!(urb =usb_alloc_urb (0 ,GFP_ATOMIC ))) { -dprintk (debug,"%s: usb_alloc_urb failed\n" , __FUNCTION__); + urb =usb_alloc_urb (0 ,GFP_ATOMIC ); +if (urb ==NULL ) { +dprintk (debug,"%s: usb_alloc_urb failed\n" , __func__);as102_free_usb_stream_buffer (dev);return -ENOMEM ; }
@@ -262,18 +272,21 @@return ret; } -static void as102_usb_stop_stream (struct as102_dev_t *dev) { +static void as102_usb_stop_stream (struct as102_dev_t *dev) +{int i;for (i =0 ; i <MAX_STREAM_URB ; i++)usb_kill_urb (dev->stream_urb[i]); } -static int as102_usb_start_stream (struct as102_dev_t *dev) { +static int as102_usb_start_stream (struct as102_dev_t *dev) +{int i, ret =0 ;for (i =0 ; i <MAX_STREAM_URB ; i++) { -if ((ret =as102_submit_urb_stream (dev, dev->stream_urb[i]))) { + ret =as102_submit_urb_stream (dev, dev->stream_urb[i]); +if (ret) {as102_usb_stop_stream (dev);return ret; }
@@ -282,7 +295,8 @@return 0 ; } -static void as102_usb_release (struct kref *kref) { +static void as102_usb_release (struct kref *kref) +{struct as102_dev_t *as102_dev;ENTER ();
@@ -296,7 +310,8 @@LEAVE (); } -static void as102_usb_disconnect (struct usb_interface *intf) { +static void as102_usb_disconnect (struct usb_interface *intf) +{struct as102_dev_t *as102_dev;ENTER ();
@@ -324,14 +339,16 @@ }static int as102_usb_probe (struct usb_interface *intf, -const struct usb_device_id *id) { +const struct usb_device_id *id) +{int ret;struct as102_dev_t *as102_dev;ENTER (); -if (!(as102_dev =kzalloc (sizeof (struct as102_dev_t ),GFP_KERNEL ))) { -err ("%s: kzalloc failed" , __FUNCTION__); + as102_dev =kzalloc (sizeof (struct as102_dev_t ),GFP_KERNEL ); +if (as102_dev ==NULL ) { +err ("%s: kzalloc failed" , __func__);return -ENOMEM ; }
@@ -352,17 +369,19 @@ as102_dev->bus_adap.usb_dev =usb_get_dev (interface_to_usbdev (intf));/* we can register the device now, as it is ready */ -if ((ret =usb_register_dev (intf, &as102_usb_class_driver)) <0 ) {; + ret =usb_register_dev (intf, &as102_usb_class_driver); +if (ret <0 ) {/* something prevented us from registering this driver */ err ("%s: usb_register_dev() failed (errno = %d)" , - __FUNCTION__, ret); + __func__, ret); goto failed; }printk (KERN_INFO "%s: device has been detected\n" ,DRIVER_NAME );/* request buffer allocation for streaming */ -if ((ret =as102_alloc_usb_stream_buffer (as102_dev)) !=0 ) + ret =as102_alloc_usb_stream_buffer (as102_dev); +if (ret !=0 ) goto failed;/* register dvb layer */
@@ -377,7 +396,8 @@return ret; } -static int as102_open (struct inode *inode,struct file *file) { +static int as102_open (struct inode *inode,struct file *file) +{int ret =0 , minor =0 ;struct usb_interface *intf =NULL ;struct as102_dev_t *dev =NULL ;
@@ -388,15 +408,17 @@ minor =iminor (inode);/* fetch device from usb interface */ -if ((intf =usb_find_interface (&as102_usb_driver, minor)) ==NULL ) { + intf =usb_find_interface (&as102_usb_driver, minor); +if (intf ==NULL ) {printk (KERN_ERR "%s: can't find device for minor %d\n" , - __FUNCTION__, minor); + __func__, minor); ret = -ENODEV ; goto exit; }/* get our device */ -if ((dev =usb_get_intfdata (intf)) ==NULL ) { + dev =usb_get_intfdata (intf); +if (dev ==NULL ) { ret = -EFAULT ; goto exit; }
@@ -412,13 +434,15 @@return ret; } -static int as102_release (struct inode *inode,struct file *file) { +static int as102_release (struct inode *inode,struct file *file) +{int ret =0 ;struct as102_dev_t *dev =NULL ;ENTER (); -if ((dev = file->private_data) !=NULL ) { + dev = file->private_data; +if (dev !=NULL ) {/* decrement the count on our device */ kref_put (&dev->kref, as102_usb_release); }
drivers/staging/media/as102/as102_usb_drv.h +1 -2
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -35,8 +36,6 @@#define PCTV_74E_USB_VID 0x2013#define PCTV_74E_USB_PID 0x0246 -extern struct file_operations as102_dev_fops; -#if (LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,6 ,18 ))void as102_urb_stream_irq (struct urb *urb,struct pt_regs *regs);#else
PATCH RESEND 7/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318867 18000
# Node ID 152825226bec049f947a844bea2c530fc9269ae5 # Parent 5916edd6739e9b8e02ff8a1e93161c4d23b50b3e
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as102_usb_drv.c.
Priority: normal
drivers/staging/media/as102/as102_usb_drv.c +71 -47
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -49,7 +50,7 @@ .id_table = as102_usb_id_table }; -struct file_operations as102_dev_fops = { +static const struct file_operations as102_dev_fops = { .owner =THIS_MODULE , .open = as102_open, .release = as102_release,
@@ -63,46 +64,48 @@static int as102_usb_xfer_cmd (struct as102_bus_adapter_t *bus_adap,unsigned char *send_buf,int send_buf_len, -unsigned char *recv_buf,int recv_buf_len) { - +unsigned char *recv_buf,int recv_buf_len) +{int ret =0 ;ENTER (); -if (send_buf !=NULL ) { +if (send_buf !=NULL ) { ret =usb_control_msg (bus_adap->usb_dev,usb_sndctrlpipe (bus_adap->usb_dev,0 ),AS102_USB_DEVICE_TX_CTRL_CMD , -USB_DIR_OUT |USB_TYPE_VENDOR |USB_RECIP_DEVICE , +USB_DIR_OUT |USB_TYPE_VENDOR | +USB_RECIP_DEVICE , bus_adap->cmd_xid,/* value */ 0 ,/* index */ send_buf, send_buf_len,USB_CTRL_SET_TIMEOUT /* 200 */ ); -if (ret <0 ) { +if (ret <0 ) {dprintk (debug,"usb_control_msg(send) failed, err %i\n" , ret);return ret; } -if (ret != send_buf_len) { +if (ret != send_buf_len) {dprintk (debug,"only wrote %d of %d bytes\n" , ret, send_buf_len);return -1 ; } } -if (recv_buf !=NULL ) { +if (recv_buf !=NULL ) {#ifdef TRACE dprintk (debug,"want to read: %d bytes\n" , recv_buf_len);#endif ret =usb_control_msg (bus_adap->usb_dev,usb_rcvctrlpipe (bus_adap->usb_dev,0 ),AS102_USB_DEVICE_RX_CTRL_CMD , -USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_DEVICE , +USB_DIR_IN |USB_TYPE_VENDOR | +USB_RECIP_DEVICE , bus_adap->cmd_xid,/* value */ 0 ,/* index */ recv_buf, recv_buf_len,USB_CTRL_GET_TIMEOUT /* 200 */ ); -if (ret <0 ) { +if (ret <0 ) {dprintk (debug,"usb_control_msg(recv) failed, err %i\n" , ret);return ret;
@@ -119,18 +122,19 @@static int as102_send_ep1 (struct as102_bus_adapter_t *bus_adap,unsigned char *send_buf,int send_buf_len, -int swap32) { - +int swap32) +{int ret =0 , actual_len; - ret =usb_bulk_msg (bus_adap->usb_dev,usb_sndbulkpipe (bus_adap->usb_dev,1 ), + ret =usb_bulk_msg (bus_adap->usb_dev, +usb_sndbulkpipe (bus_adap->usb_dev,1 ), send_buf, send_buf_len, &actual_len,200 ); -if (ret) { +if (ret) {dprintk (debug,"usb_bulk_msg(send) failed, err %i\n" , ret);return ret; } -if (actual_len != send_buf_len) { +if (actual_len != send_buf_len) {dprintk (debug,"only wrote %d of %d bytes\n" , actual_len, send_buf_len);return -1 ;
@@ -139,21 +143,22 @@ }static int as102_read_ep2 (struct as102_bus_adapter_t *bus_adap, -unsigned char *recv_buf,int recv_buf_len) { - +unsigned char *recv_buf,int recv_buf_len) +{int ret =0 , actual_len; -if (recv_buf ==NULL ) +if (recv_buf ==NULL )return -EINVAL ; - ret =usb_bulk_msg (bus_adap->usb_dev,usb_rcvbulkpipe (bus_adap->usb_dev,2 ), + ret =usb_bulk_msg (bus_adap->usb_dev, +usb_rcvbulkpipe (bus_adap->usb_dev,2 ), recv_buf, recv_buf_len, &actual_len,200 ); -if (ret) { +if (ret) {dprintk (debug,"usb_bulk_msg(recv) failed, err %i\n" , ret);return ret; } -if (actual_len != recv_buf_len) { +if (actual_len != recv_buf_len) {dprintk (debug,"only read %d of %d bytes\n" , actual_len, recv_buf_len);return -1 ;
@@ -169,7 +174,8 @@ .stop_stream = as102_usb_stop_stream, }; -static int as102_submit_urb_stream (struct as102_dev_t *dev,struct urb *urb) { +static int as102_submit_urb_stream (struct as102_dev_t *dev,struct urb *urb) +{int err; usb_fill_bulk_urb(urb,
@@ -180,8 +186,9 @@ as102_urb_stream_irq, dev); -if ((err =usb_submit_urb (urb,GFP_ATOMIC ))) -dprintk (debug,"%s: usb_submit_urb failed\n" , __FUNCTION__); + err =usb_submit_urb (urb,GFP_ATOMIC ); +if (err) +dprintk (debug,"%s: usb_submit_urb failed\n" , __func__);return err; }
@@ -203,7 +210,7 @@/* do nothing ? */ #endif }else { -if (urb->actual_length ==0 ) +if (urb->actual_length ==0 )memset (urb->transfer_buffer,0 ,AS102_USB_BUF_SIZE ); }
@@ -212,7 +219,8 @@as102_submit_urb_stream (as102_dev, urb); } -static void as102_free_usb_stream_buffer (struct as102_dev_t *dev) { +static void as102_free_usb_stream_buffer (struct as102_dev_t *dev) +{int i;ENTER ();
@@ -227,7 +235,8 @@LEAVE (); } -static int as102_alloc_usb_stream_buffer (struct as102_dev_t *dev) { +static int as102_alloc_usb_stream_buffer (struct as102_dev_t *dev) +{int i, ret =0 ;ENTER ();
@@ -237,7 +246,7 @@GFP_KERNEL , &dev->dma_addr);if (!dev->stream) { -dprintk (debug,"%s: usb_buffer_alloc failed\n" , __FUNCTION__); +dprintk (debug,"%s: usb_buffer_alloc failed\n" , __func__);return -ENOMEM ; }
@@ -247,8 +256,9 @@for (i =0 ; i <MAX_STREAM_URB ; i++) {struct urb *urb; -if (!(urb =usb_alloc_urb (0 ,GFP_ATOMIC ))) { -dprintk (debug,"%s: usb_alloc_urb failed\n" , __FUNCTION__); + urb =usb_alloc_urb (0 ,GFP_ATOMIC ); +if (urb ==NULL ) { +dprintk (debug,"%s: usb_alloc_urb failed\n" , __func__);as102_free_usb_stream_buffer (dev);return -ENOMEM ; }
@@ -262,18 +272,21 @@return ret; } -static void as102_usb_stop_stream (struct as102_dev_t *dev) { +static void as102_usb_stop_stream (struct as102_dev_t *dev) +{int i;for (i =0 ; i <MAX_STREAM_URB ; i++)usb_kill_urb (dev->stream_urb[i]); } -static int as102_usb_start_stream (struct as102_dev_t *dev) { +static int as102_usb_start_stream (struct as102_dev_t *dev) +{int i, ret =0 ;for (i =0 ; i <MAX_STREAM_URB ; i++) { -if ((ret =as102_submit_urb_stream (dev, dev->stream_urb[i]))) { + ret =as102_submit_urb_stream (dev, dev->stream_urb[i]); +if (ret) {as102_usb_stop_stream (dev);return ret; }
@@ -282,7 +295,8 @@return 0 ; } -static void as102_usb_release (struct kref *kref) { +static void as102_usb_release (struct kref *kref) +{struct as102_dev_t *as102_dev;ENTER ();
@@ -296,7 +310,8 @@LEAVE (); } -static void as102_usb_disconnect (struct usb_interface *intf) { +static void as102_usb_disconnect (struct usb_interface *intf) +{struct as102_dev_t *as102_dev;ENTER ();
@@ -324,14 +339,16 @@ }static int as102_usb_probe (struct usb_interface *intf, -const struct usb_device_id *id) { +const struct usb_device_id *id) +{int ret;struct as102_dev_t *as102_dev;ENTER (); -if (!(as102_dev =kzalloc (sizeof (struct as102_dev_t ),GFP_KERNEL ))) { -err ("%s: kzalloc failed" , __FUNCTION__); + as102_dev =kzalloc (sizeof (struct as102_dev_t ),GFP_KERNEL ); +if (as102_dev ==NULL ) { +err ("%s: kzalloc failed" , __func__);return -ENOMEM ; }
@@ -352,17 +369,19 @@ as102_dev->bus_adap.usb_dev =usb_get_dev (interface_to_usbdev (intf));/* we can register the device now, as it is ready */ -if ((ret =usb_register_dev (intf, &as102_usb_class_driver)) <0 ) {; + ret =usb_register_dev (intf, &as102_usb_class_driver); +if (ret <0 ) {/* something prevented us from registering this driver */ err ("%s: usb_register_dev() failed (errno = %d)" , - __FUNCTION__, ret); + __func__, ret); goto failed; }printk (KERN_INFO "%s: device has been detected\n" ,DRIVER_NAME );/* request buffer allocation for streaming */ -if ((ret =as102_alloc_usb_stream_buffer (as102_dev)) !=0 ) + ret =as102_alloc_usb_stream_buffer (as102_dev); +if (ret !=0 ) goto failed;/* register dvb layer */
@@ -377,7 +396,8 @@return ret; } -static int as102_open (struct inode *inode,struct file *file) { +static int as102_open (struct inode *inode,struct file *file) +{int ret =0 , minor =0 ;struct usb_interface *intf =NULL ;struct as102_dev_t *dev =NULL ;
@@ -388,15 +408,17 @@ minor =iminor (inode);/* fetch device from usb interface */ -if ((intf =usb_find_interface (&as102_usb_driver, minor)) ==NULL ) { + intf =usb_find_interface (&as102_usb_driver, minor); +if (intf ==NULL ) {printk (KERN_ERR "%s: can't find device for minor %d\n" , - __FUNCTION__, minor); + __func__, minor); ret = -ENODEV ; goto exit; }/* get our device */ -if ((dev =usb_get_intfdata (intf)) ==NULL ) { + dev =usb_get_intfdata (intf); +if (dev ==NULL ) { ret = -EFAULT ; goto exit; }
@@ -412,13 +434,15 @@return ret; } -static int as102_release (struct inode *inode,struct file *file) { +static int as102_release (struct inode *inode,struct file *file) +{int ret =0 ;struct as102_dev_t *dev =NULL ;ENTER (); -if ((dev = file->private_data) !=NULL ) { + dev = file->private_data; +if (dev !=NULL ) {/* decrement the count on our device */ kref_put (&dev->kref, as102_usb_release); }
drivers/staging/media/as102/as102_usb_drv.h +1 -2
@@ -1,6 +1,7 @@/* * Abilis Systems Single DVB-T Receiver * Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* Copyright (C) 2010 Devin Heitmueller <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -35,8 +36,6 @@#define PCTV_74E_USB_VID 0x2013#define PCTV_74E_USB_PID 0x0246 -extern struct file_operations as102_dev_fops; -#if (LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,6 ,18 ))void as102_urb_stream_irq (struct urb *urb,struct pt_regs *regs);#else
PATCH 8/14 staging/media/as102: checkpatch fixes
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318909 18000
# Node ID 89de57601df871f6d951ca13bf52b136f9eadddf # Parent 152825226bec049f947a844bea2c530fc9269ae5
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as10x_cmd_cfg.c.
Priority: normal
drivers/staging/media/as102/as10x_cmd_cfg.c +108 -110
@@ -2,8 +2,6 @@ \file as10x_cmd_cfg.c - \version $Id$ - \author: S. Martinelli ----------------------------------------------------------------------------\n
@@ -22,7 +20,8 @@#include <linux/kernel.h> #include "as102_drv.h" #elif defined(WIN32 ) -#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)/* win32 ddk implementation */ +#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) +/* win32 ddk implementation */ #include "wdm.h" #include "Device.h" #include "endian_mgmt.h" /* FIXME */
@@ -59,52 +58,52 @@int as10x_cmd_get_context (as10x_handle_t *phandle,uint16_t tag,uint32_t *pvalue) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.context.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.context.req)); -/* fill command */ - pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); - pcmd->body.context.req.tag =cpu_to_le16 (tag); - pcmd->body.context.req.type =cpu_to_le16 (GET_CONTEXT_DATA ); +/* fill command */ + pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); + pcmd->body.context.req.tag =cpu_to_le16 (tag); + pcmd->body.context.req.type =cpu_to_le16 (GET_CONTEXT_DATA ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.context.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.context.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.context.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.context.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response: context command do not follow the common response */ -/* structure -> specific handling response parse required */ - error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); +/* parse response: context command do not follow the common response */ +/* structure -> specific handling response parse required */ + error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); -if (error ==0 ) { -/* Response OK -> get response data */ - *pvalue =le32_to_cpu (prsp->body.context.rsp.reg_val.u.value32); -/* value returned is always a 32-bit value */ - } +if (error ==0 ) { +/* Response OK -> get response data */ + *pvalue =le32_to_cpu (prsp->body.context.rsp.reg_val.u.value32); +/* value returned is always a 32-bit value */ + } out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -118,47 +117,48 @@int as10x_cmd_set_context (as10x_handle_t *phandle,uint16_t tag,uint32_t value) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.context.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.context.req)); -/* fill command */ - pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); -/* pcmd->body.context.req.reg_val.mode initialization is not required */ - pcmd->body.context.req.reg_val.u.value32 =cpu_to_le32 (value); - pcmd->body.context.req.tag =cpu_to_le16 (tag); - pcmd->body.context.req.type =cpu_to_le16 (SET_CONTEXT_DATA ); +/* fill command */ + pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); +/* pcmd->body.context.req.reg_val.mode initialization is not required */ + pcmd->body.context.req.reg_val.u.value32 =cpu_to_le32 (value); + pcmd->body.context.req.tag =cpu_to_le16 (tag); + pcmd->body.context.req.type =cpu_to_le16 (SET_CONTEXT_DATA ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.context.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.context.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.context.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.context.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response: context command do not follow the common response */ -/* structure -> specific handling response parse required */ - error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); +/* parse response: context command do not follow the common response */ +/* structure -> specific handling response parse required */ + error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -175,45 +175,43 @@*/ int as10x_cmd_eLNA_change_mode (as10x_handle_t *phandle,uint8_t mode) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.cfg_change_mode.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.cfg_change_mode.req)); -/* fill command */ - pcmd->body.cfg_change_mode.req.proc_id = -cpu_to_le16 (CONTROL_PROC_ELNA_CHANGE_MODE ); - pcmd->body.cfg_change_mode.req.mode = mode; +/* fill command */ + pcmd->body.cfg_change_mode.req.proc_id = +cpu_to_le16 (CONTROL_PROC_ELNA_CHANGE_MODE ); + pcmd->body.cfg_change_mode.req.mode = mode; -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.cfg_change_mode.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.cfg_change_mode.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.cfg_change_mode.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.cfg_change_mode.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_ELNA_CHANGE_MODE_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_ELNA_CHANGE_MODE_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -225,15 +223,15 @@ABILIS_RC_NOK \callgraph */ -int as10x_context_rsp_parse (struct as10x_cmd_t *prsp,uint16_t proc_id) { +int as10x_context_rsp_parse (struct as10x_cmd_t *prsp,uint16_t proc_id) +{ +int err; -int err; + err = prsp->body.context.rsp.error; - err = prsp->body.context.rsp.error; - -if ((err ==0 ) && - (le16_to_cpu (prsp->body.context.rsp.proc_id) == proc_id)) { -return 0 ; - } -return AS10X_CMD_ERROR ; +if ((err ==0 ) && + (le16_to_cpu (prsp->body.context.rsp.proc_id) == proc_id)) { +return 0 ; + } +return AS10X_CMD_ERROR ; }
PATCH RESEND 8/14 staging/media/as102: checkpatch fixes
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318909 18000
# Node ID 89de57601df871f6d951ca13bf52b136f9eadddf # Parent 152825226bec049f947a844bea2c530fc9269ae5
as102: checkpatch fixes
From: Devin Heitmueller <[email protected]>
Fix make checkpatch issues reported against as10x_cmd_cfg.c.
Priority: normal
drivers/staging/media/as102/as10x_cmd_cfg.c +108 -110
@@ -2,8 +2,6 @@ \file as10x_cmd_cfg.c - \version $Id$ - \author: S. Martinelli ----------------------------------------------------------------------------\n
@@ -22,7 +20,8 @@#include <linux/kernel.h> #include "as102_drv.h" #elif defined(WIN32 ) -#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)/* win32 ddk implementation */ +#if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK) +/* win32 ddk implementation */ #include "wdm.h" #include "Device.h" #include "endian_mgmt.h" /* FIXME */
@@ -59,52 +58,52 @@int as10x_cmd_get_context (as10x_handle_t *phandle,uint16_t tag,uint32_t *pvalue) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.context.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.context.req)); -/* fill command */ - pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); - pcmd->body.context.req.tag =cpu_to_le16 (tag); - pcmd->body.context.req.type =cpu_to_le16 (GET_CONTEXT_DATA ); +/* fill command */ + pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); + pcmd->body.context.req.tag =cpu_to_le16 (tag); + pcmd->body.context.req.type =cpu_to_le16 (GET_CONTEXT_DATA ); -/* send command */ -if (phandle->ops->xfer_cmd) { - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.context.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.context.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.context.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.context.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response: context command do not follow the common response */ -/* structure -> specific handling response parse required */ - error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); +/* parse response: context command do not follow the common response */ +/* structure -> specific handling response parse required */ + error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); -if (error ==0 ) { -/* Response OK -> get response data */ - *pvalue =le32_to_cpu (prsp->body.context.rsp.reg_val.u.value32); -/* value returned is always a 32-bit value */ - } +if (error ==0 ) { +/* Response OK -> get response data */ + *pvalue =le32_to_cpu (prsp->body.context.rsp.reg_val.u.value32); +/* value returned is always a 32-bit value */ + } out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -118,47 +117,48 @@int as10x_cmd_set_context (as10x_handle_t *phandle,uint16_t tag,uint32_t value) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd,(++phandle->cmd_xid),sizeof (pcmd->body.context.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.context.req)); -/* fill command */ - pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); -/* pcmd->body.context.req.reg_val.mode initialization is not required */ - pcmd->body.context.req.reg_val.u.value32 =cpu_to_le32 (value); - pcmd->body.context.req.tag =cpu_to_le16 (tag); - pcmd->body.context.req.type =cpu_to_le16 (SET_CONTEXT_DATA ); +/* fill command */ + pcmd->body.context.req.proc_id =cpu_to_le16 (CONTROL_PROC_CONTEXT ); +/* pcmd->body.context.req.reg_val.mode initialization is not required */ + pcmd->body.context.req.reg_val.u.value32 =cpu_to_le32 (value); + pcmd->body.context.req.tag =cpu_to_le16 (tag); + pcmd->body.context.req.type =cpu_to_le16 (SET_CONTEXT_DATA ); -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.context.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.context.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, + (uint8_t *) pcmd, +sizeof (pcmd->body.context.req) + +HEADER_SIZE , + (uint8_t *) prsp, +sizeof (prsp->body.context.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response: context command do not follow the common response */ -/* structure -> specific handling response parse required */ - error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); +/* parse response: context command do not follow the common response */ +/* structure -> specific handling response parse required */ + error =as10x_context_rsp_parse (prsp,CONTROL_PROC_CONTEXT_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -175,45 +175,43 @@*/ int as10x_cmd_eLNA_change_mode (as10x_handle_t *phandle,uint8_t mode) { -int error; -struct as10x_cmd_t *pcmd, *prsp; +int error; +struct as10x_cmd_t *pcmd, *prsp; -ENTER (); +ENTER (); - pcmd = phandle->cmd; - prsp = phandle->rsp; + pcmd = phandle->cmd; + prsp = phandle->rsp; -/* prepare command */ -as10x_cmd_build (pcmd, (++phandle->cmd_xid), -sizeof (pcmd->body.cfg_change_mode.req)); +/* prepare command */ +as10x_cmd_build (pcmd, (++phandle->cmd_xid), +sizeof (pcmd->body.cfg_change_mode.req)); -/* fill command */ - pcmd->body.cfg_change_mode.req.proc_id = -cpu_to_le16 (CONTROL_PROC_ELNA_CHANGE_MODE ); - pcmd->body.cfg_change_mode.req.mode = mode; +/* fill command */ + pcmd->body.cfg_change_mode.req.proc_id = +cpu_to_le16 (CONTROL_PROC_ELNA_CHANGE_MODE ); + pcmd->body.cfg_change_mode.req.mode = mode; -/* send command */ -if (phandle->ops->xfer_cmd){ - error = phandle->ops->xfer_cmd (phandle, - (uint8_t *) pcmd, -sizeof (pcmd->body.cfg_change_mode.req) +HEADER_SIZE , - (uint8_t *) prsp, -sizeof (prsp->body.cfg_change_mode.rsp) +HEADER_SIZE ); - } -else { - error =AS10X_CMD_ERROR ; - } +/* send command */ +if (phandle->ops->xfer_cmd) { + error = phandle->ops->xfer_cmd (phandle, (uint8_t *) pcmd, +sizeof (pcmd->body.cfg_change_mode.req) + +HEADER_SIZE , (uint8_t *) prsp, +sizeof (prsp->body.cfg_change_mode.rsp) + +HEADER_SIZE ); + }else { + error =AS10X_CMD_ERROR ; + } -if (error <0 ) { - goto out; - } +if (error <0 ) + goto out; -/* parse response */ - error =as10x_rsp_parse (prsp,CONTROL_PROC_ELNA_CHANGE_MODE_RSP ); +/* parse response */ + error =as10x_rsp_parse (prsp,CONTROL_PROC_ELNA_CHANGE_MODE_RSP ); out: -LEAVE (); -return (error); +LEAVE (); +return error; }/**
@@ -225,15 +223,15 @@ABILIS_RC_NOK \callgraph */ -int as10x_context_rsp_parse (struct as10x_cmd_t *prsp,uint16_t proc_id) { +int as10x_context_rsp_parse (struct as10x_cmd_t *prsp,uint16_t proc_id) +{ +int err; -int err; + err = prsp->body.context.rsp.error; - err = prsp->body.context.rsp.error; - -if ((err ==0 ) && - (le16_to_cpu (prsp->body.context.rsp.proc_id) == proc_id)) { -return 0 ; - } -return AS10X_CMD_ERROR ; +if ((err ==0 ) && + (le16_to_cpu (prsp->body.context.rsp.proc_id) == proc_id)) { +return 0 ; + } +return AS10X_CMD_ERROR ; }
PATCH 9/14 staging/media/as102: Add Elgato EyeTV DTT Deluxe
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318991 18000
# Node ID 4a82558f6df8b957bc623d854a118a5da32dead2 # Parent 89de57601df871f6d951ca13bf52b136f9eadddf
as102: Add Elgato EyeTV DTT Deluxe
From: Devin Heitmueller <[email protected]>
Add support for the Elgato EyeTV DTT Deluxe. Note that the product name field has not yet been abstracted out, so it will still identify itself as a PCTV 74e. The driver was originally built by the chipset manufacturer so that the product vendor can specify the deivce name via a #define, but wasn't setup to support multiple products from the same build of the driver.
Thanks to Joerg Unglaub for suggesting this change.
Priority: normal
drivers/staging/media/as102/as102_usb_drv.c +1 -0
@@ -40,6 +40,7 @@static struct usb_device_id as102_usb_id_table[] = { {USB_DEVICE (AS102_USB_DEVICE_VENDOR_ID ,AS102_USB_DEVICE_PID_0001 ) }, {USB_DEVICE (PCTV_74E_USB_VID ,PCTV_74E_USB_PID ) }, + {USB_DEVICE (ELGATO_EYETV_DTT_USB_VID ,ELGATO_EYETV_DTT_USB_PID ) }, { }/* Terminating entry */ };
drivers/staging/media/as102/as102_usb_drv.h +5 -0
@@ -36,6 +36,11 @@#define PCTV_74E_USB_VID 0x2013#define PCTV_74E_USB_PID 0x0246 +/* Elgato: EyeTV DTT Deluxe */ +#define ELGATO_EYETV_DTT_NAME "Elgato EyeTV DTT Deluxe" +#define ELGATO_EYETV_DTT_USB_VID 0x0fd9 +#define ELGATO_EYETV_DTT_USB_PID 0x002c +#if (LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,6 ,18 ))void as102_urb_stream_irq (struct urb *urb,struct pt_regs *regs);#else
PATCH RESEND 9/14 staging/media/as102: Add Elgato EyeTV DTT Deluxe
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267318991 18000
# Node ID 4a82558f6df8b957bc623d854a118a5da32dead2 # Parent 89de57601df871f6d951ca13bf52b136f9eadddf
as102: Add Elgato EyeTV DTT Deluxe
From: Devin Heitmueller <[email protected]>
Add support for the Elgato EyeTV DTT Deluxe. Note that the product name field has not yet been abstracted out, so it will still identify itself as a PCTV 74e. The driver was originally built by the chipset manufacturer so that the product vendor can specify the deivce name via a #define, but wasn't setup to support multiple products from the same build of the driver.
Thanks to Joerg Unglaub for suggesting this change.
Priority: normal
drivers/staging/media/as102/as102_usb_drv.c +1 -0
@@ -40,6 +40,7 @@static struct usb_device_id as102_usb_id_table[] = { {USB_DEVICE (AS102_USB_DEVICE_VENDOR_ID ,AS102_USB_DEVICE_PID_0001 ) }, {USB_DEVICE (PCTV_74E_USB_VID ,PCTV_74E_USB_PID ) }, + {USB_DEVICE (ELGATO_EYETV_DTT_USB_VID ,ELGATO_EYETV_DTT_USB_PID ) }, { }/* Terminating entry */ };
drivers/staging/media/as102/as102_usb_drv.h +5 -0
@@ -36,6 +36,11 @@#define PCTV_74E_USB_VID 0x2013#define PCTV_74E_USB_PID 0x0246 +/* Elgato: EyeTV DTT Deluxe */ +#define ELGATO_EYETV_DTT_NAME "Elgato EyeTV DTT Deluxe" +#define ELGATO_EYETV_DTT_USB_VID 0x0fd9 +#define ELGATO_EYETV_DTT_USB_PID 0x002c +#if (LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,6 ,18 ))void as102_urb_stream_irq (struct urb *urb,struct pt_regs *regs);#else
PATCH 10/14 staging/media/as102: properly handle multiple product names
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:# HG changeset patch # User Devin Heitmueller <[email protected]> # Date 1267319051 18000
# Node ID 22ef1bdca69a2781abf397c53a0f7f6125f5359a # Parent 4a82558f6df8b957bc623d854a118a5da32dead2
as102: properly handle multiple product names
From: Devin Heitmueller <[email protected]>
Properly handle the case where the driver can be associated with multiple different products (as opposed to always saying the device is named after the value in a #define
Priority: normal
drivers/staging/media/as102/as102_drv.c +1 -1
@@ -209,7 +209,7 @@#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) ret =dvb_register_adapter (&as102_dev->dvb_adap, -DEVICE_FULL_NAME , + as102_dev->name,THIS_MODULE , #if defined(CONFIG_AS102_USB) &as102_dev->bus_adap.usb_dev->dev
drivers/staging/media/as102/as102_drv.h +1 -0
@@ -106,6 +106,7 @@ };struct as102_dev_t { +const char *name;struct as102_bus_adapter_t bus_adap;struct list_head device_entry;struct kref kref;
drivers/staging/media/as102/as102_fe.c +3 -1
@@ -346,7 +346,7 @@static struct dvb_frontend_ops as102_fe_ops = { .info = { - .name =DEVICE_FULL_NAME , + .name ="Unknown AS102 device" , .type =FE_OFDM , .frequency_min =174000000 , .frequency_max =862000000 ,
@@ -408,6 +408,8 @@/* init frontend callback ops */ memcpy (&dvb_fe->ops, &as102_fe_ops,sizeof (struct dvb_frontend_ops )); +strncpy (dvb_fe->ops.info.name, as102_dev->name, +sizeof (dvb_fe->ops.info.name));/* register dbvb frontend */ errno =dvb_register_frontend (dvb_adap, dvb_fe);
drivers/staging/media/as102/as102_usb_drv.c +27 -0
@@ -44,6 +44,15 @@ { }/* Terminating entry */ }; +/* Note that this table must always have the same number of entries as the +as102_usb_id_table struct */ +static const char *as102_device_names[] = { +AS102_REFERENCE_DESIGN , +AS102_PCTV_74E , +AS102_ELGATO_EYETV_DTT_NAME , +NULL /* Terminating entry */ +}; +struct usb_driver as102_usb_driver = { .name =DRIVER_FULL_NAME , .probe = as102_usb_probe,
@@ -344,6 +353,7 @@ {int ret;struct as102_dev_t *as102_dev; +int i;ENTER ();
@@ -353,6 +363,23 @@return -ENOMEM ; } +/* This should never actually happen */ +if ((sizeof (as102_usb_id_table) /sizeof (struct usb_device_id )) != + (sizeof (as102_device_names) /sizeof (const char *))) { +printk (KERN_ERR "Device names table invalid size" ); +return -EINVAL ; + } + +/* Assign the user-friendly device name */ +for (i =0 ; i < (sizeof (as102_usb_id_table) / +sizeof (struct usb_device_id )); i++) { +if (id == &as102_usb_id_table[i]) + as102_dev->name = as102_device_names[i]; + } + +if (as102_dev->name ==NULL ) + as102_dev->name ="Unknown AS102 device" ; +/* set private callback functions */ as102_dev->bus_adap.ops = &as102_priv_ops;
drivers/staging/media/as102/as102_usb_drv.h +3 -2
@@ -28,16 +28,17 @@/* define these values to match the supported devices */ /* Abilis system: "TITAN" */ +#define AS102_REFERENCE_DESIGN "Abilis Systems DVB-Titan"#define AS102_USB_DEVICE_VENDOR_ID 0x1BA6#define AS102_USB_DEVICE_PID_0001 0x0001/* PCTV Systems: PCTV picoStick (74e) */ -#define DEVICE_FULL_NAME "PCTV Systems : PCTV picoStick (74e)" +#define AS102_PCTV_74E "PCTV Systems picoStick (74e)"#define PCTV_74E_USB_VID 0x2013#define PCTV_74E_USB_PID 0x0246/* Elgato: EyeTV DTT Deluxe */ -#define ELGATO_EYETV_DTT_NAME "Elgato EyeTV DTT Deluxe" +#define AS102_ELGATO_EYETV_DTT_NAME "Elgato EyeTV DTT Deluxe"#define ELGATO_EYETV_DTT_USB_VID 0x0fd9#define ELGATO_EYETV_DTT_USB_PID 0x002c
PATCH RESEND 10/14 staging/media/as102: properly handle multiple product names
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:# HG changeset patch # User Devin Heitmueller <[email protected]> # Date 1267319051 18000
# Node ID 22ef1bdca69a2781abf397c53a0f7f6125f5359a # Parent 4a82558f6df8b957bc623d854a118a5da32dead2
as102: properly handle multiple product names
From: Devin Heitmueller <[email protected]>
Properly handle the case where the driver can be associated with multiple different products (as opposed to always saying the device is named after the value in a #define
Priority: normal
drivers/staging/media/as102/as102_drv.c +1 -1
@@ -209,7 +209,7 @@#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) ret =dvb_register_adapter (&as102_dev->dvb_adap, -DEVICE_FULL_NAME , + as102_dev->name,THIS_MODULE , #if defined(CONFIG_AS102_USB) &as102_dev->bus_adap.usb_dev->dev
drivers/staging/media/as102/as102_drv.h +1 -0
@@ -106,6 +106,7 @@ };struct as102_dev_t { +const char *name;struct as102_bus_adapter_t bus_adap;struct list_head device_entry;struct kref kref;
drivers/staging/media/as102/as102_fe.c +3 -1
@@ -346,7 +346,7 @@static struct dvb_frontend_ops as102_fe_ops = { .info = { - .name =DEVICE_FULL_NAME , + .name ="Unknown AS102 device" , .type =FE_OFDM , .frequency_min =174000000 , .frequency_max =862000000 ,
@@ -408,6 +408,8 @@/* init frontend callback ops */ memcpy (&dvb_fe->ops, &as102_fe_ops,sizeof (struct dvb_frontend_ops )); +strncpy (dvb_fe->ops.info.name, as102_dev->name, +sizeof (dvb_fe->ops.info.name));/* register dbvb frontend */ errno =dvb_register_frontend (dvb_adap, dvb_fe);
drivers/staging/media/as102/as102_usb_drv.c +27 -0
@@ -44,6 +44,15 @@ { }/* Terminating entry */ }; +/* Note that this table must always have the same number of entries as the +as102_usb_id_table struct */ +static const char *as102_device_names[] = { +AS102_REFERENCE_DESIGN , +AS102_PCTV_74E , +AS102_ELGATO_EYETV_DTT_NAME , +NULL /* Terminating entry */ +}; +struct usb_driver as102_usb_driver = { .name =DRIVER_FULL_NAME , .probe = as102_usb_probe,
@@ -344,6 +353,7 @@ {int ret;struct as102_dev_t *as102_dev; +int i;ENTER ();
@@ -353,6 +363,23 @@return -ENOMEM ; } +/* This should never actually happen */ +if ((sizeof (as102_usb_id_table) /sizeof (struct usb_device_id )) != + (sizeof (as102_device_names) /sizeof (const char *))) { +printk (KERN_ERR "Device names table invalid size" ); +return -EINVAL ; + } + +/* Assign the user-friendly device name */ +for (i =0 ; i < (sizeof (as102_usb_id_table) / +sizeof (struct usb_device_id )); i++) { +if (id == &as102_usb_id_table[i]) + as102_dev->name = as102_device_names[i]; + } + +if (as102_dev->name ==NULL ) + as102_dev->name ="Unknown AS102 device" ; +/* set private callback functions */ as102_dev->bus_adap.ops = &as102_priv_ops;
drivers/staging/media/as102/as102_usb_drv.h +3 -2
@@ -28,16 +28,17 @@/* define these values to match the supported devices */ /* Abilis system: "TITAN" */ +#define AS102_REFERENCE_DESIGN "Abilis Systems DVB-Titan"#define AS102_USB_DEVICE_VENDOR_ID 0x1BA6#define AS102_USB_DEVICE_PID_0001 0x0001/* PCTV Systems: PCTV picoStick (74e) */ -#define DEVICE_FULL_NAME "PCTV Systems : PCTV picoStick (74e)" +#define AS102_PCTV_74E "PCTV Systems picoStick (74e)"#define PCTV_74E_USB_VID 0x2013#define PCTV_74E_USB_PID 0x0246/* Elgato: EyeTV DTT Deluxe */ -#define ELGATO_EYETV_DTT_NAME "Elgato EyeTV DTT Deluxe" +#define AS102_ELGATO_EYETV_DTT_NAME "Elgato EyeTV DTT Deluxe"#define ELGATO_EYETV_DTT_USB_VID 0x0fd9#define ELGATO_EYETV_DTT_USB_PID 0x002c
Re: [RESEND PATCH 10/14] staging/media/as102: properly handle multiple product names
Quoted 1 line · Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
[]
linuxb/drivers/staging/media/as102/as102_fe.c
Quoted 1 line
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +0
-0
[]
linuxb/drivers/staging/media/as102/as102_fe.c line 412
Quoted 6 lines
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +2
-0@@ -408,6 +408,8 @@/* init frontend callback ops */ memcpy (&dvb_fe->ops, &as102_fe_ops,sizeof (struct dvb_frontend_ops )); +strncpy (dvb_fe->ops.info.name, as102_dev->name, +sizeof (dvb_fe->ops.info.name));
strlcpy?
Re: [RESEND PATCH 10/14] staging/media/as102: properly handle multiple product names
Quoted 5 lines · On Tue, 18 Oct 2011 13:28:39 -0700 Joe Perches <[email protected]> wrote:
Quoted 1 line · Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
[]
linuxb/drivers/staging/media/as102/as102_fe.c
Quoted 1 line
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +0
-0[]
Quoted 10 lines
linuxb/drivers/staging/media/as102/as102_fe.c line 412
Quoted 6 lines
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +2
-0@@ -408,6 +408,8 @@/* init frontend callback ops */ memcpy (&dvb_fe->ops, &as102_fe_ops,sizeof (struct dvb_frontend_ops )); +strncpy (dvb_fe->ops.info.name, as102_dev->name, +sizeof (dvb_fe->ops.info.name));strlcpy?
Can be, but not during moving from another repo.
There will be time for such fixes in kernel tree.
Am I right ?
Re: [RESEND PATCH 10/14] staging/media/as102: properly handle multiple product names
Quoted 19 lines · Piotr Chmura
Quoted 5 lines · On Tue, 18 Oct 2011 13:28:39 -0700 Joe Perches <[email protected]> wrote:
Quoted 1 line · Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
[]
linuxb/drivers/staging/media/as102/as102_fe.c
Quoted 1 line
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +0
-0[]
Quoted 10 lines
linuxb/drivers/staging/media/as102/as102_fe.c line 412
Quoted 6 lines
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +2
-0@@ -408,6 +408,8 @@/* init frontend callback ops */ memcpy (&dvb_fe->ops, &as102_fe_ops,sizeof (struct dvb_frontend_ops )); +strncpy (dvb_fe->ops.info.name, as102_dev->name, +sizeof (dvb_fe->ops.info.name));strlcpy?
Quoted 3 lines
Can be, but not during moving from another repo.
There will be time for such fixes in kernel tree.
Am I right ?
Yes, you are correct, focus on getting the code into the tree first, then work on fixing up the issues.
greg k-h
Re: [RESEND PATCH 10/14] staging/media/as102: properly handle multiple product names
In reply to Piotr ChmuraQuoted 7 lines · Piotr Chmura
Quoted 5 lines · On Tue, 18 Oct 2011 13:28:39 -0700 Joe Perches <[email protected]> wrote:
Quoted 1 line · Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
[]
linuxb/drivers/staging/media/as102/as102_fe.c
Quoted 1 line
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +0
-0[]
Quoted 8 lines
Quoted 7 lines
linuxb/drivers/staging/media/as102/as102_fe.c line 412
Quoted 6 lines
linuxb/drivers/staging/media/as102/as102_fe.c renamed from linux/drivers/staging/media/as102/as102_fe.c +2
-0@@ -408,6 +408,8 @@/* init frontend callback ops */ memcpy (&dvb_fe->ops, &as102_fe_ops,sizeof (struct dvb_frontend_ops )); +strncpy (dvb_fe->ops.info.name, as102_dev->name, +sizeof (dvb_fe->ops.info.name));strlcpy?
Can be, but not during moving from another repo.
I don't know nor care much really which of these patches are direct moves from another repo and which are "cleanups". It does appear that only patch 1 is a move from some repository to the kernel tree and all the rest are cleanups though.
Quoted 2 lines
There will be time for such fixes in kernel tree.
Am I right ?
Oh sure, just pointing out what looks odd.
cheers, Joe
PATCH 11/14 staging/media/as102: fix compile warning about unused function
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267319685 18000
# Node ID 84b93826c0a19efa114a6808165f91390cb86daa # Parent 22ef1bdca69a2781abf397c53a0f7f6125f5359a
as102: fix compile warning about unused function
From: Devin Heitmueller <[email protected]>
The function in question is only used on old kernels, so we had the call to the function #ifdef'd, but the definition of the function was stil being included.
Priority: normal
drivers/staging/media/as102/as102_fe.c +1 -3
@@ -32,6 +32,7 @@static void as102_fe_copy_tune_parameters (struct as10x_tune_args *dst,struct dvb_frontend_parameters *src); +#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))static void as102_fe_release (struct dvb_frontend *fe) {struct as102_dev_t *dev;
@@ -42,7 +43,6 @@if (dev ==NULL )return ; -#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))if (mutex_lock_interruptible (&dev->bus_adap.lock))return ;
@@ -50,7 +50,6 @@as10x_cmd_turn_off (&dev->bus_adap);mutex_unlock (&dev->bus_adap.lock); -#endif /* release frontend callback ops */ memset (&fe->ops,0 ,sizeof (struct dvb_frontend_ops ));
@@ -66,7 +65,6 @@LEAVE (); } -#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))static int as102_fe_init (struct dvb_frontend *fe) {int ret =0 ;
PATCH RESEND 11/14 staging/media/as102: fix compile warning about unused function
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller <[email protected]> # Date 1267319685 18000
# Node ID 84b93826c0a19efa114a6808165f91390cb86daa # Parent 22ef1bdca69a2781abf397c53a0f7f6125f5359a
as102: fix compile warning about unused function
From: Devin Heitmueller <[email protected]>
The function in question is only used on old kernels, so we had the call to the function #ifdef'd, but the definition of the function was stil being included.
Priority: normal
drivers/staging/media/as102/as102_fe.c +1 -3
@@ -32,6 +32,7 @@static void as102_fe_copy_tune_parameters (struct as10x_tune_args *dst,struct dvb_frontend_parameters *src); +#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))static void as102_fe_release (struct dvb_frontend *fe) {struct as102_dev_t *dev;
@@ -42,7 +43,6 @@if (dev ==NULL )return ; -#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))if (mutex_lock_interruptible (&dev->bus_adap.lock))return ;
@@ -50,7 +50,6 @@as10x_cmd_turn_off (&dev->bus_adap);mutex_unlock (&dev->bus_adap.lock); -#endif /* release frontend callback ops */ memset (&fe->ops,0 ,sizeof (struct dvb_frontend_ops ));
@@ -66,7 +65,6 @@LEAVE (); } -#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))static int as102_fe_init (struct dvb_frontend *fe) {int ret =0 ;
Re: [RESEND PATCH 11/14] staging/media/as102: fix compile warning about unused function
Quoted 25 lines · Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:
# HG changeset patch
# User Devin Heitmueller<[email protected]> # Date 1267319685 18000
# Node ID84b93826c0a19efa114a6808165f91390cb86daa# Parent22ef1bdca69a2781abf397c53a0f7f6125f5359a
as102: fix compile warning about unused functionFrom: Devin Heitmueller<[email protected]>
The function in question is only used on old kernels, so we had the call to the function #ifdef'd, but the definition of the function was stil being included.
Priority: normal
Signed-off-by Devin Heitmueller<[email protected]>Signed-off-by Piotr Chmura<[email protected]>
drivers/staging/media/as102/as102_fe.c line 35
Quoted 4 lines
drivers/staging/media/as102/as102_fe.c +1
-0@@ -32,6 +32,7 @@static void as102_fe_copy_tune_parameters (struct as10x_tune_args *dst,struct dvb_frontend_parameters *src); +#if (LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,19 ))
I was wondering, could such a conditional compilation be simply skipped when we are merging the driver into exactly known kernel version ? For backports there are separate patches at media_build.git and I can't see such an approach used in any driver upstream.
--
Regards,
Sylwester
Re: [RESEND PATCH 11/14] staging/media/as102: fix compile warning about unused function
Quoted 2 lines · On Oct 30 Sylwester Nawrocki wrote:
Quoted 1 line · Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
[...]
Quoted 6 lines
Quoted 1 line
+#if (LINUX_VERSION_CODE<
KERNEL_VERSION(2, 6, 19))I was wondering, could such a conditional compilation be simply skipped when we are merging the driver into exactly known kernel version ? For backports there are separate patches at media_build.git and I can't see such an approach used in any driver upstream.
Compatibility code is in fact not allowed anymore upstream. But AFAIU, this patch here does not have such a cleanup in its scope. If the compat removal isn't already included later on in Piotr's series, it will be done later before this driver can be moved out of staging.
Signature · 3 lines
Stefan Richter -=====-==-== =-=- ====- http://arcgraph.de/sr/
PATCH 12/14 staging/media/as102: fix licensing oversight
In reply to a message not in the archivePatch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:# HG changeset patch # User Devin Heitmueller <[email protected]> # Date 1267577404 18000
# Node ID 8557cb6da3e71a350a538e3a0eb41126884289b9 # Parent 84b93826c0a19efa114a6808165f91390cb86daa
as102: fix licensing oversight
From: Pierrick Hascoet <[email protected]>
Fix a couple of files which were supposed by be relicensed as GPL but were overlooked.
Priority: normal
drivers/staging/media/as102/as10x_cmd_cfg.c +18 -17
@@ -1,20 +1,21 @@ -/** - -\file as10x_cmd_cfg.c - -\author: S. Martinelli - -----------------------------------------------------------------------------\n -(c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n -www.abilis.com \n -----------------------------------------------------------------------------\n - -\brief AS10x API, configuration services - -AS10x cmd management: build command buffer, send command through -selected port and wait for the response when required. - -*/ +/* +* Abilis Systems Single DVB-T Receiver +* Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ #if defined(LINUX ) && defined(__KERNEL__)/* linux kernel implementation */ #include <linux/kernel.h>
drivers/staging/media/as102/as10x_cmd_stream.c +18 -19
@@ -1,22 +1,21 @@ -/** - -\file as10x_cmd_stream.c - -\author: S. Martinelli - -----------------------------------------------------------------------------\n -(c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n -www.abilis.com \n -----------------------------------------------------------------------------\n - -\brief AS10x CMD, stream services - -AS10x CMD management: build command buffer, send command through -selected port and wait for the response when required. - -*/ - - +/* +* Abilis Systems Single DVB-T Receiver +* Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ #if defined(LINUX ) && defined(__KERNEL__)/* linux kernel implementation */ #include <linux/kernel.h> #include "as102_drv.h"
PATCH RESEND 12/14 staging/media/as102: fix licensing oversight
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
Original source and comment:# HG changeset patch # User Devin Heitmueller <[email protected]> # Date 1267577404 18000
# Node ID 8557cb6da3e71a350a538e3a0eb41126884289b9 # Parent 84b93826c0a19efa114a6808165f91390cb86daa
as102: fix licensing oversight
From: Pierrick Hascoet <[email protected]>
Fix a couple of files which were supposed by be relicensed as GPL but were overlooked.
Priority: normal
drivers/staging/media/as102/as10x_cmd_cfg.c +18 -17
@@ -1,20 +1,21 @@ -/** - -\file as10x_cmd_cfg.c - -\author: S. Martinelli - -----------------------------------------------------------------------------\n -(c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n -www.abilis.com \n -----------------------------------------------------------------------------\n - -\brief AS10x API, configuration services - -AS10x cmd management: build command buffer, send command through -selected port and wait for the response when required. - -*/ +/* +* Abilis Systems Single DVB-T Receiver +* Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ #if defined(LINUX ) && defined(__KERNEL__)/* linux kernel implementation */ #include <linux/kernel.h>
drivers/staging/media/as102/as10x_cmd_stream.c +18 -19
@@ -1,22 +1,21 @@ -/** - -\file as10x_cmd_stream.c - -\author: S. Martinelli - -----------------------------------------------------------------------------\n -(c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n -www.abilis.com \n -----------------------------------------------------------------------------\n - -\brief AS10x CMD, stream services - -AS10x CMD management: build command buffer, send command through -selected port and wait for the response when required. - -*/ - - +/* +* Abilis Systems Single DVB-T Receiver +* Copyright (C) 2008 Pierrick Hascoet <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ #if defined(LINUX ) && defined(__KERNEL__)/* linux kernel implementation */ #include <linux/kernel.h> #include "as102_drv.h"
PATCH 13/14 staging/media/as102: fix compile
In reply to a message not in the archiveReplace usb_buffer_free() and usb_buffer_alloc() by usb_free_coherent() and usb_alloc_coherent() making it compile in current tree. Add driver to parent Makefile and Kconfig
drivers/staging/Kconfig +2 -0
@@ -150,4 +150,6 @@ source "drivers/staging/nvec/Kconfig" +source "drivers/staging/media/as102/Kconfig" + endif # STAGING
drivers/staging/Makefile +1 -0
@@ -66,3 +66,4 @@ obj-$(CONFIG_DRM_PSB) += gma500/ obj-$(CONFIG_INTEL_MEI) += mei/ obj-$(CONFIG_MFD_NVEC) += nvec/ +obj-$(CONFIG_DVB_AS102) += media/as102/
drivers/staging/media/as102/as102_usb_drv.c +2 -2
@@ -238,7 +238,7 @@for (i =0 ; i <MAX_STREAM_URB ; i++)usb_free_urb (dev->stream_urb[i]); -usb_buffer_free (dev->bus_adap.usb_dev, +usb_free_coherent (dev->bus_adap.usb_dev,MAX_STREAM_URB *AS102_USB_BUF_SIZE , dev->stream, dev->dma_addr);
@@ -251,7 +251,7 @@ENTER (); - dev->stream =usb_buffer_alloc (dev->bus_adap.usb_dev, + dev->stream =usb_alloc_coherent (dev->bus_adap.usb_dev,MAX_STREAM_URB *AS102_USB_BUF_SIZE ,GFP_KERNEL , &dev->dma_addr);
PATCH 14/14 staging/media/as102: add nBox Tuner Dongle support
In reply to a message not in the archiveAdd support for nBox Tuner Dongle based on the same chip.
drivers/staging/media/as102/as102_usb_drv.c +2 -0
@@ -41,6 +41,7 @@ { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) }, { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) }, + { USB_DEVICE(NBOX_DVBT_DONGLE_USB_VID, NBOX_DVBT_DONGLE_USB_PID) }, { } /* Terminating entry */ };
@@ -50,6 +51,7 @@AS102_REFERENCE_DESIGN ,AS102_PCTV_74E ,AS102_ELGATO_EYETV_DTT_NAME , +AS102_NBOX_DVBT_DONGLE_NAME , NULL /* Terminating entry */ };
drivers/staging/media/as102/as102_usb_drv.h +5 -0
@@ -42,6 +42,11 @@#define ELGATO_EYETV_DTT_USB_VID 0x0fd9#define ELGATO_EYETV_DTT_USB_PID 0x002c +/* nBox: nBox DVB-T Dongle */ +#define AS102_NBOX_DVBT_DONGLE_NAME "nBox DVB-T Dongle" +#define NBOX_DVBT_DONGLE_USB_VID 0x0b89 +#define NBOX_DVBT_DONGLE_USB_PID 0x0007 +#if (LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,6 ,18 ))void as102_urb_stream_irq (struct urb *urb,struct pt_regs *regs);#else
PATCH 6/7 staging/as102: cleanup - get rid of editor comments
In reply to a message not in the archivestaging/as102: cleanup - get rid of editor comments
Cleanup code: Delete vim formatting comments.
drivers/staging/as102/as102_drv.c +0 -2
@@ -356,5 +356,3 @@MODULE_DESCRIPTION (DRIVER_FULL_NAME );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Pierrick Hascoet<[email protected]>" ); - -/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as102_drv.h +0 -2
@@ -143,5 +143,3 @@int as102_dvb_register_fe (struct as102_dev_t *dev,struct dvb_frontend *fe);int as102_dvb_unregister_fe (struct dvb_frontend *dev);#endif - -/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as102_fe.c +0 -2
@@ -671,5 +671,3 @@ } }#endif - -/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as102_fw.c +0 -2
@@ -247,5 +247,3 @@ return errno; }#endif - -/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as102_fw.h +0 -2
@@ -36,5 +36,3 @@#ifdef __KERNEL__int as102_fw_upload (struct as102_bus_adapter_t *bus_adap);#endif - -/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as102_usb_drv.c +0 -2
@@ -482,5 +482,3 @@ }MODULE_DEVICE_TABLE (usb, as102_usb_id_table); - -/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as102_usb_drv.h +0 -1
@@ -61,4 +61,3 @@ struct as10x_cmd_t r; };#endif -/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
drivers/staging/as102/as10x_cmd.h +0 -1
@@ -534,4 +534,3 @@ }#endif #endif -/* EOF - vim: set textwidth=80 ts=3 sw=3 sts=3 et: */
PATCH 7/7 staging/as102: cleanup - get rid unnecessary LINUX and WIN32 defines
In reply to a message not in the archivestaging/as102: cleanup - get rid unnecessary LINUX and WIN32 defines
Cleanup code: Remove of unnecessary defines WIN32 and LINUX.
We are always on linux so code (includes) for WIN32 compatibility is totally useless.
drivers/staging/as102/as10x_cmd.c +0 -21
@@ -18,29 +18,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#if defined(LINUX )&& defined(__KERNEL__)/* linux kernel implementation */ #include <linux/kernel.h> #include "as102_drv.h" -#elif defined(WIN32 ) -#if defined(__BUILDMACHINE__)&& (__BUILDMACHINE__ == WinDDK) -/* win32 ddk implementation */ -#include "wdm.h" -#include "Device.h" -#include "endian_mgmt.h" /* FIXME */ -#else /* win32 sdk implementation */ -#include <windows.h> -#include "types.h" -#include "util.h" -#include "as10x_handle.h" -#include "endian_mgmt.h" -#endif -#else /* all other cases */ -#include <string.h> -#include "types.h" -#include "util.h" -#include "as10x_handle.h" -#include "endian_mgmt.h" /* FIXME */ -#endif /* __KERNEL__ */ #include "as10x_types.h" #include "as10x_cmd.h"
drivers/staging/as102/as10x_cmd_cfg.c +0 -21
@@ -17,29 +17,8 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#if defined(LINUX )&& defined(__KERNEL__)/* linux kernel implementation */ #include <linux/kernel.h> #include "as102_drv.h" -#elif defined(WIN32 ) -#if defined(__BUILDMACHINE__)&& (__BUILDMACHINE__ == WinDDK) -/* win32 ddk implementation */ -#include "wdm.h" -#include "Device.h" -#include "endian_mgmt.h" /* FIXME */ -#else /* win32 sdk implementation */ -#include <windows.h> -#include "types.h" -#include "util.h" -#include "as10x_handle.h" -#include "endian_mgmt.h" -#endif -#else /* all other cases */ -#include <string.h> -#include "types.h" -#include "util.h" -#include "as10x_handle.h" -#include "endian_mgmt.h" /* FIXME */ -#endif /* __KERNEL__ */ #include "as10x_types.h" #include "as10x_cmd.h"
drivers/staging/as102/as10x_cmd_stream.c +0 -20
@@ -16,28 +16,8 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#if defined(LINUX )&& defined(__KERNEL__)/* linux kernel implementation */ #include <linux/kernel.h> #include "as102_drv.h" -#elif defined(WIN32 ) -#if defined(DDK )/* win32 ddk implementation */ -#include "wdm.h" -#include "Device.h" -#include "endian_mgmt.h" /* FIXME */ -#else /* win32 sdk implementation */ -#include <windows.h> -#include "types.h" -#include "util.h" -#include "as10x_handle.h" -#include "endian_mgmt.h" -#endif -#else /* all other cases */ -#include <string.h> -#include "types.h" -#include "util.h" -#include "as10x_handle.h" -#include "endian_mgmt.h" /* FIXME */ -#endif /* __KERNEL__ */ #include "as10x_cmd.h"
drivers/staging/as102/Makefile +1 -1
@@ -2,4 +2,4 @@ obj-$(CONFIG_DVB_AS102) += dvb-as102.o -EXTRA_CFLAGS += -DLINUX -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core +EXTRA_CFLAGS += -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/7 staging/as102: add new device nBox DVB-T Dongle
staging/as102: add new device nBox DVB-T Dongle
Add nBox DVB-T Dongle tuner based on 74e chip.
Tested by me on amd64.
drivers/staging/as102/as102_usb_drv.c +2 -0
@@ -41,6 +41,7 @@ { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) }, { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) }, + { USB_DEVICE(NBOX_DVBT_DONGLE_USB_VID, NBOX_DVBT_DONGLE_USB_PID) }, { } /* Terminating entry */ };
@@ -50,6 +51,7 @@AS102_REFERENCE_DESIGN ,AS102_PCTV_74E ,AS102_ELGATO_EYETV_DTT_NAME , +AS102_NBOX_DVBT_DONGLE_NAME , NULL /* Terminating entry */ };
drivers/staging/as102/as102_usb_drv.h +5 -0
@@ -42,6 +42,11 @@#define ELGATO_EYETV_DTT_USB_VID 0x0fd9#define ELGATO_EYETV_DTT_USB_PID 0x002c +/* nBox: nBox DVB-T Dongle */ +#define AS102_NBOX_DVBT_DONGLE_NAME "nBox DVB-T Dongle" +#define NBOX_DVBT_DONGLE_USB_VID 0x0b89 +#define NBOX_DVBT_DONGLE_USB_PID 0x0007 +#if (LINUX_VERSION_CODE <=KERNEL_VERSION (2 ,6 ,18 ))void as102_urb_stream_irq (struct urb *urb,struct pt_regs *regs);#else
PATCH 3/7 staging/as102: cleanup - get rid of typedefs
In reply to a message not in the archivestaging as102: cleanup - get rid off typedefs
Cleanup code: get rid of typedef in structures and union definitions.
drivers/staging/as102/as10x_cmd.h +59 -59
@@ -52,7 +52,7 @@/*********************************/ /* TYPE DEFINITION */ /*********************************/ -typedef enum { +enum control_proc {CONTROL_PROC_TURNON =0x0001 ,CONTROL_PROC_TURNON_RSP =0x0100 ,CONTROL_PROC_SET_REGISTER =0x0002 ,
@@ -92,11 +92,11 @@ CONTROL_PROC_DUMPLOG_MEMORY_RSP = 0xFE00, CONTROL_PROC_TURNOFF = 0x00FF,CONTROL_PROC_TURNOFF_RSP =0xFF00 -} control_proc; +};#pragma pack(1) -typedef union { +union TURN_ON {/* request */ struct {/* request identifier */
@@ -109,9 +109,9 @@/* error */ uint8_t error; } rsp; -}TURN_ON ; +}; -typedef union { +union TURN_OFF {/* request */ struct {/* request identifier */
@@ -124,9 +124,9 @@/* error */ uint8_t err; } rsp; -}TURN_OFF ; +}; -typedef union { +union SET_TUNE {/* request */ struct {/* request identifier */
@@ -141,9 +141,9 @@/* response error */ uint8_t error; } rsp; -}SET_TUNE ; +}; -typedef union { +union GET_TUNE_STATUS {/* request */ struct {/* request identifier */
@@ -158,9 +158,9 @@/* tune status */ struct as10x_tune_status sts; } rsp; -}GET_TUNE_STATUS ; +}; -typedef union { +union GET_TPS {/* request */ struct {/* request identifier */
@@ -175,9 +175,9 @@/* tps details */ struct as10x_tps tps; } rsp; -}GET_TPS ; +}; -typedef union { +union COMMON {/* request */ struct {/* request identifier */
@@ -190,9 +190,9 @@/* response error */ uint8_t error; } rsp; -}COMMON ; +}; -typedef union { +union ADD_PID_FILTER {/* request */ struct {/* request identifier */
@@ -213,9 +213,9 @@/* Filter id */ uint8_t filter_id; } rsp; -}ADD_PID_FILTER ; +}; -typedef union { +union DEL_PID_FILTER {/* request */ struct {/* request identifier */
@@ -230,9 +230,9 @@/* response error */ uint8_t error; } rsp; -}DEL_PID_FILTER ; +}; -typedef union { +union START_STREAMING {/* request */ struct {/* request identifier */
@@ -245,9 +245,9 @@/* error */ uint8_t error; } rsp; -}START_STREAMING ; +}; -typedef union { +union STOP_STREAMING {/* request */ struct {/* request identifier */
@@ -260,9 +260,9 @@/* error */ uint8_t error; } rsp; -}STOP_STREAMING ; +}; -typedef union { +union GET_DEMOD_STATS {/* request */ struct {/* request identifier */
@@ -277,9 +277,9 @@/* demod stats */ struct as10x_demod_stats stats; } rsp; -}GET_DEMOD_STATS ; +}; -typedef union { +union GET_IMPULSE_RESP {/* request */ struct {/* request identifier */
@@ -294,9 +294,9 @@/* impulse response ready */ uint8_t is_ready; } rsp; -}GET_IMPULSE_RESP ; +}; -typedef union { +union FW_CONTEXT {/* request */ struct {/* request identifier */
@@ -319,9 +319,9 @@/* error */ uint8_t error; } rsp; -}FW_CONTEXT ; +}; -typedef union { +union SET_REGISTER {/* request */ struct {/* response identifier */
@@ -338,9 +338,9 @@/* error */ uint8_t error; } rsp; -}SET_REGISTER ; +}; -typedef union { +union GET_REGISTER {/* request */ struct {/* response identifier */
@@ -357,9 +357,9 @@/* register content */ struct as10x_register_value reg_val; } rsp; -}GET_REGISTER ; +}; -typedef union { +union CFG_CHANGE_MODE {/* request */ struct {/* request identifier */
@@ -374,7 +374,7 @@/* error */ uint8_t error; } rsp; -}CFG_CHANGE_MODE ; +};struct as10x_cmd_header_t {uint16_t req_id;
@@ -384,7 +384,7 @@ };#define DUMP_BLOCK_SIZE 16 -typedef union { +union DUMP_MEMORY {/* request */ struct {/* request identifier */
@@ -411,9 +411,9 @@uint32_t data32[DUMP_BLOCK_SIZE /sizeof (uint32_t )]; } u; } rsp; -}DUMP_MEMORY ; +}; -typedef union { +union DUMPLOG_MEMORY {struct {/* request identifier */ uint16_t proc_id;
@@ -430,9 +430,9 @@/* dump data */ uint8_t data[DUMP_BLOCK_SIZE ]; } rsp; -}DUMPLOG_MEMORY ; +}; -typedef union { +union RAW_DATA {/* request */ struct {uint16_t proc_id;
@@ -445,32 +445,32 @@uint8_t data[64 -sizeof (struct as10x_cmd_header_t )/* header */ -2 /* proc_id */ -1 /* rc */ ]; } rsp; -}RAW_DATA ; +};struct as10x_cmd_t {/* header */ struct as10x_cmd_header_t header;/* body */ union { -TURN_ON turn_on; -TURN_OFF turn_off; -SET_TUNE set_tune; -GET_TUNE_STATUS get_tune_status; -GET_TPS get_tps; -COMMON common; -ADD_PID_FILTER add_pid_filter; -DEL_PID_FILTER del_pid_filter; -START_STREAMING start_streaming; -STOP_STREAMING stop_streaming; -GET_DEMOD_STATS get_demod_stats; -GET_IMPULSE_RESP get_impulse_rsp; -FW_CONTEXT context; -SET_REGISTER set_register; -GET_REGISTER get_register; -CFG_CHANGE_MODE cfg_change_mode; -DUMP_MEMORY dump_memory; -DUMPLOG_MEMORY dumplog_memory; -RAW_DATA raw_data; +union TURN_ON turn_on; +union TURN_OFF turn_off; +union SET_TUNE set_tune; +union GET_TUNE_STATUS get_tune_status; +union GET_TPS get_tps; +union COMMON common; +union ADD_PID_FILTER add_pid_filter; +union DEL_PID_FILTER del_pid_filter; +union START_STREAMING start_streaming; +union STOP_STREAMING stop_streaming; +union GET_DEMOD_STATS get_demod_stats; +union GET_IMPULSE_RESP get_impulse_rsp; +union FW_CONTEXT context; +union SET_REGISTER set_register; +union GET_REGISTER get_register; +union CFG_CHANGE_MODE cfg_change_mode; +union DUMP_MEMORY dump_memory; +union DUMPLOG_MEMORY dumplog_memory; +union RAW_DATA raw_data; } body; };
PATCH 4/7 staging/as102: cleanup - formatting code
In reply to a message not in the archivestaging as102: cleanup - formatting code
Cleanup code: change double spaces into single, put tabs instead of spaces where they should be.
drivers/staging/as102/as102_drv.c +27 -27
@@ -10,7 +10,7 @@* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
@@ -115,7 +115,7 @@ }static int as10x_pid_filter (struct as102_dev_t *dev, -int index,u16 pid,int onoff) { +int index,u16 pid,int onoff) {struct as102_bus_adapter_t *bus_adap =&dev->bus_adap;int ret = -EFAULT ;
@@ -129,22 +129,22 @@switch (onoff) {case 0 : - ret =as10x_cmd_del_PID_filter (bus_adap, (uint16_t ) pid); -dprintk (debug,"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n" , - index, pid, ret); -break ; + ret =as10x_cmd_del_PID_filter (bus_adap, (uint16_t ) pid); +dprintk (debug,"DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n" , + index, pid, ret); +break ;case 1 : { -struct as10x_ts_filter filter; +struct as10x_ts_filter filter; - filter.type =TS_PID_TYPE_TS ; - filter.idx =0xFF ; - filter.pid = pid; - - ret =as10x_cmd_add_PID_filter (bus_adap,&filter); -dprintk (debug,"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n" , - index, filter.idx, filter.pid, ret); -break ; + filter.type =TS_PID_TYPE_TS ; + filter.idx =0xFF ; + filter.pid = pid; + + ret =as10x_cmd_add_PID_filter (bus_adap,&filter); +dprintk (debug,"ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n" , + index, filter.idx, filter.pid, ret); +break ; } }
@@ -209,22 +209,22 @@#if defined(CONFIG_DVB_CORE ) || defined(CONFIG_DVB_CORE_MODULE ) ret =dvb_register_adapter (&as102_dev->dvb_adap, - as102_dev->name, -THIS_MODULE , + as102_dev->name, +THIS_MODULE , #if defined(CONFIG_AS102_USB) - &as102_dev->bus_adap.usb_dev->dev + &as102_dev->bus_adap.usb_dev->dev#elif defined(CONFIG_AS102_SPI ) - &as102_dev->bus_adap.spi_dev->dev + &as102_dev->bus_adap.spi_dev->dev#else #error >>> dvb_register_adapter<<<#endif #ifdef DVB_DEFINE_MOD_OPT_ADAPTER_NR - , adapter_nr + , adapter_nr#endif - ); + );if (ret<0 ) {err ("%s: dvb_register_adapter() failed (errno = %d)" , - __func__, ret); + __func__, ret); goto failed; }
@@ -235,7 +235,7 @@ as102_dev->dvb_dmx.stop_feed = as102_dvb_dmx_stop_feed; as102_dev->dvb_dmx.dmx.capabilities =DMX_TS_FILTERING | -DMX_SECTION_FILTERING ; +DMX_SECTION_FILTERING ; as102_dev->dvb_dmxdev.filternum = as102_dev->dvb_dmx.filternum; as102_dev->dvb_dmxdev.demux =&as102_dev->dvb_dmx.dmx;
@@ -250,14 +250,14 @@ ret =dvb_dmxdev_init (&as102_dev->dvb_dmxdev,&as102_dev->dvb_adap);if (ret<0 ) {err ("%s: dvb_dmxdev_init() failed (errno = %d)" , __func__, - ret); + ret); goto failed; } ret =as102_dvb_register_fe (as102_dev,&as102_dev->dvb_fe);if (ret<0 ) {err ("%s: as102_dvb_register_frontend() failed (errno = %d)" , - __func__, ret); + __func__, ret); goto failed; }#endif
@@ -278,7 +278,7 @@ "firmware_class");#endif -failed: + failed:LEAVE ();/* FIXME: free dvb_XXX */ return ret;
@@ -332,7 +332,7 @@/** * \brief as102 driver exit point. This function is called when device has -* to be removed. +* to be removed. */ static void __exit as102_driver_exit(void) {
drivers/staging/as102/as102_drv.h +3 -3
@@ -9,7 +9,7 @@* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
@@ -48,8 +48,8 @@ } } while (0)#ifdef TRACE -#define ENTER () printk(">> enter %s\n", __FUNCTION__) -#define LEAVE () printk("<< leave %s\n", __FUNCTION__) +#define ENTER () printk(">> enter %s\n", __FUNCTION__) +#define LEAVE () printk("<< leave %s\n", __FUNCTION__)#else #define ENTER ()#define LEAVE ()
drivers/staging/as102/as102_fe.c +72 -72
290 lines not on this page · raw message
drivers/staging/as102/as102_fw.c +20 -20
@@ -10,7 +10,7 @@* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
@@ -52,8 +52,8 @@* Parse INTEL HEX firmware file to extract address and data. */ static int parse_hex_line (unsigned char *fw_data,unsigned char *addr, -unsigned char *data,int *dataLength, -unsigned char *addr_has_changed) { +unsigned char *data,int *dataLength, +unsigned char *addr_has_changed) {int count =0 ;unsigned char *src, dst;
@@ -84,8 +84,8 @@else *addr_has_changed =0 ;break ; -case 4 : -case 5 : +case 4 : +case 5 :if (*addr_has_changed) addr[(count -4 )] = dst;else
@@ -103,8 +103,8 @@ }static int as102_firmware_upload (struct as102_bus_adapter_t *bus_adap, -unsigned char *cmd, -const struct firmware *firmware) { +unsigned char *cmd, +const struct firmware *firmware) {struct as10x_fw_pkt_t fw_pkt;int total_read_bytes =0 , errno =0 ;
@@ -134,8 +134,8 @@/* send EOF command */ errno = bus_adap->ops->upload_fw_pkt (bus_adap, - (uint8_t *) - &fw_pkt,2 ,0 ); + (uint8_t *) + &fw_pkt,2 ,0 );if (errno<0 ) goto error; }else {
@@ -149,16 +149,16 @@/* send cmd to device */ errno = bus_adap->ops->upload_fw_pkt (bus_adap, - (uint8_t *) - &fw_pkt, - data_len, -0 ); + (uint8_t *) + &fw_pkt, + data_len, +0 );if (errno<0 ) goto error; } } } -error: + error:LEAVE ();return (errno ==0 ) ? total_read_bytes : errno; }
@@ -199,7 +199,7 @@ errno =request_firmware (&firmware, fw1,&dev->dev);if (errno<0 ) {printk (KERN_ERR "%s: unable to locate firmware file: %s\n" , -DRIVER_NAME , fw1); +DRIVER_NAME , fw1); goto error; }
@@ -207,12 +207,12 @@ errno =as102_firmware_upload (bus_adap, cmd_buf, firmware);if (errno<0 ) {printk (KERN_ERR "%s: error during firmware upload part1\n" , -DRIVER_NAME ); +DRIVER_NAME ); goto error; }printk (KERN_INFO "%s: fimrware: %s loaded with success\n" , -DRIVER_NAME , fw1); +DRIVER_NAME , fw1);release_firmware (firmware);/* wait for boot to complete */
@@ -222,7 +222,7 @@ errno =request_firmware (&firmware, fw2,&dev->dev);if (errno<0 ) {printk (KERN_ERR "%s: unable to locate firmware file: %s\n" , -DRIVER_NAME , fw2); +DRIVER_NAME , fw2); goto error; }
@@ -230,13 +230,13 @@ errno =as102_firmware_upload (bus_adap, cmd_buf, firmware);if (errno<0 ) {printk (KERN_ERR "%s: error during firmware upload part2\n" , -DRIVER_NAME ); +DRIVER_NAME ); goto error; }printk (KERN_INFO "%s: fimrware: %s loaded with success\n" ,DRIVER_NAME , fw2); -error: + error:/* free data buffer */ kfree (cmd_buf);/* release firmware if needed */
drivers/staging/as102/as102_fw.h +1 -1
@@ -9,7 +9,7 @@* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
drivers/staging/as102/as102_usb_drv.c +71 -71
270 lines not on this page · raw message
drivers/staging/as102/as102_usb_drv.h +1 -1
@@ -10,7 +10,7 @@* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
drivers/staging/as102/as10x_cmd.c +88 -88
353 lines not on this page · raw message
drivers/staging/as102/as10x_cmd_cfg.c +46 -46
184 lines not on this page · raw message
drivers/staging/as102/as10x_cmd.h +384 -385
896 lines not on this page · raw message
drivers/staging/as102/as10x_cmd_stream.c +31 -31
149 lines not on this page · raw message
drivers/staging/as102/as10x_handle.h +10 -10
@@ -9,7 +9,7 @@* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
@@ -24,13 +24,13 @@#include "as10x_cmd.h" /* values for "mode" field */ -#define REGMODE8 8 -#define REGMODE16 16 -#define REGMODE32 32 +#define REGMODE8 8 +#define REGMODE16 16 +#define REGMODE32 32struct as102_priv_ops_t {int (*upload_fw_pkt) (struct as102_bus_adapter_t *bus_adap, -unsigned char *buf,int buflen,int swap32); +unsigned char *buf,int buflen,int swap32);int (*send_cmd) (struct as102_bus_adapter_t *bus_adap,unsigned char *buf,int buflen);
@@ -40,7 +40,7 @@ unsigned char *recv_buf, int recv_buf_len);/* int (*pid_filter) (struct as102_bus_adapter_t *bus_adap, -int index, u16 pid, int onoff); +int index, u16 pid, int onoff); */ int (*start_stream) (struct as102_dev_t *dev);void (*stop_stream) (struct as102_dev_t *dev);
@@ -48,11 +48,11 @@int (*reset_target) (struct as102_bus_adapter_t *bus_adap);int (*read_write)(struct as102_bus_adapter_t *bus_adap,uint8_t mode, -uint32_t rd_addr,uint16_t rd_len, -uint32_t wr_addr,uint16_t wr_len); +uint32_t rd_addr,uint16_t rd_len, +uint32_t wr_addr,uint16_t wr_len);int (*as102_read_ep2) (struct as102_bus_adapter_t *bus_adap, -unsigned char *recv_buf, - int recv_buf_len); +unsigned char *recv_buf, + int recv_buf_len); };#endif
drivers/staging/as102/as10x_types.h +119 -119
302 lines not on this page · raw message
Re: [PATCH 4/7] staging/as102: cleanup - formatting code
Quoted 7 lines · Piotr Chmura
staging as102: cleanup - formatting code
Cleanup code: change double spaces into single, put tabs instead of spaces where they should be.
Signed-off-by Piotr Chmura<[email protected]>Cc Devin Heitmueller<[email protected]>Cc Greg HK<[email protected]>
Just a few hints from my side. Most of my comments apply to multiple other parts of the code, but I did not want to quote everything and you should be able to find the other parts I did not mention explicitely as well.
I don't have much knowledge of kernel code style, but wanted to point out a few things that seem to be obviously wrong or uncommon, and stuff I wouldn't do. There may be a few false positives and some things missing.
[And yes, I actually only wanted to comment on the two-space thing, but I somehow ended up reading the complete patch or the first half of it].
drivers/staging/as102/as102_drv.c line 16
Quoted 13 lines
diff -Nur
linux.as102.03-typedefs/drivers/staging/as102/as102_drv.clinux.as102.04-tabs/drivers/staging/as102/as102_drv.cdrivers/staging/as102/as102_drv.c +1
-1@@ -10,7 +10,7 @@* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
For reference, the standard variant uses two spaces after the period (aka English Spacing).
drivers/staging/as102/as102_drv.c line 284
Quoted 5 lines
drivers/staging/as102/as102_drv.c +1
-1-failed: + failed:LEAVE ();/* FIXME: free dvb_XXX */ return ret;
It's more common to have no indentation before labels (about 7 times more common).
drivers/staging/as102/as102_drv.c line 336
Quoted 7 lines
drivers/staging/as102/as102_drv.c +1
-1@@ -332,7 +332,7 @@/** * \brief as102 driver exit point. This function is called when device has -* to be removed. +* to be removed. */
Does it make sense to reindent that? If you intent to keep API documentation comments, you want to convert them to kernel-doc style anyway.
Quoted 4 lines
drivers/staging/as102/as102_drv.c +1
-1dprintk (debug,"min_delay_ms = %d -> %d\n" , settings->min_delay_ms, -1000 ); +1000 );#endif
Seems to be more indentation than really required.
drivers/staging/as102/as102_drv.c line 205
Quoted 7 lines
drivers/staging/as102/as102_drv.c +1
-1@@ -201,7 +201,7 @@break ;case TUNE_STATUS_STREAM_TUNED : *status =FE_HAS_SIGNAL |FE_HAS_CARRIER |FE_HAS_SYNC | -FE_HAS_LOCK ; +FE_HAS_LOCK ;break ;
I think it looks better with indentation here. Otherwise you might not read the | at the end of the previous line and think FE_HAS_LOCK is a strange macro evaluating to a function call. Moving the operator into the second line would also make this even more clear.
drivers/staging/as102/as102_drv.c
Quoted 7 lines
drivers/staging/as102/as102_drv.c +2
-2#else - .release = as102_fe_release, - .init = as102_fe_init, + .release = as102_fe_release, + .init = as102_fe_init,#endif };
Is there a reason why struct members are indented using two tabs (here and elsewhere)?
drivers/staging/as102/as102_drv.c line 397
Quoted 8 lines
drivers/staging/as102/as102_drv.c +1
-1@@ -393,7 +393,7 @@ }int as102_dvb_register_fe (struct as102_dev_t *as102_dev, -struct dvb_frontend *dvb_fe) +struct dvb_frontend *dvb_fe) {
If there's still space to align further to the right, why not use it? It makes the code look better if parameters are aligned below each other (or at least nearly).
drivers/staging/as102/as102_drv.c line 411
Quoted 9 lines
drivers/staging/as102/as102_drv.c +1
-1int errno;struct dvb_adapter *dvb_adap;@@ -407,7 +407,7 @@/* init frontend callback ops */ memcpy (&dvb_fe->ops,&as102_fe_ops,sizeof (struct dvb_frontend_ops ));strncpy (dvb_fe->ops.info.name, as102_dev->name, -sizeof (dvb_fe->ops.info.name)); +sizeof (dvb_fe->ops.info.name));
It does not seem helpful to align like this, it certainly looks much uglier than the old one which had sizeof aligned with dvb.
drivers/staging/as102/as102_drv.c line 644
Quoted 5 lines
drivers/staging/as102/as102_drv.c +0
-0/* set frequency */ @@ -642,32 +642,32 @@* if HP/LP are both set to FEC_NONE, HP will be selected. */ if ((tune_args->hierarchy != HIER_NONE)&&
Misses a space before the &&
Quoted 4 lines
drivers/staging/as102/as102_drv.c +0
-2dprintk(debug, "\thierarchy: 0x%02x " "selected: %s code_rate_%s: 0x%02x\n", - tune_args->hierarchy, - tune_args->hier_select == HIER_HIGH_PRIORITY ?
drivers/staging/as102/as102_drv.c line 652
Quoted 10 lines
drivers/staging/as102/as102_drv.c +6
-4- "HP" : "LP", - tune_args->hier_select ==HIER_HIGH_PRIORITY ? -"HP" :"LP" , - tune_args->code_rate); + tune_args->hierarchy, + tune_args->hier_select ==HIER_HIGH_PRIORITY ? +"HP" :"LP" , + tune_args->hier_select ==HIER_HIGH_PRIORITY ? +"HP" :"LP" , + tune_args->code_rate);
You indented the second argument one level further than the first one. And the third argument even more.
drivers/staging/as102/as102_drv.c line 655
Quoted 5 lines
drivers/staging/as102/as102_drv.c +2
-2errno = bus_adap->ops->upload_fw_pkt (bus_adap, - (uint8_t *) - &fw_pkt,2 ,0 ); + (uint8_t *) + &fw_pkt,2 ,0 );
Splitting after the "&fw_pkt," seems more sensible, as you have the cast and its operand on the same line then.
Quoted 8 lines
drivers/staging/as102/as102_drv.c +0
-1static int as102_usb_start_stream (struct as102_dev_t *dev);static void as102_usb_stop_stream (struct as102_dev_t *dev);@@ -38,59 +38,59 @@static int as102_release (struct inode *inode,struct file *file);static struct usb_device_id as102_usb_id_table[] = { - {USB_DEVICE (AS102_USB_DEVICE_VENDOR_ID ,AS102_USB_DEVICE_PID_0001 ) },
drivers/staging/as102/as102_drv.c line 46
Quoted 10 lines
drivers/staging/as102/as102_drv.c +5
-4- { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, - { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) }, - { USB_DEVICE(NBOX_DVBT_DONGLE_USB_VID, NBOX_DVBT_DONGLE_USB_PID) }, - { } /* Terminating entry */ + { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) }, + { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, + { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) }, + { USB_DEVICE(NBOX_DVBT_DONGLE_USB_VID, NBOX_DVBT_DONGLE_USB_PID) }, + { } /* Terminating entry */ };
Again, two levels of indentation do not add anything valuable.
Quoted 6 lines
drivers/staging/as102/as102_drv.c +1
-2/* Note that this table must always have the same number of entries as the -as102_usb_id_table struct */ +as102_usb_id_table struct */ static const char *as102_device_names[] = { -AS102_REFERENCE_DESIGN ,
drivers/staging/as102/as102_drv.c line 55
Quoted 10 lines
drivers/staging/as102/as102_drv.c +5
-4-AS102_PCTV_74E , -AS102_ELGATO_EYETV_DTT_NAME , -AS102_NBOX_DVBT_DONGLE_NAME , - NULL /* Terminating entry */ +AS102_REFERENCE_DESIGN , +AS102_PCTV_74E , +AS102_ELGATO_EYETV_DTT_NAME , +AS102_NBOX_DVBT_DONGLE_NAME , + NULL /* Terminating entry */ };
Same here and at a lot of other locations.
[I stopped here]
Signature · 3 lines
Julian Andres Klode - Debian Developer, Ubuntu Member See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.
Re: [PATCH 4/7] staging/as102: cleanup - formatting code
Quoted 13 lines · Julian Andres Klode
Quoted 7 lines · Piotr Chmura
staging as102: cleanup - formatting code
Cleanup code: change double spaces into single, put tabs instead of spaces where they should be.
Signed-off-by Piotr Chmura<[email protected]>Cc Devin Heitmueller<[email protected]>Cc Greg HK<[email protected]>Just a few hints from my side. Most of my comments apply to multiple other parts of the code, but I did not want to quote everything and you should be able to find the other parts I did not mention explicitely as well.
Quoted 6 lines
I don't have much knowledge of kernel code style, but wanted to point out a few things that seem to be obviously wrong or uncommon, and stuff I wouldn't do. There may be a few false positives and some things missing.
[And yes, I actually only wanted to comment on the two-space thing, but I somehow ended up reading the complete patch or the first half of it].
I think that rather than having Piotr rework the whitespace fifty times until everybody is satisfied, let's get a functional patch series into the staging tree and then people can submit whitespace cleanup patches to their hearts content.
That said, Piotr, I would not spend effort reworking the existing patch per Julian's request. Fix the issues related to the history that I mentioned in my previous email (which would be required to get it into staging), and then the people who have nothing better to do than obsess about whitespace can submit incremental patches on top of yours which address their concerns.
Devin
Signature · 2 lines
Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com
Re: [PATCH 4/7] staging/as102: cleanup - formatting code
Quoted 2 lines · Devin Heitmueller
then the people who have nothing better to do than obsess about whitespace can submit incremental patches
You're right that the white space changes aren't needed to get the driver into staging, but there is no need to get snarky about it. Julian was replying to problems that a specific patch introduced and everything he said was correct. Piotr was already going to redo the patches anyway.
regards,
dan carpenter
PATCH 5/7 staging as102: cleanup - get rid of pragma(pack)
In reply to a message not in the archivestaging as102: cleanup - get rid of pragma(pack)
Cleanup code: change #pragma(pack) directive to __attribute__(packed)
/drivers/staging/as102/as102_fw.h renamed from drivers/staging/as102/as102_fw.h +2 -4
@@ -20,11 +20,10 @@extern int dual_tuner; -#pragma pack(1)struct as10x_raw_fw_pkt {unsigned char address[4 ];unsigned char data[MAX_FW_PKT_SIZE -6 ]; -}; +} __attribute__((packed)); struct as10x_fw_pkt_t { union {
@@ -32,8 +31,7 @@unsigned char length[2 ]; } u;struct as10x_raw_fw_pkt raw; -}; -#pragma pack() +} __attribute__((packed));#ifdef __KERNEL__int as102_fw_upload (struct as102_bus_adapter_t *bus_adap);
/drivers/staging/as102/as10x_cmd.h renamed from drivers/staging/as102/as10x_cmd.h +22 -24
184 lines not on this page · raw message
/drivers/staging/as102/as10x_types.h renamed from drivers/staging/as102/as10x_types.h +6 -9
@@ -111,7 +111,6 @@#define CFG_MODE_OFF 1#define CFG_MODE_AUTO 2 -#pragma pack(1)struct as10x_tps {uint8_t constellation;uint8_t hierarchy;
@@ -123,7 +122,7 @@uint8_t DVBH_mask_HP;uint8_t DVBH_mask_LP;uint16_t cell_ID; -}; +} __attribute__((packed));struct as10x_tune_args {/* frequency */
@@ -144,7 +143,7 @@uint8_t guard_interval;/* transmission mode */ uint8_t transmission_mode; -}; +} __attribute__((packed));struct as10x_tune_status {/* tune status */
@@ -155,7 +154,7 @@uint16_t PER ;/* bit error rate 10^-4 */ uint16_t BER ; -}; +} __attribute__((packed));struct as10x_demod_stats {/* frame counter */
@@ -168,13 +167,13 @@uint16_t mer;/* statistics calculation state indicator (started or not) */ uint8_t has_started; -}; +} __attribute__((packed));struct as10x_ts_filter {uint16_t pid;/** valid PID value 0x00 : 0x2000 */ uint8_t type;/** Red TS_PID_TYPE_<N> values */ uint8_t idx;/** index in filtering table */ -}; +} __attribute__((packed));struct as10x_register_value {uint8_t mode;
@@ -183,9 +182,7 @@uint16_t value16;/* 16 bit value */ uint32_t value32;/* 32 bit value */ }u; -}; - -#pragma pack() +} __attribute__((packed));struct as10x_register_addr {/* register addr */
Quoted 83 lines · Patrick Dickey
Quoted 30 lines
Hello there,
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 3 lines
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
v4l-dvbwhich I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.gitwith a fatal: read error: Connection reset by peer.
Is it possible to clone either (or both) repositories at this time, or are they down? And in the absence of cloning the kernel for the media_tree.git repository, is it possible to simply clone the
git://linuxtv.org/media_tree.gitrepository and work from that?My interest in this is to install some patches created by Devin Heitmueller for the Pinnacle PCTV 80e USB tuner (at least the ATSC portion of the tuner). Once I'm able to determine exactly what changes are made, I would like to either submit the patches to the repository, or send them to someone who has more experience in patching the files for submission.
Quoted 6 lines
One other question (totally unrelated to this post though): When I send emails, normally they are GPG signed. Should I disable that for this list, or is it acceptable?
Thank you for any information, and have a great day:) Patrick.
Hi Patrick,
As I said on the blog, the issue isn't getting the driver to work against current kernels. Merging the driver against the current tree is a trivial exercise (the patch series should apply trivially against the current code, with only a few minor conflicts related to board numbers, etc).
The bigger issue though is once you do that and have the driver running, you now have a body of code > 10,000 lines which doesn't meet the "coding standards". Doing such a refactoring is a relatively straightforward exercise but very time consuming (you already have a working driver, so you just have to make sure you don't break anything).
The more I think about this, the more it annoys me. I did all the hard parts:
* I worked with the product vendor to get the details for the design
* I got Hauppauge/PCTV to compel the chipset vendor to release the reference code under a GPL compatible license
* I worked out redistribution terms on the firmware
* I ported the driver to Linux
* I integrated the driver and debugged it to achieve signal lockAnd why is it not in the mainline? Because none of the above matters if I didn't waste a bunch of my time removing a bunch of "#ifdef WINDOWS" lines and converting whitespace from tabs to spaces.
It's crap like this that's the reason why some of the best LinuxTV driver authors still have a bunch of stuff that isn't merged upstream.
We just don't have time for this sort of bullshit that any monkey
could do if he/she was willing to invest the effort. We're just too busy doing *actual* driver work.Five years ago the hard part was finding competent developers, getting access to datasheets, getting access to reference driver code, and getting access to the details for a hardware design. Now most of those problems are not the issue - we have access to all the data but we want to waste the time of the few competent developers out there making them do "coding style cleanup" before perfectly good code gets merged upstream. There has been more than one case where I've considered doing a driver for a new board and decided against it because the barrier to getting it upstream is not worth my time.
Quoted 4 lines
Want to see more device support upstream? Optimize the process to make it easy for the people who know the hardware and how to write the drivers to get code upstream, and leave it to the "janitors" to work out the codingstyle issues.
Mate, I feel sorry for you :-(
Quoted 8 lines · Patrick Dickey
Hello there,
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvb
Quoted 8 lines
which I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.gitwith a fatal: read error: Connection reset by peer.
The linux tree is at: https://github.com/torvalds/linux
git clone git://github.com/torvalds/linux.git
The Mauro's media tree is at: http://git.linuxtv.org/mchehab/media-next.git
Quoted 7 lines · Patrick Dickey
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvb
Quoted 7 lines
which I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.gitwith a fatal: read error: Connection reset by peer.
The git error should be fixed now.
But please don't clone from linuxtv.org, intead use git clone git://github.com/torvalds/linux.git
and then add linuxtv to your repo like described on
http://git.linuxtv.org/media_tree.git
Johannes
Em 25-09-2011 15:03, Johannes Stezenbach escreveu:
Quoted 14 lines · Patrick Dickey
Quoted 13 lines
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvbwhich I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.git
Quoted 8 lines
Quoted 1 line
with a fatal: read error: Connection reset by peer.
The git error should be fixed now.
But please don't clone from linuxtv.org, intead use git clone
git://github.com/torvalds/linux.git
and then add linuxtv to your repo like described on
http://git.linuxtv.org/media_tree.git
I've updated the instructions together with the git tree to point to the github tree.
Btw, the media_build had an issue due to the move of tm6000 and altera-stapl out of staging. I've fixed it. At least here with 3.0 kernel, everything is compiling fine.
Cheers,
Mauro
Quoted 7 lines
Johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
2011/9/26 Mauro Carvalho Chehab <[email protected]>:
Quoted 19 lines
Em 25-09-2011 15:03, Johannes Stezenbach escreveu:
Quoted 18 lines · Patrick Dickey
Quoted 7 lines
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvbQuoted 7 lines
which I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.gitwith a fatal: read error: Connection reset by peer.
The git error should be fixed now.
Quoted 8 lines
Quoted 4 lines
But please don't clone from linuxtv.org, intead use git clone
git://github.com/torvalds/linux.git
and then add linuxtv to your repo like described on
http://git.linuxtv.org/media_tree.gitI've updated the instructions together with the git tree to point to the github tree.
I followed your instructions using http instead, but I found it's not up to date.
scott@scott-desktop:~/Projects/git-kernel/v4l-dvb$ git log commit 69d232ae8e95a229e7544989d6014e875deeb121 Author: Sakari Ailus <[email protected]> Date: Wed Jun 15 15:58:48 2011 -0300
[media] omap3isp: ccdc: Use generic frame sync event instead of
private HS_VS event
scott@scott-desktop:~/Projects/git-kernel/v4l-dvb$ git remote -v linuxtv http://linuxtv.org/git/media_tree.git (fetch) linuxtv http://linuxtv.org/git/media_tree.git (push) origin http://github.com/torvalds/linux.git (fetch) origin http://github.com/torvalds/linux.git (push)
Can anybody tell me why?
Quoted 8 lines · Scott Jiang
2011/9/26 Mauro Carvalho Chehab <[email protected]>:
Quoted 7 lines
Em 25-09-2011 15:03, Johannes Stezenbach escreveu:
Quoted 5 lines
But please don't clone from linuxtv.org, intead use git clone
git://github.com/torvalds/linux.git
and then add linuxtv to your repo like described on
http://git.linuxtv.org/media_tree.git
Quoted 5 lines
Quoted 3 lines
I've updated the instructions together with the git tree to point to the github tree.
I followed your instructions using http instead, but I found it's not up to date.
What I meant is the follow the instructions on the
http://git.linuxtv.org/media_tree.git web page, to use git:// protocol:
git remote add linuxtv git://linuxtv.org/media_tree.git
git remote update
git checkout -b media-master remotes/linuxtv/staging/for_v3.2
Anyway, I did the git update-server-info thing so http should work, too. But git over http sucks, if you can then use git protocol.
Johannes
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I ran into that issue yesterday, but figured that I'd caused enough of a headache asking about the problems already--so I decided to wait and see if it was fixed this morning.
Thank you (even though I didn't report the issue), and have a great day:) Patrick.
Quoted 27 lines · Mauro Carvalho Chehab
Em 25-09-2011 15:03, Johannes Stezenbach escreveu:
Quoted 14 lines · Patrick Dickey
Quoted 13 lines
I tried to follow the steps for cloning both the "media_tree.git" and "media_build.git" repositories, and received errors for both. The
media_treerepository failed on the first lineQuoted 1 line
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitv4l-dvbwhich I'm assuming is because kernel.org is down.
The media_build.git repository fails on the first line also
Quoted 1 line
git clone
git://linuxtv.org/media_build.gitQuoted 8 lines
Quoted 1 line
with a fatal: read error: Connection reset by peer.
The git error should be fixed now.
But please don't clone from linuxtv.org, intead use git clone
git://github.com/torvalds/linux.git
and then add linuxtv to your repo like described on
http://git.linuxtv.org/media_tree.gitI've updated the instructions together with the git tree to point to the github tree.
Quoted 14 lines
Btw, the
media_buildhad an issue due to the move of tm6000 and altera-stapl out of staging. I've fixed it. At least here with 3.0 kernel, everything is compiling fine.Cheers,
MauroQuoted 7 lines
Johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk6AYZ0ACgkQMp6rvjb3CAQj1QCffarBsYJw3Dx8sowrXF0i0gnF tugAoKBFVFcRcX8jHyQM1vMKpX3qz6Ks
=GGGa
-----END PGP SIGNATURE-----