From patchwork Thu Dec 17 11:27:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344926 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1077386jai; Thu, 17 Dec 2020 03:29:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJygv6FOxaWjhHRA9XFU0RyS/GyfsrT9ehIFoQ7HpbP9JCdyAVjTe7GjVrHKGsYaGSDClU+u X-Received: by 2002:a17:906:94ca:: with SMTP id d10mr33250930ejy.62.1608204553318; Thu, 17 Dec 2020 03:29:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608204553; cv=none; d=google.com; s=arc-20160816; b=koh3/zsiA9FcIH6IWhVP5cUlNvX/1pvZvnnCL+fcl9p2bQRWgSPZ/lGPpA442NwEll DLuVGTN3h0/t3LBLZ/A8JRJb1bS7AgW/PtVmUC110pHESEnz28+wBOqERAt9uyFY2/4D 6h8GIyLpiDBNbWm0EQzVKrcS28OMOnswzXTm/2sjD+pZW5tiDkayEqJhQcnGWlSb1Uze KCUH+HvEpnPWaHTgwPp+Ut/B6UdhGev3N9P3JAvj6sTXr0Dz8ObvpTSM8eVFWw8GeJDd j6fGuXJzWmqRjQTcDVHJ/LRbNjp04mPMDVlZBl/KSq/GKM0If3CEB4Tf9xeEg4zQ2RvB Uvtg== 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=wiw76WTVo+ecF0EYK6Fy/X9KIUOiVwNtoBJI+u9FiWfytLuuuMvGvjXohediB+16S5 t8WHdLXqA3SS1qWPQNKP4IlrXrmEUNQ+2QSrXnTyhOGMJWVXokudFKS4fGoj3pFIzGrm /3Ar0yNqqmB0+X78za0BBYNqsdWySC4N2XduEaU61OD9ViFwyzyeNtoFo/p6JxES1Gkm 0OZ4O4AUWe+90RX+kKQSbhdremMw45IL5FGt3I5Fp2UULpo78rgYZojl/rppLt7smy8+ v3KqFw40WjudFVrd51vTylGL4GIFCiEC6e+QImfvx2Qftcm5QKN7nyuVZnIhNohA/veO sy+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=bai8TmLw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id v25si2481876ejx.201.2020.12.17.03.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 03:29:13 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=bai8TmLw; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 91BFB82BB7; Thu, 17 Dec 2020 12:28:23 +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="bai8TmLw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BA7D882BB7; Thu, 17 Dec 2020 12:28:13 +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 1923682BA9 for ; Thu, 17 Dec 2020 12:28:10 +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 20201217112759euoutp02cba49467cf288efa86e33d4405baf10d~RfXQjbbB_2632826328euoutp02j for ; Thu, 17 Dec 2020 11:27:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201217112759euoutp02cba49467cf288efa86e33d4405baf10d~RfXQjbbB_2632826328euoutp02j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608204479; bh=Ugopsy/ZxytmB8ap3xn0lUro0TDiqP7g+knq07e92AU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bai8TmLwJHqWSC8yPEp+xr/umqqqijT4KNxOcdZyBhOR2tWavdnRjeoYhni5529T/ PSRQpDS90VrD/jQGL97Pyly8IFtqpVIIOcIJMsAxf0va/C76qMTBdRVrLHLB5x1W1r CLcHHjjQndAooyoMR9Jo9fTIwSGKJ8Eafnq71nkw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201217112746eucas1p1db9462ab77f1880cae59da39bbab64fa~RfXEONUKf3084730847eucas1p1Z; Thu, 17 Dec 2020 11:27:46 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E6.2B.44805.2B04BDF5; Thu, 17 Dec 2020 11:27:46 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201217112746eucas1p175764b65c7fedac5cf13ee4a29259fe3~RfXD0J0rq1609016090eucas1p1f; Thu, 17 Dec 2020 11:27:46 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201217112746eusmtrp2ac81e7fcc7bf5446501d15a50d7fe783~RfXDzd02J2732627326eusmtrp2E; Thu, 17 Dec 2020 11:27:46 +0000 (GMT) X-AuditID: cbfec7f4-b4fff7000000af05-a1-5fdb40b2eeaf Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 78.F0.16282.1B04BDF5; Thu, 17 Dec 2020 11:27:45 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201217112745eusmtip280b7ed94a98ba4bb7ff954d408d854e3~RfXDa0bVv2634826348eusmtip2p; Thu, 17 Dec 2020 11:27:45 +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 2/6] disk: dos: add some defines for the hardcoded numbers Date: Thu, 17 Dec 2020 12:27:35 +0100 Message-Id: <20201217112739.5045-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201217112739.5045-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VSa0xSYRj25RzgSOFOaPmtbCbTti5qVj/YslIzpbJlF7tYC6nO1KloHLGy WcyaAjolL9PJVCpNsygzZoWxlVZkNzNHdtHWvY0yJa0lUys6ZP+e2/s827ePwASD+EwiWZZJ yWXSVCGHh7feGe0KbAl7KVlUWectulR5kS165shjiz597WGJDLf6uaIfxlYQDZjVXFFH+RCE ccU6ZTcurqm6i4uH7LvFD/uugrjI2ASx7Hhe6D4qNTmLkgevSOAlfWk5Bxlq3sHvo0a2EqoJ DbgTiFyKfn5oxjXAIwRkIyDHu1cuMgKowDwEDBkGZDM95P47sVYoXUYDoNudb2HyZCJ3lOVM ccgQpBnQcJzYi0TIUWz9G8LICUA3HXa20/Ak16Lv+o6/tTgZgD42qnAn5pOh6LSu1zXni841 38A0QBDu5HLUkJ/l7EFkNYE67eO4U0dkJCodYDNxT2SzGF2nPujXtVoWkz8G6M0jA5chhYB6 ciuBSS1DfY8cHGcRRs5DF03BjByOzF0qNtPvgZ4NTHPK2B9Y0lqBMTIfqfIETHouqrJcmJy9 +fgJxmAxqtV9c72PFpBB7+Bowbfq/5geoAm8KQWdlkjRi2XUgSBamkYrZIlBe9PTWuDPn7g/ YRm5Cg02e1A7sAhoB0RgQi9+wo3nEgF/n/RQNiVPl8gVqRTdDrMIXOjN32M8LxGQidJMKoWi Mij5P5dFuM9UstwGxVWB2Z+sdVh4U8b7z/nWrZYja866GV6su6eXCG9tEK8vKne7VLIz7sfH Tb0RLeEqsOtWv955NLPH7/jhscNafWCzIVxGlIVOHYwo8DA5Tv8qLZG/xjdP5KujNrIOSbWN /bbIOuv26wtic/hDs3/6DVsMppNfx1cuG8w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YmR5/FCddM+8TqM1csp/bTdglj 95k3Ap8cPJw6fVG9N9vqNw4V92fNW3rx4ZX706PWL2t7JFCdP+XK1Ym83gfFrs6SOrU6+U3t uZVuvTlKMv55we1/J0gvEne9M12JpTgj0VCLuag4EQBo+/L24gIAAA== X-CMS-MailID: 20201217112746eucas1p175764b65c7fedac5cf13ee4a29259fe3 X-Msg-Generator: CA X-RootMTR: 20201217112746eucas1p175764b65c7fedac5cf13ee4a29259fe3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201217112746eucas1p175764b65c7fedac5cf13ee4a29259fe3 References: <20201217112739.5045-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 */