Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp552269yba; Wed, 24 Apr 2019 05:58:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqygGKC9fnbl5GAwnit3haTUWS+1U9jHBk1DB1g2zmmmE+agscKJZS9KG+N5cIuAhv8ZQ/ML X-Received: by 2002:a63:3281:: with SMTP id y123mr30546440pgy.272.1556110730934; Wed, 24 Apr 2019 05:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556110730; cv=none; d=google.com; s=arc-20160816; b=NBoc26KbuwDJ1c8k6VPzGAGMZzqLtGuZNGaJECcCDPMbBl0Ry4XafkenVX4laO2kWh khuA/kzTohBCp+7h/eudHYY6F/+XRnCGsdTCEiFQS8MWteamRgvs0Tp3vkaL4ojYxE2g x5LiDJMf6OaPYB02C/tY+0ZeFedVVUva7GA0fTOrOSMbpZ1u8J9SuUouP3QIU2huRGKm cQfvTmyjZz+RJ4sRBtc5ra7upCvaeMc5J7TGFtAwZQYpqN9DhoUYiPQdDABSVWw445MH JKBxUszpcmB5bLK62rViFwdrB3a/7fVwXcCeZz8wdlDd//nLRd90w29Hnw7aCHV0QHQk FEsg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=SLjRph+8jU4ZtxyMRBhIIBKEMjfFncgRikIohBy/zGs=; b=Z7nfjWGAV6iXiHWH5nx0gHDG2P3DF6/saeHQDB+aYxMtL0YcaoREDGVbu+7JrrSFD+ 2RezTDGuJmAONpRR3MmwqvVoSVErlD9eVmoI1Qw98xZ92WaVMOtPxtjtIkX4ImB+PLHI +EYPMJ7ALeKHqCZkgrjUHK4qupDm37op4pIorN21CPNg1EKfwGuz7dhc4P7touKep9eq /YqXtCBsANW10TOFqzgRKCRCpk/GWGQwIsBDxvfUfKRxQ7qk9u2sHeHAYXdFAYuJQejr MvgANTA7RSUNeC4ut1Eez5Zas+SVTxH0icwOD7U3XAsMUtAlBZGtTv1cAJWVZctBnekN rn+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JmeGTZKC; 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 v2si17871162plp.191.2019.04.24.05.58.35; Wed, 24 Apr 2019 05:58:50 -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=fail header.i=@gmail.com header.s=20161025 header.b=JmeGTZKC; 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 S1730073AbfDXM5m (ORCPT + 99 others); Wed, 24 Apr 2019 08:57:42 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39909 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbfDXM5m (ORCPT ); Wed, 24 Apr 2019 08:57:42 -0400 Received: by mail-pl1-f194.google.com with SMTP id e92so7479085plb.6; Wed, 24 Apr 2019 05:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=SLjRph+8jU4ZtxyMRBhIIBKEMjfFncgRikIohBy/zGs=; b=JmeGTZKCDidV/196lNg88lKAV3t3Tj7bxyw7LCqH9GKovPsLdUKfzrWQTC11szv0zf GkcGnaLhuZxdWVBj+CiWnjlEDo/98/RQnMoqaq2Fy1IPoaC4iEZXlaBWEvKbweiZjpCu kC2NTB/fC7athht9rl4l1ALjnOv20SQUBAaOhcBMdkrOsANcLa6PoBAruUJTspzZoP/W Wea6KT7OH6xlU98C8eZk+dFxvi8cOUfr/WtkrhW6Rq7IdcyReZwrlREq/UceiX4k2NZN 3hxIHfVmqZDi2X5ASMfl8BFIwQZQAyc+gGbBocJZztJQdARBBGK/sIzpddpHZTZ2uyRx cx+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SLjRph+8jU4ZtxyMRBhIIBKEMjfFncgRikIohBy/zGs=; b=RKpdoe4L/DeC3sRzFrzVkbrN/hnD6hEg960E3YiNWM0XHmFn727RfPJGkO5+yLJGiE 16/N1N5BubxpKoAabVfmDScIEC7RS5iKSAfGxvAGgsNfYQnAUzzXcqxMNANCFo+Yy/sG QVhN7esJx6Zq3+RhUnPOeH2z3lgikEZTtMqVuEul746FEc8m9q8YhSuPY0IJoi9w4XBY hn11NFgSBnv1RNtHdHO/bOkQN2EXVpDrE8dHinRcrG2U17/EyBu7dOHpSQNnjkjJ62XN oHVfoOg6ShfiGXgEE21JlfmssjRoP5FPzDAyjc/XU+IyN69ydhEWmgW4Ei6N4egGIMxG sREg== X-Gm-Message-State: APjAAAVtQgkoR0rHqs0b+vukXjcu300QTd5b8TySUzrwqxDmDWeBIYev RWs3FSISbKL32jRRhtn3BTmpH4ao X-Received: by 2002:a17:902:201:: with SMTP id 1mr32635430plc.89.1556110661368; Wed, 24 Apr 2019 05:57:41 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 6sm31057788pft.64.2019.04.24.05.57.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Apr 2019 05:57:40 -0700 (PDT) Subject: Re: [PATCH v2 06/16] watchdog: hpwdt: drop warning after calling watchdog_init_timeout To: Geert Uytterhoeven , Wolfram Sang Cc: Jerry Hoemann , Wolfram Sang , Linux Watchdog Mailing List , Linux-Renesas , Wim Van Sebroeck , Linux Kernel Mailing List 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> <20190417194528.xwivkyubhxyfrx4m@ninjato> From: Guenter Roeck Message-ID: <54286f3b-98f7-1b7c-8768-2c88ef73e9af@roeck-us.net> Date: Wed, 24 Apr 2019 05:57:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/24/19 1:38 AM, Geert Uytterhoeven wrote: > Hi Wolfram, > > On Wed, Apr 17, 2019 at 9:46 PM Wolfram Sang wrote: >>> 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.c. >>> 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_core.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 watchdog_device *wdd) >> int watchdog_init_timeout(struct watchdog_device *wdd, >> unsigned int timeout_parm, struct device *dev) >> { >> + const char *dev_str = wdd->parent ? dev_name(wdd->parent) : >> + (const char *)wdd->info->identity; > > struct watchdog_info { > ... > __u8 identity[32]; /* Identity of the board */ > }; > > Is identity[] guaranteed to be NUL-terminated? > I would hope so, because we export its contents via sysfs to userspace with return sprintf(buf, "%s\n", wdd->info->identity); Also, there are already several pr_err() assuming that it is a string, Guenter