From patchwork Wed Dec 23 12:55:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 351447 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp6172371jai; Wed, 23 Dec 2020 04:56:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwExJ6CramLIfizn7/PEVtOXgt7f6fGtz+FtMQkVTxGcZCHD4jra6nPObCwVZgEJ0PzocHh X-Received: by 2002:a17:906:4756:: with SMTP id j22mr24561704ejs.353.1608728165578; Wed, 23 Dec 2020 04:56:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608728165; cv=none; d=google.com; s=arc-20160816; b=peknlV/70lnXK0zpN4Rd2ajBCXXDYEtkVouyz22n3e769v+XkucmZFszmq8DMMd82c oAdHgiH5r4FNFo+jvKO5S1ezWvM8RdVFC2qLdr9+b5MFE1FAg717ICR29AinQ5hcUgrv sNg+uGzcuL3ruYli7fxIXphut6qeljIUsKf19iN1iFvHkA8N/B3mOEU+hz0oE881pxcL y6XxjQwsPCvoUp8F7fg2Pr0L1OR/XyBkUdR38KTEpPQFO7YSHmE0138dz8rwuOe+Lwam k7DkMJGWTgr9Q1Z6QcBYACLKbCfrDpLFu/9oFLy5s4HUXHupiX5fdq8RKT1uzkH0q2oY LVJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=Ugopsy/ZxytmB8ap3xn0lUro0TDiqP7g+knq07e92AU=; b=rCfyvKVXpUQfp3UWlPVg5Jfkx5/acWiChrt2c4Kpi/OMJBU80IvpVAUn0yBFCoze80 iJl4iUUYPXQhIKh7MnQts8gbhqjfVOERl4/mi+3gADdtB12SKtvZHr7AytulJHmB6rX3 EW6xGMeKE18X78iPWJ4p8/RHGUHBwwzdp12LHjgfdG60W0lt/XXORZCJkW31+UvLGNGy y+RyiIg5iBtC+/n9n5xGIA9nF2uniaLu3/egxbi8OeM9YILq/NuD+VI98AOT7ETw+3uK rwKWPUOOyRPxyuvf8g8fBldCPlc2nVQ9ZkrdTATX+E3ndreEDrMlDcNlpr22uJ+Ur+zo vDpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=i56HKmN1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id g4si14345534edn.483.2020.12.23.04.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 04:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=i56HKmN1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A2E282763; Wed, 23 Dec 2020 13:55:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="i56HKmN1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8CE2082763; Wed, 23 Dec 2020 13:55:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1BADD8272D for ; Wed, 23 Dec 2020 13:55:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201223125535euoutp02187700a61acb3028003de0d156328291~TWbdJc2da3178531785euoutp02d for ; Wed, 23 Dec 2020 12:55:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201223125535euoutp02187700a61acb3028003de0d156328291~TWbdJc2da3178531785euoutp02d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608728135; bh=Ugopsy/ZxytmB8ap3xn0lUro0TDiqP7g+knq07e92AU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i56HKmN1cDQWn3AOJuzS0TNNJSzTrfVuxAlv+882bovMPQtobdHgaAL2IrETlc2vy t+6CCbveTkdrxKA22h90lshuTszmDBeiu2KmgT6l5uoZpAenI7HnDywRQ14iy8SRJQ PXKi8Us6wjNiN+HM2jOizlK0YR70b8xRzabB6VMI= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201223125535eucas1p1d7ab629e8ca96db7b5e3d29691c2de08~TWbc5CqpQ1720517205eucas1p1I; Wed, 23 Dec 2020 12:55:35 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 76.D4.44805.74E33EF5; Wed, 23 Dec 2020 12:55:35 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201223125534eucas1p2388f9e307ba4fdb85ba1dfea6184e60f~TWbcZH3mf3007930079eucas1p2m; Wed, 23 Dec 2020 12:55:34 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201223125534eusmtrp1fc3bdda0e0b9f1c5221a0dc911f508e1~TWbcYdko82414524145eusmtrp1k; Wed, 23 Dec 2020 12:55:34 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-0a-5fe33e4712d2 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 81.E8.16282.54E33EF5; Wed, 23 Dec 2020 12:55:34 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201223125533eusmtip272ced7a62106ce7bd246aa64d2ee59e7~TWbbVie212198421984eusmtip2T; Wed, 23 Dec 2020 12:55:33 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de Cc: Marek Szyprowski , Lukasz Majewski , Simon Glass , Heinrich Schuchardt , Jaehoon Chung , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 2/6] disk: dos: add some defines for the hardcoded numbers Date: Wed, 23 Dec 2020 13:55:11 +0100 Message-Id: <20201223125515.28865-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201223125515.28865-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSe0hTcRTmt3vvdh1cu66FJwuCtexF9qBo9NCGhqsIy17WH61lty2c03az h1BZkTmzLIevieI/Zi6nKcu0MpulRqUtp6hl2UPJIs2RrSapebtW/33nO98DDofEJIN4AHnI cIQxGjR6mVCMVzV6ny8KD/6gXpJ23VdRkVNOKDpHkgnFx0GXQGF79Fqk8NirkGKg1iRSPMwc QutEqrykF7iqwPIYVw2596qau6uR6rLdirYQe8RrDjD6Q0cZ4+LgfWLdl8obKN4kPv7dayeS UD6ZinxIoJdD3/A7YSoSkxL6OoJnnlYBPwwjMLnKJodvCCp68rG/lmspDsRhCV2MoP+t8p8j 0/texC2E9FJIHUgVclhKA4yktyNOhNFjCBwjboJbTKUjYDizZAKTJE7PAYv5TwFFr4Xe8TqC L5sFN24++MP70MHgKUwhuBygM0m43Zsv4rxAh8HFh0pePxU+N9lFPJ4JT81pOK8/h+Bdi03E D2kIXGdzEK9aDd0tI0IuCKPnQ/mdxTytBNfXFoLP94XOAT+OxiZgRlU2xtMUpCRLeHUgWJrK /tU6nK2Tt1KB1+GZPO9VBMW3mrEraJblf1khQlbkzySwsVqGXWZgjgWxmlg2waANio6LrUQT L/F0rGm4GhV/dgfVIwGJ6hGQmExKtU75oJZQBzQnEhljnNqYoGfYejSDxGX+1H57qVpCazVH mBiGiWeMf7cC0icgSVAwmt8sF4corct30FRedIVn45ewVZVmqiGib8UqpXORR36pch2rvr9h 89a4BrnN3ZLeHtBU+4bI7ojXpbQ6O8LuLawZ9dvl6P35oxHv8hRFvuwIlCamO888KFM7d58G 1pq1/XvfMzLcjPSumLKxXSsbuy++eP3k/PjjxJ1mWU/4lhLJQfbkwZ7Cnqi2bR0mEkUWRGVs 8h0cMITWlc/1080X1hSMYmxIcv/Z8ZOaxtklVKghJDrGRG0jaoPqc6esidJrNTffyl+Fdx2e t6KrOTDrxylbHjO9VNZWFD13uttq+iTtn/brbuf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1p2388f9e307ba4fdb85ba1dfea6184e60f X-Msg-Generator: CA X-RootMTR: 20201223125534eucas1p2388f9e307ba4fdb85ba1dfea6184e60f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201223125534eucas1p2388f9e307ba4fdb85ba1dfea6184e60f References: <20201223125515.28865-1-m.szyprowski@samsung.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add some handy defines for some hardcoded magic numbers related to extended partition handling. Signed-off-by: Marek Szyprowski --- disk/part_dos.c | 6 +++--- disk/part_dos.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/disk/part_dos.c b/disk/part_dos.c index ef706fb59c..20d35dc9cd 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -42,9 +42,9 @@ static inline unsigned int le32_to_int(unsigned char *le32) static inline int is_extended(int part_type) { - return (part_type == 0x5 || - part_type == 0xf || - part_type == 0x85); + return (part_type == DOS_PART_TYPE_EXTENDED || + part_type == DOS_PART_TYPE_EXTENDED_LBA || + part_type == DOS_PART_TYPE_EXTENDED_LINUX); } static int get_bootable(dos_partition_t *p) diff --git a/disk/part_dos.h b/disk/part_dos.h index 434b021ae8..dd909a9317 100644 --- a/disk/part_dos.h +++ b/disk/part_dos.h @@ -15,6 +15,9 @@ #define DOS_PBR_MEDIA_TYPE_OFFSET 0x15 #define DOS_MBR 0 #define DOS_PBR 1 +#define DOS_PART_TYPE_EXTENDED 0x05 +#define DOS_PART_TYPE_EXTENDED_LBA 0x0F +#define DOS_PART_TYPE_EXTENDED_LINUX 0x85 typedef struct dos_partition { unsigned char boot_ind; /* 0x80 - active */