Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4496089yba; Wed, 17 Apr 2019 12:46:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxixWFJUf9zSJg6+8x+eHuindm+TCb/Kqf+0GJ7iNzJf8hUVxUZv2xfya68Dvp+ImBxqExG X-Received: by 2002:a65:4341:: with SMTP id k1mr85507099pgq.88.1555530399412; Wed, 17 Apr 2019 12:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555530399; cv=none; d=google.com; s=arc-20160816; b=L6LUaCHE1aHtPGVrYqb0FliWwCNplYIjOOO03jBjCPnRHQDP8gw9078cmMEfiTZGMe K9QW2pNlkwV6SblFpM5sFl1nIce7JGlwUNhQ6FuGPR6x6P6qY4W3vdSMaJhtdHl0N6RO MQKUGuhoyiL3wH0gmmJ11mPLPgLKwqTrf0UmY5iZvbI5VgSntNgkQwf8Mf2S6VdWdrpZ aqCYyL2wNNcBmnTa7xyphlmS9uAG4YUAXXdyTV144OLa9V/otAYvLiWpomSsxnLK63rI kagnRqHpA4bhDZmQr5ZQWNa6eF1GRSZyAzUy8O7EJN4TKqlXAID11ywU4at2/O19FQl5 8+mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qudJkizCEY3jbbLNjsqAgGXSfIJUwhtC5TCT3Pu/qPs=; b=nqCsSVazJsWco/10H/NXG/6BwkUZXUGKxXGIPIuyU0ZsFzLqji3BP4ezZNUs1m5Uwe c+yb7OwL7FsRfwx4K76FCQfc/JzooZ8ZThVAiVI+IfZ9qJMjgIMc63h2w1UEH6cAKy6t 85098ClJBJBA9XIJn0HI/YMX5dSCh0pV75uU4gNEI4farbfA9QLylCK1iV/nLbyA58SC kLNKyPRWYZbuL/g0vMg6h9k141QOSoEnPK/O8P5wg+QtsaSYRtsrxdQPVFfK357Q9mwb wAUmyv0x5/RO42W/0V81pM//ljL2HB0RG0s57dmnJ661ZYqts2Ox4FOFq++0p/hBblMk mcbw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si52843384pfc.46.2019.04.17.12.46.23; Wed, 17 Apr 2019 12:46:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732767AbfDQTpc (ORCPT + 99 others); Wed, 17 Apr 2019 15:45:32 -0400 Received: from sauhun.de ([88.99.104.3]:33968 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729291AbfDQTpb (ORCPT ); Wed, 17 Apr 2019 15:45:31 -0400 Received: from localhost (p5486CD54.dip0.t-ipconnect.de [84.134.205.84]) by pokefinder.org (Postfix) with ESMTPSA id DD8A72C088A; Wed, 17 Apr 2019 21:45:28 +0200 (CEST) Date: Wed, 17 Apr 2019 21:45:28 +0200 From: Wolfram Sang To: Guenter Roeck Cc: Jerry Hoemann , Wolfram Sang , linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Wim Van Sebroeck , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 06/16] watchdog: hpwdt: drop warning after calling watchdog_init_timeout Message-ID: <20190417194528.xwivkyubhxyfrx4m@ninjato> References: <20190416102515.12269-1-wsa+renesas@sang-engineering.com> <20190416102515.12269-7-wsa+renesas@sang-engineering.com> <20190416203431.GA20072@anatevka> <20190416204814.GA26442@roeck-us.net> <20190416205533.GB8268@kunai> <20190416212046.GC26442@roeck-us.net> <20190416221702.GC8268@kunai> <20190416223813.GA744@roeck-us.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="i3b6ii7ljdtzo5c2" Content-Disposition: inline In-Reply-To: <20190416223813.GA744@roeck-us.net> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --i3b6ii7ljdtzo5c2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > Yes, that works as well. Note that it will actually print something like > "watchdog: : ..." due to the pr_fmt() at the top of watchdog_core= =2Ec. > I guess that should be ok. I have the following diff applied on top of patch 2. Works with and without a parent device. I am not super happy casting 'identity' but since its u8-type is exported to userspace, I think we can't avoid it. Guenter, is this cast safe? Here is the diff: diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_c= ore.c index cd3ca6b366ef..62be9e52a4de 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c @@ -115,6 +115,8 @@ static void watchdog_check_min_max_timeout(struct watch= dog_device *wdd) int watchdog_init_timeout(struct watchdog_device *wdd, unsigned int timeout_parm, struct device *dev) { + const char *dev_str =3D wdd->parent ? dev_name(wdd->parent) : + (const char *)wdd->info->identity; unsigned int t =3D 0; int ret =3D 0; =20 @@ -126,8 +128,8 @@ int watchdog_init_timeout(struct watchdog_device *wdd, wdd->timeout =3D timeout_parm; return 0; } - dev_err(dev, "driver supplied timeout (%u) out of range\n", - timeout_parm); + pr_err("%s: driver supplied timeout (%u) out of range\n", + dev_str, timeout_parm); ret =3D -EINVAL; } =20 @@ -138,12 +140,13 @@ int watchdog_init_timeout(struct watchdog_device *wdd, wdd->timeout =3D t; return 0; } - dev_err(dev, "DT supplied timeout (%u) out of range\n", t); + pr_err("%s: DT supplied timeout (%u) out of range\n", dev_str, t); ret =3D -EINVAL; } =20 if (ret < 0 && wdd->timeout) - dev_warn(dev, "falling back to default timeout (%u)\n", wdd->timeout); + pr_warn("%s: falling back to default timeout (%u)\n", dev_str, + wdd->timeout); =20 return ret; } --i3b6ii7ljdtzo5c2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAly3glgACgkQFA3kzBSg KbZk3A/+LZ2YvExZPaqhdORkp74iw/y522BH5v3O6XmWaBH2TLEYGEYsc41+LEuS 4FzI1U5yp3k/sbqhUtpHN0lE/7q9WtB4gRCs+wMEMM+mgLf997UFHFVTfVynoGJs hkEfI7l7MDvPQS+lekjmLM/1eh1N3qEXVyvW4lZPD3S0TUgELFnfOzpzaypxi3X4 kkg6MyeDQUiE9PxD6pHv8eBgWGF27R3cN2e9ZeSARjsRW8mdnH7LNipHlFwYJIok xzBRXycrJYfZMXh3C1bI1z7tvkV7Pwi0uNYATEQWJMc9/Jsf2PdguedybZj30ru3 L5sUSyNaj50XwmkYWxJ+wRZZqgMhUh8jjd6+YoRh8z32PfA+ewD5hHiuWK/AUvET FNNuevV4cZ4bwleO6zixSjHviJMANhKDb8GGNjZk/a+lq4AGTE2cdD4AohaF0lCi ZEUUHzQiuKIVcNbvK5dEND/c56RHdwBsKkkQ9WV+Pfs6E7EoMLSeISEI17cJVkK3 6q3jt9sDhoLGzt6x8yHgtq94rr8nCcF+mXOPLtDIlTSlJrzmiUlAjzOtuWZxljIo m2T1gCQUdAOC3CIEVxKoKNrxtvWg6CTcWGLjvNzYEQdNKQIsYHclubTl7Iz1AwOp 57oli+kezXE+RtKBZDdv0i5SMs1RyiJyVJ13mPQUhtxA/E6z05s= =nISJ -----END PGP SIGNATURE----- --i3b6ii7ljdtzo5c2--