Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some typo and newline issues. #687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shaswata56
Copy link

some simple fixing and making more efficient.

some simple fixing and making more efficient.
@KernelPRBot
Copy link

Hi @shaswata56!

Thanks for your contribution to the Linux kernel!

Linux kernel development happens on mailing lists, rather than on GitHub - this GitHub repository is a read-only mirror that isn't used for accepting contributions. So that your change can become part of Linux, please email it to us as a patch.

Sending patches isn't quite as simple as sending a pull request, but fortunately it is a well documented process.

Here's what to do:

  • Format your contribution according to kernel requirements
  • Decide who to send your contribution to
  • Set up your system to send your contribution as an email
  • Send your contribution and wait for feedback

How do I format my contribution?

The Linux kernel community is notoriously picky about how contributions are formatted and sent. Fortunately, they have documented their expectations.

Firstly, all contributions need to be formatted as patches. A patch is a plain text document showing the change you want to make to the code, and documenting why it is a good idea.

You can create patches with git format-patch.

Secondly, patches need 'commit messages', which is the human-friendly documentation explaining what the change is and why it's necessary.

Thirdly, changes have some technical requirements. There is a Linux kernel coding style, and there are licensing requirements you need to comply with.

Both of these are documented in the Submitting Patches documentation that is part of the kernel.

Note that you will almost certainly have to modify your existing git commits to satisfy these requirements. Don't worry: there are many guides on the internet for doing this.

Who do I send my contribution to?

The Linux kernel is composed of a number of subsystems. These subsystems are maintained by different people, and have different mailing lists where they discuss proposed changes.

If you don't already know what subsystem your change belongs to, the get_maintainer.pl script in the kernel source can help you.

get_maintainer.pl will take the patch or patches you created in the previous step, and tell you who is responsible for them, and what mailing lists are used. You can also take a look at the MAINTAINERS file by hand.

Make sure that your list of recipients includes a mailing list. If you can't find a more specific mailing list, then LKML - the Linux Kernel Mailing List - is the place to send your patches.

It's not usually necessary to subscribe to the mailing list before you send the patches, but if you're interested in kernel development, subscribing to a subsystem mailing list is a good idea. (At this point, you probably don't need to subscribe to LKML - it is a very high traffic list with about a thousand messages per day, which is often not useful for beginners.)

How do I send my contribution?

Use git send-email, which will ensure that your patches are formatted in the standard manner. In order to use git send-email, you'll need to configure git to use your SMTP email server.

For more information about using git send-email, look at the Git documentation or type git help send-email. There are a number of useful guides and tutorials about git send-email that can be found on the internet.

How do I get help if I'm stuck?

Firstly, don't get discouraged! There are an enormous number of resources on the internet, and many kernel developers who would like to see you succeed.

Many issues - especially about how to use certain tools - can be resolved by using your favourite internet search engine.

If you can't find an answer, there are a few places you can turn:

If you get really, really stuck, you could try the owners of this bot, @daxtens and @ajdlinux. Please be aware that we do have full-time jobs, so we are almost certainly the slowest way to get answers!

I sent my patch - now what?

You wait.

You can check that your email has been received by checking the mailing list archives for the mailing list you sent your patch to. Messages may not be received instantly, so be patient. Kernel developers are generally very busy people, so it may take a few weeks before your patch is looked at.

Then, you keep waiting. Three things may happen:

  • You might get a response to your email. Often these will be comments, which may require you to make changes to your patch, or explain why your way is the best way. You should respond to these comments, and you may need to submit another revision of your patch to address the issues raised.
  • Your patch might be merged into the subsystem tree. Code that becomes part of Linux isn't merged into the main repository straight away - it first goes into the subsystem tree, which is managed by the subsystem maintainer. It is then batched up with a number of other changes sent to Linus for inclusion. (This process is described in some detail in the kernel development process guide).
  • Your patch might be ignored completely. This happens sometimes - don't take it personally. Here's what to do:
    • Wait a bit more - patches often take several weeks to get a response; more if they were sent at a busy time.
    • Kernel developers often silently ignore patches that break the rules. Check for obvious violations of the Submitting Patches guidelines, the style guidelines, and any other documentation you can find about your subsystem. Check that you're sending your patch to the right place.
    • Try again later. When you resend it, don't add angry commentary, as that will get your patch ignored. It might also get you silently blacklisted.

Further information

Happy hacking!

This message was posted by a bot - if you have any questions or suggestions, please talk to my owners, @ajdlinux and @daxtens, or raise an issue at https://github.com/ajdlinux/KernelPRBot.

@hbina
Copy link

hbina commented Jun 8, 2019

Perhaps I am misguided, but isn't doing the same thing twice unnecessary?

Additionally, the coding guideline clearly states that braces are unnecessary for single statement branches.

https://elixir.bootlin.com/linux/latest/source/Documentation/process/coding-style.rst#L175

@shaswata56
Copy link
Author

Thanks for your reply. I was thinking about memory. Isn't kernel memory so precious?

@hbina
Copy link

hbina commented Jun 8, 2019

No, this is not a dynamically allocated memory so it will go out scope as soon as this function is done. Additionally, a single integer worth nothing compared to having to evaluate the same values twice.

@shaswata56
Copy link
Author

Thanks for your explanation. 👍

atorgue pushed a commit to STMicroelectronics/linux that referenced this pull request Jun 10, 2019
[ Upstream commit a1c6ca3 ]

It is possible to observe hung_task complaints when system goes to
suspend-to-idle state:

 # echo freeze > /sys/power/state

 PM: Syncing filesystems ... done.
 Freezing user space processes ... (elapsed 0.001 seconds) done.
 OOM killer disabled.
 Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
 sd 0:0:0:0: [sda] Synchronizing SCSI cache
 INFO: task bash:1569 blocked for more than 120 seconds.
       Not tainted 4.19.0-rc3_+ torvalds#687
 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 bash            D    0  1569    604 0x00000000
 Call Trace:
  ? __schedule+0x1fe/0x7e0
  schedule+0x28/0x80
  suspend_devices_and_enter+0x4ac/0x750
  pm_suspend+0x2c0/0x310

Register a PM notifier to disable the detector on suspend and re-enable
back on wakeup.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
trilean pushed a commit to trilean/linux that referenced this pull request Jun 15, 2019
[ Upstream commit a1c6ca3 ]

It is possible to observe hung_task complaints when system goes to
suspend-to-idle state:

 # echo freeze > /sys/power/state

 PM: Syncing filesystems ... done.
 Freezing user space processes ... (elapsed 0.001 seconds) done.
 OOM killer disabled.
 Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
 sd 0:0:0:0: [sda] Synchronizing SCSI cache
 INFO: task bash:1569 blocked for more than 120 seconds.
       Not tainted 4.19.0-rc3_+ torvalds#687
 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 bash            D    0  1569    604 0x00000000
 Call Trace:
  ? __schedule+0x1fe/0x7e0
  schedule+0x28/0x80
  suspend_devices_and_enter+0x4ac/0x750
  pm_suspend+0x2c0/0x310

Register a PM notifier to disable the detector on suspend and re-enable
back on wakeup.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
0lvin pushed a commit to free-z4u/roc-rk3328-cc that referenced this pull request Oct 19, 2019
It is possible to observe hung_task complaints when system goes to
suspend-to-idle state:

 # echo freeze > /sys/power/state

 PM: Syncing filesystems ... done.
 Freezing user space processes ... (elapsed 0.001 seconds) done.
 OOM killer disabled.
 Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
 sd 0:0:0:0: [sda] Synchronizing SCSI cache
 INFO: task bash:1569 blocked for more than 120 seconds.
       Not tainted 4.19.0-rc3_+ torvalds#687
 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
 bash            D    0  1569    604 0x00000000
 Call Trace:
  ? __schedule+0x1fe/0x7e0
  schedule+0x28/0x80
  suspend_devices_and_enter+0x4ac/0x750
  pm_suspend+0x2c0/0x310

Register a PM notifier to disable the detector on suspend and re-enable
back on wakeup.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ojeda added a commit to ojeda/linux that referenced this pull request Feb 27, 2022
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Aug 11, 2023
Fully initialize detector_work work struct to avoid this kernel warning
when lockdep is enabled:

 =====================================
 WARNING: bad unlock balance detected!
 6.5.0-rc5+ torvalds#687 Not tainted
 -------------------------------------
 swapper/0/1 is trying to release lock (detector_work) at:
 [<000000004037e554>] __flush_work+0x60/0x658
 but there are no more locks to release!

 other info that might help us debug this:
 no locks held by swapper/0/1.

 stack backtrace:
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-rc5+ torvalds#687
 Hardware name: 9000/785/C3700
 Backtrace:
  [<0000000041455d5c>] print_unlock_imbalance_bug.part.0+0x20c/0x230
  [<000000004040d5e8>] lock_release+0x2e8/0x3f8
  [<000000004037e5cc>] __flush_work+0xd8/0x658
  [<000000004037eb7c>] flush_work+0x30/0x60
  [<000000004011f140>] lockup_detector_check+0x54/0x128
  [<0000000040306430>] do_one_initcall+0x9c/0x408
  [<0000000040102d44>] kernel_init_freeable+0x688/0x7f0
  [<000000004146df68>] kernel_init+0x64/0x3a8
  [<0000000040302020>] ret_from_kernel_thread+0x20/0x28

Signed-off-by: Helge Deller <deller@gmx.de>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Aug 12, 2023
Fully initialize detector_work work struct to avoid this kernel warning
when lockdep is enabled:

 =====================================
 WARNING: bad unlock balance detected!
 6.5.0-rc5+ torvalds#687 Not tainted
 -------------------------------------
 swapper/0/1 is trying to release lock (detector_work) at:
 [<000000004037e554>] __flush_work+0x60/0x658
 but there are no more locks to release!

 other info that might help us debug this:
 no locks held by swapper/0/1.

 stack backtrace:
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-rc5+ torvalds#687
 Hardware name: 9000/785/C3700
 Backtrace:
  [<0000000041455d5c>] print_unlock_imbalance_bug.part.0+0x20c/0x230
  [<000000004040d5e8>] lock_release+0x2e8/0x3f8
  [<000000004037e5cc>] __flush_work+0xd8/0x658
  [<000000004037eb7c>] flush_work+0x30/0x60
  [<000000004011f140>] lockup_detector_check+0x54/0x128
  [<0000000040306430>] do_one_initcall+0x9c/0x408
  [<0000000040102d44>] kernel_init_freeable+0x688/0x7f0
  [<000000004146df68>] kernel_init+0x64/0x3a8
  [<0000000040302020>] ret_from_kernel_thread+0x20/0x28

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request Aug 13, 2023
Fully initialize detector_work work struct to avoid this kernel warning
when lockdep is enabled:

 =====================================
 WARNING: bad unlock balance detected!
 6.5.0-rc5+ torvalds#687 Not tainted
 -------------------------------------
 swapper/0/1 is trying to release lock (detector_work) at:
 [<000000004037e554>] __flush_work+0x60/0x658
 but there are no more locks to release!

 other info that might help us debug this:
 no locks held by swapper/0/1.

 stack backtrace:
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-rc5+ torvalds#687
 Hardware name: 9000/785/C3700
 Backtrace:
  [<0000000041455d5c>] print_unlock_imbalance_bug.part.0+0x20c/0x230
  [<000000004040d5e8>] lock_release+0x2e8/0x3f8
  [<000000004037e5cc>] __flush_work+0xd8/0x658
  [<000000004037eb7c>] flush_work+0x30/0x60
  [<000000004011f140>] lockup_detector_check+0x54/0x128
  [<0000000040306430>] do_one_initcall+0x9c/0x408
  [<0000000040102d44>] kernel_init_freeable+0x688/0x7f0
  [<000000004146df68>] kernel_init+0x64/0x3a8
  [<0000000040302020>] ret_from_kernel_thread+0x20/0x28

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants