<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/cmdline.c, branch v5.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-08-24T21:17:44Z</updated>
<entry>
<title>lib: Revert use of fallthrough pseudo-keyword in lib/</title>
<updated>2020-08-24T21:17:44Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-08-24T20:36:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a9dc5fd6170d0a41c8a14eb19e63d94bea5705a'/>
<id>urn:sha1:6a9dc5fd6170d0a41c8a14eb19e63d94bea5705a</id>
<content type='text'>
The following build error for powerpc64 was reported by Nathan Chancellor:

  "$ scripts/config --file arch/powerpc/configs/powernv_defconfig -e KERNEL_XZ

   $ make -skj"$(nproc)" ARCH=powerpc CROSS_COMPILE=powerpc64le-linux- distclean powernv_defconfig zImage
   ...
   In file included from arch/powerpc/boot/../../../lib/decompress_unxz.c:234,
                    from arch/powerpc/boot/decompress.c:38:
   arch/powerpc/boot/../../../lib/xz/xz_dec_stream.c: In function 'dec_main':
   arch/powerpc/boot/../../../lib/xz/xz_dec_stream.c:586:4: error: 'fallthrough' undeclared (first use in this function)
     586 |    fallthrough;
         |    ^~~~~~~~~~~

   This will end up affecting distribution configurations such as Debian
   and OpenSUSE according to my testing. I am not sure what the solution
   is, the PowerPC wrapper does not set -D__KERNEL__ so I am not sure
   that compiler_attributes.h can be safely included."

In order to avoid these sort of problems, it seems that the best
solution is to use /* fall through */ comments instead of the
fallthrough pseudo-keyword macro in lib/, for now.

Reported-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Fixes: df561f6688fe ("treewide: Use fallthrough pseudo-keyword")
Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Reviewed-and-tested-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>treewide: Use fallthrough pseudo-keyword</title>
<updated>2020-08-23T22:36:59Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-08-23T22:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=df561f6688fef775baa341a0f5d960becd248b11'/>
<id>urn:sha1:df561f6688fef775baa341a0f5d960becd248b11</id>
<content type='text'>
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 230</title>
<updated>2019-06-19T15:09:06Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-03T05:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=40b0b3f8fb2d8f55d13ceed41593d46689a6b496'/>
<id>urn:sha1:40b0b3f8fb2d8f55d13ceed41593d46689a6b496</id>
<content type='text'>
Based on 2 normalized pattern(s):

  this source code is licensed under the gnu general public license
  version 2 see the file copying for more details

  this source code is licensed under general public license version 2
  see

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 52 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190602204653.449021192@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>lib/cmdline.c: mark expected switch fall-throughs</title>
<updated>2019-04-08T23:39:23Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-01-25T20:25:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8a05452ca460b05c985eadc7b5a4f040f124463e'/>
<id>urn:sha1:8a05452ca460b05c985eadc7b5a4f040f124463e</id>
<content type='text'>
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warnings:

lib/cmdline.c:137:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/cmdline.c:140:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/cmdline.c:143:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/cmdline.c:146:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
lib/cmdline.c:149:7: warning: this statement may fall through [-Wimplicit-fallthrough=]

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough.

Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
</content>
</entry>
<entry>
<title>lib/cmdline.c: remove meaningless comment</title>
<updated>2017-09-09T01:26:49Z</updated>
<author>
<name>Baoquan He</name>
<email>bhe@redhat.com</email>
</author>
<published>2017-09-08T23:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7c61bd6983b185272315722787cceacf5f5d2e7d'/>
<id>urn:sha1:7c61bd6983b185272315722787cceacf5f5d2e7d</id>
<content type='text'>
One line of code was commented out by c++ style comment for debugging, but
forgot removing it.

Clean it up.

Link: http://lkml.kernel.org/r/1503312113-11843-1-git-send-email-bhe@redhat.com
Signed-off-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/cmdline.c: fix get_options() overflow while parsing ranges</title>
<updated>2017-06-23T23:15:55Z</updated>
<author>
<name>Ilya Matveychikov</name>
<email>matvejchikov@gmail.com</email>
</author>
<published>2017-06-23T22:08:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a91e0f680bcd9e10c253ae8b62462a38bd48f09f'/>
<id>urn:sha1:a91e0f680bcd9e10c253ae8b62462a38bd48f09f</id>
<content type='text'>
When using get_options() it's possible to specify a range of numbers,
like 1-100500.  The problem is that it doesn't track array size while
calling internally to get_range() which iterates over the range and
fills the memory with numbers.

Link: http://lkml.kernel.org/r/2613C75C-B04D-4BFF-82A6-12F97BA0F620@gmail.com
Signed-off-by: Ilya V. Matveychikov &lt;matvejchikov@gmail.com&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>boot/param: Move next_arg() function to lib/cmdline.c for later reuse</title>
<updated>2017-04-18T08:37:13Z</updated>
<author>
<name>Baoquan He</name>
<email>bhe@redhat.com</email>
</author>
<published>2017-04-17T13:34:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f51b17c8d90f85456579c3192ab59ee031835634'/>
<id>urn:sha1:f51b17c8d90f85456579c3192ab59ee031835634</id>
<content type='text'>
next_arg() will be used to parse boot parameters in the x86/boot/compressed code,
so move it to lib/cmdline.c for better code reuse.

No change in functionality.

Signed-off-by: Baoquan He &lt;bhe@redhat.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Jessica Yu &lt;jeyu@redhat.com&gt;
Cc: Johannes Berg &lt;johannes.berg@intel.com&gt;
Cc: Josh Triplett &lt;josh@joshtriplett.org&gt;
Cc: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Niklas Söderlund &lt;niklas.soderlund+renesas@ragnatech.se&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Petr Mladek &lt;pmladek@suse.com&gt;
Cc: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: dan.j.williams@intel.com
Cc: dave.jiang@intel.com
Cc: dyoung@redhat.com
Cc: keescook@chromium.org
Cc: zijun_hu &lt;zijun_hu@htc.com&gt;
Link: http://lkml.kernel.org/r/1492436099-4017-2-git-send-email-bhe@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib: Add a generic cmdline parse function parse_option_str</title>
<updated>2014-10-03T17:40:58Z</updated>
<author>
<name>Dave Young</name>
<email>dyoung@redhat.com</email>
</author>
<published>2014-08-14T09:15:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ccc72b87b83ece31c2a75bbe07f440b0378f7a9'/>
<id>urn:sha1:6ccc72b87b83ece31c2a75bbe07f440b0378f7a9</id>
<content type='text'>
There should be a generic function to parse params like a=b,c
Adding parse_option_str in lib/cmdline.c which will return true
if there's specified option set in the params.

Also updated efi=old_map parsing code to use the new function

Signed-off-by: Dave Young &lt;dyoung@redhat.com&gt;
Signed-off-by: Matt Fleming &lt;matt.fleming@intel.com&gt;
</content>
</entry>
<entry>
<title>lib/cmdline.c: add size unit t/p/e to memparse</title>
<updated>2014-08-07T01:01:25Z</updated>
<author>
<name>Gui Hecheng</name>
<email>guihc.fnst@cn.fujitsu.com</email>
</author>
<published>2014-08-06T23:09:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e004f3c7780de32fa822f292ebadd985bcadb1e0'/>
<id>urn:sha1:e004f3c7780de32fa822f292ebadd985bcadb1e0</id>
<content type='text'>
For modern filesystems such as btrfs, t/p/e size level operations are
common.  add size unit t/p/e parsing to memparse

Signed-off-by: Gui Hecheng &lt;guihc.fnst@cn.fujitsu.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Reviewed-by: Satoru Takeuchi &lt;takeuchi_satoru@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/cmdline.c: declare exported symbols immediately</title>
<updated>2014-01-24T00:36:57Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2014-01-23T23:54:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ff6f9bbb582c1cb00cbe7ecd96bcde229fd336f7'/>
<id>urn:sha1:ff6f9bbb582c1cb00cbe7ecd96bcde229fd336f7</id>
<content type='text'>
WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
+EXPORT_SYMBOL(memparse);

WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
+EXPORT_SYMBOL(get_option);

WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
+EXPORT_SYMBOL(get_options);

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Cc: Levente Kurusa &lt;levex@linux.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
