Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3020859lqo; Tue, 21 May 2024 04:45:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVj1ZrzniFyRCNEXNOljJOj+Ke4WXhgSROelwffhgBTdHN6oW5ZDmyoetBj51si+y33hJB9qb6OtJSKeyMo7bSqlP/EV1EY93nxtf0BQ== X-Google-Smtp-Source: AGHT+IFyIMN8bX+0oLt8kc9xZPhdqiQ31cpR4y+6UIgOdSc2ATV6dZqnCPrk+AKJFMFbxmVi+0Hb X-Received: by 2002:a05:6358:6483:b0:194:809a:e7fc with SMTP id e5c5f4694b2df-194809ae922mr2171749555d.27.1716291916775; Tue, 21 May 2024 04:45:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716291916; cv=pass; d=google.com; s=arc-20160816; b=f/GanT2EGN8Iq3Z1nwxzy+e8/RfA+U5o7kHDHS0SjxENBly1/weXW1Yb2dsjdo0NcH R1fjn5l4NH7RhcfVJHonCHtoaMYWJ89S+TMbyQo8FdXZ/5rDR8KQjj1rQDjhXK2w6GJw t/xj9q69x9ChA5r4SxAz8EF8oJvAClo0SwMhKjhC38xCyap+8Vw5k1+yoi7QJ/5IZp8s 7hiXG3HHW+VHfa2gZn1L08aibzV+eGrlW4P5r3j3H1FZxS+b37+nIyETvQCPuGW3XU/1 ikde4ZhR3xxDBCydnzJ6QRyUrhxfepmUAqEGReeunLYfZGWhe+pOCWuXUUrd8WW1+gii kR7A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=mOwHb2FPKGtsc1cG3NXDK56YSWp4wady62ZsYSdaVyo=; fh=7kTVkqt5FDj8asoqrAosqwqI4A5Nqoj+9xyZIKPkiH0=; b=p/CFGE7lTE68N4QqRulf9nqjRdcwIlZGdnXPWasaKYxv51AyYgJ8nzhLskDV2xfCAK 5AAwN8055FnzJN2qm4PObeu9m/hoHWwh6D1wyOlQHgw2SZtezx7YcBCiK5ZBV6Joigyh MvZx6uVtTvp29AJRefMhNLYAXZguaa+gq171l9NdqTKye+Jp65jQ45Xgz0M5zE2KQFrL UhOWaNMRDOB2gIxzVSPKN2ofi32P+qEG4rxUEAtPh06MWEN+hYDDf/l4pAsVDtN2R7WB WFg94C1HafreQVH5089V0fdUYhgt1vuVpuhK6zzYtEV69jK6CFgMpHo1nAMm0FIOFspS hh4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Seb1q4of; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-634133dec70si4885327a12.788.2024.05.21.04.45.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 04:45:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Seb1q4of; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184889-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 615FDB22D75 for ; Tue, 21 May 2024 11:42:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1ADED757ED; Tue, 21 May 2024 11:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Seb1q4of" Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B68714F605 for ; Tue, 21 May 2024 11:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716291739; cv=none; b=dEtJ2vfLYO/rdjy35hBM43jAYHaE0ZKMDNomaOr2bTJ8nh2q95cDeepNARwKNKyw20VJUUBdrom4xWvdRsy4poE8B2TsSDDF86sd4gP+qBK6x3rBDeRAwTy4XVj4LZDqeN+8DDUvJOS4/Kt440USrhqKrcZv4uzrRf7uJhstKQw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716291739; c=relaxed/simple; bh=pKZKLFyFEI17SWtvaWH9LZFzoWuFQMuJEKf+90+3XpI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UVsrD8G45L5eTWYOlusRGExcIE/zBtVGhxt0E++zV0tPfcaqjFSfr2pGXOQ6QBfSdLjlMGhA6nmGIRuRKEHyAJPe5xSrV9bkA4N6ikrE2NSN1LDxHTxu/yuVyPNIGhghcHafvZRwt178+N6E7NSyInpcpVMe9qWpP78d9RLbIcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Seb1q4of; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-51f99f9e0faso6261752e87.2 for ; Tue, 21 May 2024 04:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716291736; x=1716896536; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mOwHb2FPKGtsc1cG3NXDK56YSWp4wady62ZsYSdaVyo=; b=Seb1q4ofMOYlKuTua+1wf9A06qhzVs/pwC7ejqJfGx6M4aNrJI0xRRmlezKmRAgBwh PS0N4YnpoZyEoEIznxPGvZ8okbN0aOdFicXujG4ki6e5EytByh2QAWMYBzQotxFHM+v0 0TwPd4HXHK1XrKfZ5ZaqcJcJsNTEHk+mn32Dc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716291736; x=1716896536; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mOwHb2FPKGtsc1cG3NXDK56YSWp4wady62ZsYSdaVyo=; b=eCTVHSMB9YDZwVCJWPvdaekikoXTuFkf1KoDd5SDqbSAytctz9cLqbihUexYE5H9Qx yenh7r+Py2ekLJWtItWM1W1Awx2gdyPn2+bbOzj7/q4T9xhwsj8QUyRS9Vta83qsfRl/ n9qGg4R/MVsGhircZRvryaXfFFEr1l091CkcT9hCR4UP8KK7ulbOM7mxvdiwvreafg5n h16+fk7C2gzvtfX+gogeG+a1UIqZ1yZd6VgAx50KsgEcahuyJ7oZkhPhbmH3wwVynJrn yKLUeZ9fhrcXvewK2kPRVFB9uyC9PLnnaAi9bG2vtUZKCVWXiWwGle0T4tm7jrDKRkyj 9yww== X-Forwarded-Encrypted: i=1; AJvYcCVJwoKFq4Wmk1zLgYnPPSIJkwAQK+Hj8/Z9UQ11xP/AcDGozbZfzqcd72PXon2skUvdq+hb4EJ650QdD0cC+3k92HmjiYxpL4YIeir+ X-Gm-Message-State: AOJu0YwypHjYcY/GbiPLM74gNRKAuN2M00LXOufQzl9Y82z5s2qRbL3c u349/LK/tTDNGm22P3G965LQX4/eFovq9BShf2uhp2g0qmAPlu7Zg6RenwwRj4qIbItxAmxx+np ckxrErh9Nfw145iW1+bKrXKe6qkTAlqJ6hXI= X-Received: by 2002:a05:6512:1304:b0:51c:5171:bbed with SMTP id 2adb3069b0e04-5221006e625mr25872000e87.15.1716291735867; Tue, 21 May 2024 04:42:15 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240516174357.26755-1-jim.cromie@gmail.com> <20240516174357.26755-5-jim.cromie@gmail.com> In-Reply-To: <20240516174357.26755-5-jim.cromie@gmail.com> From: =?UTF-8?Q?=C5=81ukasz_Bartosik?= Date: Tue, 21 May 2024 13:42:04 +0200 Message-ID: Subject: Re: [PATCH v8-RESEND 04/33] dyndbg: make ddebug_class_param union members same size To: Jim Cromie Cc: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 16, 2024 at 7:44=E2=80=AFPM Jim Cromie w= rote: > > struct ddebug_class_param keeps a ref to the state-storage of the > param; make both class-types use the same unsigned long storage type. > ISTM this is simpler and safer. Why is it safer for members of a union to have the same size ? > > Signed-off-by: Jim Cromie > --- > include/linux/dynamic_debug.h | 2 +- > lib/dynamic_debug.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.= h > index 4fcbf4d4fd0a..5231aaf361c4 100644 > --- a/include/linux/dynamic_debug.h > +++ b/include/linux/dynamic_debug.h > @@ -124,7 +124,7 @@ struct _ddebug_info { > struct ddebug_class_param { > union { > unsigned long *bits; > - unsigned int *lvl; > + unsigned long *lvl; > }; > char flags[8]; > const struct ddebug_class_map *map; > diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c > index 73ccf947d4aa..152b04c05981 100644 > --- a/lib/dynamic_debug.c > +++ b/lib/dynamic_debug.c > @@ -799,7 +799,7 @@ int param_get_dyndbg_classes(char *buffer, const stru= ct kernel_param *kp) > > case DD_CLASS_TYPE_LEVEL_NAMES: > case DD_CLASS_TYPE_LEVEL_NUM: > - return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl); > + return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); > default: > return -1; > } > -- > 2.45.0 >