From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 B14A533B972 for ; Mon, 5 Jan 2026 11:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767614144; cv=none; b=LRGi145+YBNhdag/tHej8vVL8ZtVhU1dng+V8BmNKoJ+e9Nl8OTWZa3BwRIPWL1ye2XN4mbPr40sYGaR1eb5+ROETx7Ee0DxCr51uAiCJKj6gAsFrHqLqyT23pEnUPzKpX8BgCIJhwEOr6jpXDsMsrcw0TkYVDREMzY5uQ1qnmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767614144; c=relaxed/simple; bh=qzT0WyMC3+/O0JGDyyA2XKdYTGdPUbv01oj1YhQJ6Po=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PHNPceymtuSe/xiiOQTR9XR+kHU7PDE6PMYP4UsL3e3eS88Uf+sutpZSgbl5JhmbQK5GWYlD8X+yS/nxSEB6PUuoGmZy8te5Q/zMC0e6Eoqjq9zeq7d0CE+ORz08Zd+H9VrFKIrGWqmcP0/I0GXABhH6ZYFmYDfy3qbLkK87tEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=M0ihBIL8; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="M0ihBIL8" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-42fbbc3df8fso6926989f8f.2 for ; Mon, 05 Jan 2026 03:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767614141; x=1768218941; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vGx3PdQLTEGTA/+kl6GC7HNe3VAOwtg1+M0c6+I7tTc=; b=M0ihBIL8eWY0JeufXeSuJLfvyNOOkqGF4JYOnFMWNU10JXh7cP661hYaKc2KuqemHc SP2UOtn0aIujKsr+TexqwteeCy627RM/X4+Fna5pFHXdouD7Wb/vcyF1BFVZCyREo2Mn XLs77fkWDro0xWeJK/irBLzwn8IOI1B7mBdnGQpUVxv6wFGTP+l7MprMFi7N6MJPNASK TGVj8hjf3z8hsvgJOAIDG5UGUKXraCY9FIASKb/bZr2Iq/teEEFkWPpM5T4t8Igl4iKj Qc2PTL9o3ioGzF9678aTzkQgP7qU5b822Zlh7HJk3fJ3cA0vwYIrzs0siK2h26cfnWEl l+sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767614141; x=1768218941; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vGx3PdQLTEGTA/+kl6GC7HNe3VAOwtg1+M0c6+I7tTc=; b=cz4JDuplrpXe6xtPlEGSa6sMlgJDTNBEmj8JP4TAcZ/xntGJrIZRhgcMhTJo5hYsQG vbB2evpmGAnUXMjE1VBEELDkdrrHvleAXcK4b9Z7ARyJZmShHlDCzS2QQxGKwsf6NBZJ cuqEK6z8RWc628AzMNsd4KVq0KsOfIj/Ke6wdIhYAhFixdUN20JgK0Izs9ZIIC8ybkQ+ qq3h01ZDiABO9/HRBhV+sFrILNpSr0Rtl2RtL3IsIQQEqb3QzPqbcsP1r/eDgdutTuky l/nmO1N/SRKmE4NIqkeaq62Y6Yi6HCAs5etXNtXwPEonxHxkjZ4rKawhvgpk4m80Jat2 o7sw== X-Forwarded-Encrypted: i=1; AJvYcCWsJj4x7SNJGaVrJgdC/RSTrl6KIQWM9/6PswNAjErYel5vrQ/vLLNvabN+afi19LR3RiKuVzL3E39dK4o=@vger.kernel.org X-Gm-Message-State: AOJu0YwNGybLZCWoPb0y9jubsbN1Z/182qlFn0Hy9F6B4EXE2JpwchQH zqCLiJQ6hqzz0TGdQwBNj4CiOsnBKnKr4RGI4GxHMx/4IhuTbdwQXR0al9mcukMQwDU= X-Gm-Gg: AY/fxX5GkkF3eQRv1rgJWND77stW5Fn0LHA8QURoz8ecSY0zhpHLiDVf3d8MGZ50rmj WaqPaNqjORIko8KulJnddx9A8ymDhzZcp7+xWKM9QA3z5QIGjukzBDONkeIphX79NcxHRvL4e19 KAmar6VynacAAZGGfuPzFSfsdzr8QS8Lwsb1ejZjiO5NR3O7lkwDlYX/iGJ4L5KKWvbCON7uRG9 6n1tsCz7NiipMMHeXLX75UDsRsHiCE9oUMQDUlB6md6vsTT4W/eoyW/HlA4QheYCwPMY0s4gKc1 Jc12XriCnpNrD7qjrIIVCzokoKT81rWuGHkOzvgKJWuc6pCAkL4dSHbc8O0VqZ4mSKTxt2ETWOg 3UcO1P9hrFhfsKEBJXsJTflCbsMgLA2AoKA+b8ZX2xPbRDM/G6Nd6XV7i/j3O6xGz6RnT5AxqZT z1ozbl/YyuCSnfJlhs X-Google-Smtp-Source: AGHT+IGunfGijTnOFIiOYIQluYX+LWFj6c3mZY/ErVVGlm6oAL7B2TzSZFepMA4HDe8vleoKeXePyQ== X-Received: by 2002:a05:6000:230c:b0:430:fd9f:e705 with SMTP id ffacd0b85a97d-4324e4d3e9dmr71274562f8f.27.1767614141040; Mon, 05 Jan 2026 03:55:41 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4324eaa08efsm100876495f8f.29.2026.01.05.03.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jan 2026 03:55:40 -0800 (PST) Date: Mon, 5 Jan 2026 14:55:37 +0300 From: Dan Carpenter To: Sun Jian Cc: Vaibhav Agarwal , Johan Hovold , Mark Greer , Alex Elder , Greg Kroah-Hartman , David Laight , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] staging: greybus: audio: avoid snprintf truncation warnings Message-ID: References: <20251229112649.137391-1-sun.jian.kdev@gmail.com> <20251230012908.214959-1-sun.jian.kdev@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251230012908.214959-1-sun.jian.kdev@gmail.com> This W=1 string truncation warnings always seems like a pointless thing. dmesg output is really only intended for developers. I don't even know how to look at the dmesg on my phone or kindle. Who cares if the last character in a really long device name is missing? I have looked at a lot of stack traces and I have never once been stymied because one character was missing in a really long device name. And also these are 90% false positives. We just add bounds checking all of our output to prevent memory corruption and not because we think that we'll actually hit the boundaries. And the GCC is not able to analyze these in a sensible way, it's just going based on the variable types. This patch makes the code worse (more complicated). To recap: 1: It's warning about a non-issue. No one cares about truncated output. 2: The warning is implemented poorly. High false positive ratio. 3: The fix makes the code worse Just fix the tool instead of making the code worse for no reason. regards, dan carpenter