Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1601356ybv; Fri, 14 Feb 2020 02:42:21 -0800 (PST) X-Google-Smtp-Source: APXvYqw/PPQHgz45Tmu/NGK125+lQ2OfVfCQQ5j9Qmi9XihK9rt14YPBu6l1tqs9CDtWeBiTU12g X-Received: by 2002:a9d:3e43:: with SMTP id h3mr1675537otg.84.1581676941568; Fri, 14 Feb 2020 02:42:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581676941; cv=none; d=google.com; s=arc-20160816; b=vtX+NgCcnftdt5q3I/MeAwX7CdoKboGZsrgzNPaY/4kIHOAFeZcEpc/QV9S+qivW+r udjHwsRX+3DFswedrJUUcFbvosCVUt6RZ61F2P3pGPiZ4HcIXAnROHHwqdjNVVgyo8MI gRAHepki7pklqfHKEmwFEvP1M5XytQtQwSPWlUiwCEpE6feitU35cFQr0QSpIepzMEfk Z7rgkwPNtuUvnX2YxNovhkho2J863UkLZaBCQy0xEDPaK0wBhDVXusGZIv3ndtzPop7a odQHWf4yWlyVoXowJxs8zRIfuhKqdM8OhMfuFvrhfsJiZCpo04NZCDgj1aSNbA+CKZgb SkZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=I84A/i8tcPKxxOGbCK9A8uezoeqh4sVjuwMk9nGOQlQ=; b=iNi4zI2TOKL1MtkU/QKTkZo6qduO4Iwqtz6qXicBo6YuNjA6GTN/FxYfwPe7ZB97QH PkYO5K1e8RcwQWTnhIn/J3IkKchSmboWW8b9Xcupy++LGo8901TaqsOULpu6Eg0Vk5rG wu9Ve3rVBUov4VZSxgZ/LY7ULwffKK+5ZYFJzbQnmKu7suPpLlw8Ozrsq3UTU3ZGfgL/ EZFRAr94o17mH/4+GhFuOvU+wDY6KF74orP/Eh05YF+AgfKDxjFTfs7zew9NUPDf5R4K zAaAt2nO1aoc89y4sT5VaQz6WpQPbS1I4nuahpLJtOhKzn5KwDF/tkqDLUilGxZdzbCE fJlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZI+0qXsA; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si2654721ote.72.2020.02.14.02.42.08; Fri, 14 Feb 2020 02:42:21 -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=@linaro.org header.s=google header.b=ZI+0qXsA; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387477AbgBNKlj (ORCPT + 99 others); Fri, 14 Feb 2020 05:41:39 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34376 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387414AbgBNKlj (ORCPT ); Fri, 14 Feb 2020 05:41:39 -0500 Received: by mail-lj1-f193.google.com with SMTP id x7so10190982ljc.1 for ; Fri, 14 Feb 2020 02:41:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I84A/i8tcPKxxOGbCK9A8uezoeqh4sVjuwMk9nGOQlQ=; b=ZI+0qXsAcGpAsFA7BAHC/r2eJz4nN4Nx9/qkAEpIDDoDDtOyybIt7BDzE47CID6Zb8 KXMmlcs3o1Q8M593QyBQoHhzPwoHNJQ4zGVhk7KfRX9tHIalJEZU0yATHyk4H/6agSXL gAMP09pjFClhtjllFq78QJmvRKdUfZKjsL1rCKvnAleNtFLlFGT2Cxjz1mlJCSsta0b3 KKKJn1DNPsLayW72dHiVAOekjpBBMiBKWClSc+KnprNG9aog6lHLlzp6poDAdhIOlyGk baBAuwWPvaTk8SFcwHvkkyo0+c+PEW9bquP2Fw+2ouoNeThdQv+XG4j0dW03YIobBLEc Tq7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I84A/i8tcPKxxOGbCK9A8uezoeqh4sVjuwMk9nGOQlQ=; b=aUgi6RhswEknBdiZlj7zRFfja27l4sktQXuCcG4DTzVOQUr3efuwIUPLhjLXN4hzM2 oV6Qi6mf4ZLsTMcecnctCNxP9bseJMAsYJ8wcWl6CPHhac3GF+gcGptQDCwOmLtVyOko dHqPllBaKwwWTyyqHEIaSvllXS7kn/LmgO63nTnqm5SMv51sbjNfll5KYuwfVvJVTrts uy6yiUUw7sPgUDjoBcoErTi9yK/t7DA6oxyxM939h4fLoF+GJZGz9832IoXAWDVf/q8J mmQx0Hmbr5i7pccZyDS2ksvx33QbGQwurWzsp2vLKGGydDFypYdZ0Pgw3ZSXalmz5Zz+ +CXA== X-Gm-Message-State: APjAAAXFYQG+HAA09l1glw8CPSOytld0OFmNX80viANitM3G2sEw1wTs GE/WRrIIcEru/7wOKsIAoJyNZoI/kf/oGjdl1Wm0eA== X-Received: by 2002:a2e:81c3:: with SMTP id s3mr1685747ljg.168.1581676895494; Fri, 14 Feb 2020 02:41:35 -0800 (PST) MIME-Version: 1.0 References: <1579675994-7001-1-git-send-email-light.hsieh@mediatek.com> In-Reply-To: <1579675994-7001-1-git-send-email-light.hsieh@mediatek.com> From: Linus Walleij Date: Fri, 14 Feb 2020 11:41:24 +0100 Message-ID: Subject: Re: [PATCH v8 1/6] pinctrl: mediatek: Check gpio pin number and use binary search in mtk_hw_pin_field_lookup() To: Light Hsieh Cc: "moderated list:ARM/Mediatek SoC support" , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , Sean Wang , kuohong.wang@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 22, 2020 at 7:53 AM wrote: > From: Light Hsieh > > 1. Check if gpio pin number is in valid range to prevent from get invalid > pointer 'desc' in the following code: > desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio]; > > 2. Improve mtk_hw_pin_field_lookup() > 2.1 Modify mtk_hw_pin_field_lookup() to use binary search for accelerating > search. > 2.2 Correct message after the following check fail: > if (hw->soc->reg_cal && hw->soc->reg_cal[field].range) { > rc = &hw->soc->reg_cal[field]; > The original message is: > "Not support field %d for pin %d (%s)\n" > However, the check is on soc chip level, not on pin level yet. > So the message is corrected as: > "Not support field %d for this soc\n" > > Signed-off-by: Light Hsieh I managed to apply all 6 patches now for v5.7. I had a big problem extracting the patches since they get base64 encoded and for some reason git am cannot deal with this. I thought it would but it doesn't possibly because of custom headers in the message. I have to save out the base64 part of the message, decode separately, then paste back the result removing the transfer-encoding line of the original message. cat mtk65.txt | base64 -d -i > scratch.patch Any tips on how to handle this more efficiently? Yours, Linus Walleij