Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4053422ybf; Tue, 3 Mar 2020 18:58:06 -0800 (PST) X-Google-Smtp-Source: ADFU+vtfbCdB4MYIt2v0m3jwxSxyxLy9kQbr185F5hj57LcVs5OnlWnmBPNZyvaPiCOQGTcwGrd/ X-Received: by 2002:aca:724a:: with SMTP id p71mr393867oic.23.1583290686687; Tue, 03 Mar 2020 18:58:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583290686; cv=none; d=google.com; s=arc-20160816; b=gd/GInkFFdSgucxIv4C0JNbU2Kk/S4WI1nk/JGPs7a3RJ1MUM0go21QDbfObN5GU0Z LHmThUwV0NyNZh4zv1a63cbFi1U8pXGanSkgmOcTmBDl4gEnD8+PsgXq5YhYfh58uN/K w5B08PC3Tg9DkieyUoQdsbQnEgYKkR1n5eWFtmPwIVPPkFgUWBTULleTalQ4doaQgKDp BGBomZVTLYxWemAgfesK/AKHciiem1weCAE6QBTwGo+R2IVXQhqOOk/jH/60eJTKlmuP qReX7bWLii8wxxCfrOCVzmo7xcKtoDR0MnGlhRkZzk24EnZxLfT2Cs29vboFWi0xzrkW OD4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+OjRhnFwB7N+qUCZlu/luvxZ8XB1cxUBw5E13DY1Vig=; b=S21fEhxIBcdb7SUDrD7PlmfGvTLDew8POl0PY1zqJ8NxL4waP0uDh7d+WfM6/rDWn6 fh6p4/2eX+aUxbl48pyvw+lnrDlZtbum/dBZ3TdSMO07h0RrPPotBEY9zKd5AaU0WR3Q x02+KsJqp3YwePQaRrvkvKD9uz6AP6AU5/uoKuxOzYQYXS/8j39/qQtP2qZyShQeqat/ 9TUFkf+ceK4YBjUtQJg/cTaZxf0dPV2t9Wz68ZaL322X+gprw33W0LL6OW/WNia0Cb/X 6qIFH3WW3eHtCmFoPSeFAkeAcKKxXeBUbkcvcWUWzh/o/6JXstHpnLI4A1ntzv6b1bu6 WAjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=fUEzAh3r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si365078oix.12.2020.03.03.18.57.55; Tue, 03 Mar 2020 18:58:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=fUEzAh3r; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387662AbgCDC5r (ORCPT + 99 others); Tue, 3 Mar 2020 21:57:47 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:35834 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2387632AbgCDC5q (ORCPT ); Tue, 3 Mar 2020 21:57:46 -0500 X-UUID: 4aaa21494cca4d39b117c5462c09cb46-20200304 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=+OjRhnFwB7N+qUCZlu/luvxZ8XB1cxUBw5E13DY1Vig=; b=fUEzAh3rXpG5C2POnjlKfnH3PbxtLkJa7kro+Q8KlvQ9046Dx1FRZ8HaEqc7+YQ7GGwQqMGiEsqLj2QkS3VRjJHYr+qv6t6rWFI9pJ54TuT84GPlLPKADBV3hM1auBkYtoab+HaaTDWWgD73vMcU2TalaholUHVS/3m/FWT2E5Y=; X-UUID: 4aaa21494cca4d39b117c5462c09cb46-20200304 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 329796184; Wed, 04 Mar 2020 10:57:38 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 4 Mar 2020 10:54:56 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 4 Mar 2020 10:58:16 +0800 From: To: CC: , , , , , , Light Hsieh Subject: [PATCH v1 2/3] mmc: check write-protection status during BLKROSET ioctl Date: Wed, 4 Mar 2020 10:57:34 +0800 Message-ID: <1583290655-7858-3-git-send-email-light.hsieh@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1583290655-7858-1-git-send-email-light.hsieh@mediatek.com> References: <1583290655-7858-1-git-send-email-light.hsieh@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 63251A378050ECF85D71DFBD113D2C84C2393C7DCDFE261DE9F78EBB0CBD561D2000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogTGlnaHQgSHNpZWggPGxpZ2h0LmhzaWVoQG1lZGlhdGVrLmNvbT4NCg0KU2luY2UgTU1D IGxheWVyIGRvZXMgbm90IGltcGxlbWVudCBCTEtST1NFVCBpb2N0bCwgQkxL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