mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
block/partitions/acorn: use min in {riscix,linux}_partition
Use min() to replace the open-coded implementations and to simplify riscix_partition() and linux_partition(). Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
1 parent
6636e16e60
commit
aa528cd12c
1 file changed
+3
-2
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/adfs_fs.h>
|
||||
#include <linux/minmax.h>
|
||||
|
||||
#include "check.h"
|
||||
|
||||
@@ -80,7 +81,7 @@ static int riscix_partition(struct parsed_partitions *state,
|
||||
|
||||
|
||||
if (rr->magic == RISCIX_MAGIC) {
|
||||
unsigned long size = nr_sects > 2 ? 2 : nr_sects;
|
||||
unsigned long size = min(nr_sects, 2);
|
||||
int part;
|
||||
|
||||
seq_buf_puts(&state->pp_buf, " <");
|
||||
@@ -124,7 +125,7 @@ static int linux_partition(struct parsed_partitions *state,
|
||||
{
|
||||
Sector sect;
|
||||
struct linux_part *linuxp;
|
||||
unsigned long size = nr_sects > 2 ? 2 : nr_sects;
|
||||
unsigned long size = min(nr_sects, 2);
|
||||
|
||||
seq_buf_puts(&state->pp_buf, " [Linux]");
|
||||
|
||||
|
||||
Reference in new issue
Block a user