Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1607149ybg; Thu, 4 Jun 2020 14:15:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdNb4lzbfF7HdGaJDuQkEZXztV0d/nIY8oLtLFiaBqBzPLnxRfr3kr0nSBxcQCAq7sPP6d X-Received: by 2002:a50:a782:: with SMTP id i2mr6259774edc.33.1591305341504; Thu, 04 Jun 2020 14:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591305341; cv=none; d=google.com; s=arc-20160816; b=UqFJmEgf7T/7yq7wQuGeKRtYkgkJZWHGGVgrKqSDiDhN7WDb3tGjixhGj1+q1X+vLZ gldSz3906rPtJOKkjjKFHYWsn7meoJuzcNkTbY17GnbXcGu7KTxh3zHpREiJzsYZx0tA Gk8l53PpEBX/ov9CeWvvUxRiidLKviqgIxXiLi4nJ5HmOhQHzF1HTOa+XV+QapSy7bFt 4hEbu8R5E3TlLFAPpLiEVe+AzfnV54BAJPfI799VpTzDTNf1l7oocOSk3RNznG2mNJw6 NC4C1meiPXYqEHIsixEVtqMTAcifGVL3e7W7f5uLhjVkmlCQUIlx+zjFbC7NzZptxB9r WMgg== 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=2/2vvNqjDrDfa9zj4WkpMzbskQTo3mnO0g8KBrFA7s8=; b=t6feKO/YQkrF+M6aqj8QIuaDOvze9dVmOZVYFIU3IEDXVi7lUyLq+gzuiF1baJy1U6 t0iCRZ11oRWkFiOPKPyuBF2OgzkZBR9Ta/WWN9hZsiBOt84SSBkGIsX7wui9O7RTSgvl IXHSaO8qsV2Qm+S/T3jTqU+/Rggsb2CAjdXKBIdj1bVRvHcguujxMu0XgCLHLiQzq6na +MTxpQmfbR2stpHuHKBjHbzpxtZ8IduhIzPoetO2FV/P5mDvgpoJ/OjPUCpIIca8v3ag dcGRpCcx7+0jIsjVn7Ccfm4lAUvVuzNeS1psfbcWgg00g8LERXhq8U1B4R3dl7cXjioV C0Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CUAua5qV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si2407028edl.221.2020.06.04.14.15.18; Thu, 04 Jun 2020 14:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CUAua5qV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbgFDVMj (ORCPT + 99 others); Thu, 4 Jun 2020 17:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbgFDVMg (ORCPT ); Thu, 4 Jun 2020 17:12:36 -0400 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36130C08C5C0 for ; Thu, 4 Jun 2020 14:12:36 -0700 (PDT) Received: by mail-vs1-xe43.google.com with SMTP id k13so4372581vsm.13 for ; Thu, 04 Jun 2020 14:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2/2vvNqjDrDfa9zj4WkpMzbskQTo3mnO0g8KBrFA7s8=; b=CUAua5qV8xF2sA5jNCA2iEaVCwy8+VpWn+NmTfcE6rq0kqEpaokEJWOgU5rdPmU2g7 1Vv5n3TRANrrPNT8DQXFfzcsyspUq7QIQNzjXHwb51Ovp3FYXom9Bk6Tt9wDXsmFiYI3 sQsGqUR7iG/5s865l6vTA02WgDgK6RP0D8h7w= 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=2/2vvNqjDrDfa9zj4WkpMzbskQTo3mnO0g8KBrFA7s8=; b=bz7PTPsrYFUi57dAvva8OO/MpgR1ti8YbfrpHGfYIXq/158tw+LZHATOWZ7VAX0R/g 5GKg5TnqD9IRa5SfD1l3yNbPicVSKyY/MvXzRk+v2pROo9wAQVPVqdEi8FFTeFtgN1TP J87XYs0C0jTnkFU2mgD1LmN0srck8nbTxhOOZZtcJbUvwFYlFaCdD6c1Uk7+Urz5ZT7I ZzBDjAmFrcgQ37CytYgg4bvZWI72iL1UPXX6eitlVtG9cK8bCfp2n2Em3uAdnWeZQYm5 OOhMh6JVZa0yNAU5KFnY9l6kJ5HksxymrKMF7poS+bNTBnweFnB6/SlBDi7WSRBXdDw5 qvrQ== X-Gm-Message-State: AOAM531nFLXkpgEOip/mAa4DWwpkO1k30fGn8vSd9zScN/oCgN5jR5vS tZYG60yNCAl8exK8HriGT1Uj1OcBiXg= X-Received: by 2002:a67:1dc5:: with SMTP id d188mr5131206vsd.103.1591305155043; Thu, 04 Jun 2020 14:12:35 -0700 (PDT) Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com. [209.85.222.46]) by smtp.gmail.com with ESMTPSA id b21sm418256uap.15.2020.06.04.14.12.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2020 14:12:34 -0700 (PDT) Received: by mail-ua1-f46.google.com with SMTP id g44so2229219uae.12 for ; Thu, 04 Jun 2020 14:12:34 -0700 (PDT) X-Received: by 2002:a9f:2804:: with SMTP id c4mr5242531uac.8.1591305153580; Thu, 04 Jun 2020 14:12:33 -0700 (PDT) MIME-Version: 1.0 References: <1591264879-25920-1-git-send-email-sumit.garg@linaro.org> <1591264879-25920-5-git-send-email-sumit.garg@linaro.org> In-Reply-To: <1591264879-25920-5-git-send-email-sumit.garg@linaro.org> From: Doug Anderson Date: Thu, 4 Jun 2020 14:12:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 4/4] kdb: Switch to use safer dbg_io_ops over console APIs To: Sumit Garg Cc: Daniel Thompson , kgdb-bugreport@lists.sourceforge.net, Jason Wessel , Petr Mladek , Sergey Senozhatsky , Greg Kroah-Hartman , Jiri Slaby , LKML 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 Hi, On Thu, Jun 4, 2020 at 3:02 AM Sumit Garg wrote: > > @@ -433,7 +432,8 @@ static int kgdboc_earlycon_get_char(void) > { > char c; > > - if (!earlycon->read(earlycon, &c, 1)) > + if (!kgdboc_earlycon_io_ops.cons->read(kgdboc_earlycon_io_ops.cons, > + &c, 1)) > return NO_POLL_CHAR; > > return c; > @@ -441,7 +441,8 @@ static int kgdboc_earlycon_get_char(void) > > static void kgdboc_earlycon_put_char(u8 chr) > { > - earlycon->write(earlycon, &chr, 1); > + kgdboc_earlycon_io_ops.cons->write(kgdboc_earlycon_io_ops.cons, &chr, > + 1); > } The get_char / put_char functions are pretty unwieldy now. If it were me I would have done: struct console *con = kgdboc_earlycon_io_ops.cons; ...and then used it so the lines didn't wrap in such a terrible way. ;-) I'm not sure if I'd spin just for that, though. Reviewed-by: Douglas Anderson -Doug