Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5053289img; Wed, 27 Mar 2019 00:48:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxh0t1DvZq7ez9HdkTpt8s143Q9TaGynViRvcuVsk+pPy3qlh8YHfI92sQIhMov8Fr2kUmM X-Received: by 2002:a17:902:7b96:: with SMTP id w22mr87581pll.28.1553672907205; Wed, 27 Mar 2019 00:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553672907; cv=none; d=google.com; s=arc-20160816; b=HgYPNyCDf64npP+YzhCorKtRLffnGqoy+ZFvbSZ2f5fmPLfgwvof1zCgZvWxthm/qz fzPJFwtH5sXw3JTBwhVDSlE8uzNbp6nlZoyhZX39CIqieAblMvlhXjtopxeB30RzhiJJ iv9GNnVfSeP5biYRe+MoIG0K8GIj7lPgiYajUvwlmBWS7YE5kiB+6uUKvT75kcuKNUNH wY6qR8hg/un62CCXW2Whe+jJhY0ypWHygCpp8PvHRPA5hb+2x5/Z87wGu1TVqIcvBt0W qm2P9vsJs9PLnQ/Af1risuODy2+LLDu/hGvgl6a0waLbEaR5QPdid4VfTTRwJWcAIIUF eWlQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HNsvt5Nj5ckdm3kBhHYU61/FYQreOrJv2teGnLqpoYs=; b=Pebsc42/P6UIeBNWJ9vZmEbtasJk88b+xIBIs3ogoP1jXt21lQyfs4RS+cQMKeaqEu ArB1DTNGzAQzt1kst2+FtvagDgqDrLCm/eT/cjwjB5yehXsMHzSi7k2RTYwS4HCdqxAq BL9pTm+q23HA+CdD2AsANT8CVEsIwd2moMRU7E1avcTXQXF18pjvVzMBTjquOdxJRDIS y0fv2O/Zh1q5hl10owVpJPqgJST1MIY4fot8NhhhC1JH7RHobxZX727Tg+jXIG4jgo45 9smfj6Jrc+PBNoutRa6bDdeg7Ie783mRRu8gwo3urAv287UZy6jmwajCEcGPsyECkULc VIxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fj84dd3H; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si14732916plm.263.2019.03.27.00.47.59; Wed, 27 Mar 2019 00:48:27 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=fj84dd3H; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbfC0HrB (ORCPT + 99 others); Wed, 27 Mar 2019 03:47:01 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38616 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbfC0HrA (ORCPT ); Wed, 27 Mar 2019 03:47:00 -0400 Received: by mail-pl1-f194.google.com with SMTP id g37so2921080plb.5; Wed, 27 Mar 2019 00:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=HNsvt5Nj5ckdm3kBhHYU61/FYQreOrJv2teGnLqpoYs=; b=fj84dd3HZkjvacl7koQVj+OwwvHXAY4lFRIu9+NNon/E8ThzCqXW4lBViVwo+JD/OA BSSn8f4a/RS+iCNwVZ9C02d+9tlaNORZvsiZW1pFId+jI7xT1ygoff86dzOCpxtn5w1d xjEaRHbxpSMUMO5nViNspqw6FyoGDHlSHvjBO/JCP1VhK5amM5dqHv0p+RmLFxAAZOTB gtg+seUAYdHzhACeJvxNAWL9z4vLwHAY88khqoDvMM8umDfwghJNDKEqWVEGo2iE0YD+ bqcP0ALug0XmcoBNv+w7YaiNnHXklX41wRMEspfCImvlAfZ1UQPOmwJ5Dci5HtyW2Tjq cR4A== 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:content-transfer-encoding; bh=HNsvt5Nj5ckdm3kBhHYU61/FYQreOrJv2teGnLqpoYs=; b=OuiV+z7nD2okx7WupazRR668MFueAZFJS+k+dPczXpwUw/kC3wJTvHNyDaAzvvWYEg IIRjVdb9xdENk1hB0Heaz6ROQuD9viimm8rdchHUSUbBbdfxe3pNIS2TqTlDadBDjL4r 4CI4PCGzcbDiedk7e2dPVo7g5Dc1jjLvpTlCFOZroB8jOzW0PQNLNAkI7J5Z9Rvi7qWq CeM+yx/UTNGaqWQ6I+a0a9/mJQe5WwXEE7qDjGdAYEfr/BUWCLxc2bAIJBXglOV7kB4i m3jUYxLZrQJl0BkhTSl/ivjU3Ue+0mpS2fYMDcp6Si5d1lFNhDh9BGG0tum47yCYylIv vnSA== X-Gm-Message-State: APjAAAXtf4rnubs3AQ0xMz5Wq+kFPLh2hFbepWduEEiZXBjPqQtI4Dbu AsHq5Uo6EJJLAWxVC2dxA3CO2eCdL7BxqFvAUy4= X-Received: by 2002:a17:902:bb05:: with SMTP id l5mr15741020pls.311.1553672820090; Wed, 27 Mar 2019 00:47:00 -0700 (PDT) MIME-Version: 1.0 References: <20190327014807.7472-1-ronald@innovation.ch> <20190327014807.7472-3-ronald@innovation.ch> In-Reply-To: <20190327014807.7472-3-ronald@innovation.ch> From: Andy Shevchenko Date: Wed, 27 Mar 2019 09:46:48 +0200 Message-ID: Subject: Re: [PATCH v3 2/4] lib/hexdump.c: factor out generic hexdump formatting for reuse. To: =?UTF-8?Q?Ronald_Tschal=C3=A4r?= Cc: Dmitry Torokhov , Henrik Rydberg , Andy Shevchenko , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lukas Wunner , Federico Lorenzi , linux-input , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2019 at 3:49 AM Ronald Tschal=C3=A4r = wrote: > > This introduces print_hex_dump_to_cb() which contains all the hexdump > formatting minus the actual printk() call, allowing an arbitrary print > function to be supplied instead. And print_hex_dump() is re-implemented > using print_hex_dump_to_cb(). > > This allows other hex-dump logging functions to be provided which call > printk() differently or even log the hexdump somewhere entirely > different. No Sign-off? In any case, don't do it like this. smaller non-recursive printf() is better than one big receursive call. When it looks like an optimization, it's actually a regression. And yes, debugfs idea is not bad. P.S. Also check %*ph specifier. --=20 With Best Regards, Andy Shevchenko