From patchwork Thu Oct 3 02:23:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 11172003 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4946B14DB for ; Thu, 3 Oct 2019 02:23:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20886222C2 for ; Thu, 3 Oct 2019 02:23:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="KNa9Ylbt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728045AbfJCCXU (ORCPT ); Wed, 2 Oct 2019 22:23:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34116 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbfJCCXT (ORCPT ); Wed, 2 Oct 2019 22:23:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uukNNW7qQ6N5xxrju+6gv/tEnkqzO22XeDWjNJoQQyk=; b=KNa9Ylbt3z+0evDhHHqfRkcPk Dr4iulViWFd8oQEUgM4iQH04/RYHGag++8UgL+bSUseuSfX4attrv1ZIIZelb2vkFghAUS7MrDwPB aF06K0aGZeurhUe2h5HvQXjc4MdsHbdQ7Gj/QvMQaX1qJlYK3IhZbmhyRky57w7lg2K8RPxEETpyx 1cqE5wCboCu1xz7oivx+2eqfyq1PcyKSOxLax/Hwz1b70vPNnauyoPw4Xu07DZ8bko0L2gLO9Y+Bv 43Imof9Wwdey9osWGd6Zx0jNQF94MJDb4G4k7Kgc5FCLQ66oaQFo2BWAv+xJG7VinINPIM+LhoayE Mm5oc6TnQ==; Received: from [2601:1c0:6280:3f0::9a1f] by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFqlm-0007pt-49; Thu, 03 Oct 2019 02:23:06 +0000 To: "linux-block@vger.kernel.org" , LKML Cc: axboe , Jonas Rabenstein , David Kozub From: Randy Dunlap Subject: [PATCH 1/2] block: sed-opal: fix sparse warning: obsolete array init. Message-ID: <807d7b7f-623b-75f0-baab-13b1b0c02e9d@infradead.org> Date: Wed, 2 Oct 2019 19:23:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Randy Dunlap Fix sparse warning: (missing '=') ../block/sed-opal.c:133:17: warning: obsolete array initializer, use C99 syntax Fixes: ff91064ea37c ("block: sed-opal: check size of shadow mbr") Signed-off-by: Randy Dunlap Cc: Jens Axboe Cc: linux-block@vger.kernel.org Cc: Jonas Rabenstein Cc: David Kozub Reviewed-by: Scott Bauer Reviewed-by:  Revanth Rajashekar Reviewed-by:  Revanth Rajashekar Reviewed-by: Jon Derrick --- block/sed-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- lnx-54-rc1.orig/block/sed-opal.c +++ lnx-54-rc1/block/sed-opal.c @@ -129,7 +129,7 @@ static const u8 opaluid[][OPAL_UID_LENGT { 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x84, 0x01 }, /* tables */ - [OPAL_TABLE_TABLE] + [OPAL_TABLE_TABLE] = { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01 }, [OPAL_LOCKINGRANGE_GLOBAL] = { 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x01 }, From patchwork Thu Oct 3 02:23:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 11172005 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0953914DB for ; Thu, 3 Oct 2019 02:23:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB54E222C3 for ; Thu, 3 Oct 2019 02:23:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NaPJx9TM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728095AbfJCCXU (ORCPT ); Wed, 2 Oct 2019 22:23:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34118 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727978AbfJCCXT (ORCPT ); Wed, 2 Oct 2019 22:23:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Date:Message-ID:Subject:Cc:From:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U7ID//fmK0I3/mly5XIM1JAun9eRn8qOXb/xC1yOZ7s=; b=NaPJx9TMnJtomA/xHlMbJXJx/ Kv5U6nRpEOmnvcwREafAzIkHSylrg5f9ndQnIXh6YOr3uIZNpOMrYhBQsD4qgBssYZsmn6ROzYX4E fh1mOxtv0iFAcnMtHgaeGZertTYtI5+i/3Fp7DSDFZX1//+MWqeODnzAq6+I3nn1er7tMfD80t+gD Yn/IXRUf/sYyJCS39srLolLw6nsxh6Bg1ncociCRUQsgArB3ZhfMhbQNU3ngh6dxQfGmRRD8yoIO2 tXtNiYrU8pWys8SxfjzORRVqeynIkzLaKx0tObmgvXshcGRJsijadIfxBB72hoBe6zL5bQnry7kWn QeaBdRTAg==; Received: from [2601:1c0:6280:3f0::9a1f] by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFqlv-0007r3-Mb; Thu, 03 Oct 2019 02:23:15 +0000 To: "linux-block@vger.kernel.org" , LKML , axboe From: Randy Dunlap Cc: Scott Bauer , Rafael Antognolli Subject: [PATCH 2/2] block: sed-opal: fix sparse warning: convert __be64 data Message-ID: <82f70133-7242-d113-f041-9b89694685c0@infradead.org> Date: Wed, 2 Oct 2019 19:23:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Randy Dunlap sparse warns about incorrect type when using __be64 data. It is not being converted to CPU-endian but it should be. Fixes these sparse warnings: ../block/sed-opal.c:375:20: warning: incorrect type in assignment (different base types) ../block/sed-opal.c:375:20: expected unsigned long long [usertype] align ../block/sed-opal.c:375:20: got restricted __be64 const [usertype] alignment_granularity ../block/sed-opal.c:376:25: warning: incorrect type in assignment (different base types) ../block/sed-opal.c:376:25: expected unsigned long long [usertype] lowest_lba ../block/sed-opal.c:376:25: got restricted __be64 const [usertype] lowest_aligned_lba Fixes: 455a7b238cd6 ("block: Add Sed-opal library") Signed-off-by: Randy Dunlap Cc: Scott Bauer Cc: Rafael Antognolli Cc: Jens Axboe Cc: linux-block@vger.kernel.org Reviewed-by: Jon Derrick --- If this code is known to work as is, it would be nice to have an explanation of it. Oh: maybe it's just that these fields are not used after they are saved/set. block/sed-opal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- lnx-54-rc1.orig/block/sed-opal.c +++ lnx-54-rc1/block/sed-opal.c @@ -372,8 +372,8 @@ static void check_geometry(struct opal_d { const struct d0_geometry_features *geo = data; - dev->align = geo->alignment_granularity; - dev->lowest_lba = geo->lowest_aligned_lba; + dev->align = be64_to_cpu(geo->alignment_granularity); + dev->lowest_lba = be64_to_cpu(geo->lowest_aligned_lba); } static int execute_step(struct opal_dev *dev,