Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp269533lqo; Wed, 15 May 2024 14:01:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1FCXiC3gdMQ+S9/G/LGvvHYLA7IdXOWcVEzh8/W2vlzJthRBDnVnF+O2ucHunWC16isO22UT6RlPAT35q+MJJ4CFqBro1nAd+1P7IXA== X-Google-Smtp-Source: AGHT+IETxJqyK3NR+GSY26oV0KVgdyXMm3Eim5TVYQ1bEevNgu8NYuCM/v7ixaZ11XRa48EBokCH X-Received: by 2002:a05:6a21:6d95:b0:1af:d08d:da34 with SMTP id adf61e73a8af0-1afd123b9c3mr29910504637.0.1715806918916; Wed, 15 May 2024 14:01:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715806918; cv=pass; d=google.com; s=arc-20160816; b=dJjyqCwjDStZdyROPX0FDdggHvuSttyTxibMio8CO63hXy3hYCEIPnRVzOyK0mU7VN wlIJ1Gg0As52dM8UsAYpvEQ+2uOa0yUspLRHEsyRk045Viqxc4hEllnqo9OHSC3qS8Yy zbzSZoPztUqsq1Jwmbdboek1mdlhnMUZ504dsVYHQMsPKcuqr1TigvPEUTQyIsCf7eVN 5kwqUhmLshbMgIVWcTkyZlTFWeQlULSerAchdMGt5bdjYl/5hBgz8JZVlYrVBvxzzXDt pbYdy7Ec6J1BF3zbIbwhtP+UP8Pv7u4AxGlvAfLlpos7wqvAzEGJLajDYZfypyPBWm48 aV8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=k/puBfybqGdRr3s0WvxOTD3Uq//G7F2oQm8GUykR+Bg=; fh=FkWkdrggH9w2sShRBHAhmPu/xmpb9Na9Ev3JylrSFWM=; b=DlJ2dbUQj69jwWPkQlndd+Ux2V42Yd/tSAUNukcE2hemAha5v/MBqjfVCtiIawPvcF AWjwaYlfTpjqI0ZwC2GLGx2+1hUlQjpoVAYQp+LiQecLxeWtfuy/T/tTBF7hGHbYewO4 XHbYHWiDXbRfDSgh7vdUEt5zV+UBki9+j1WJ8yQliIN74dYqIYFCwt4Yd4Ayzhqrwzxn 60202h5Te1ICbultsUQFFISrbivQUS3VU3xrveNmfE3+o0cFIUrNmXblqfUumNGCn5OH 2VbT6I8b2KMrh7ZzYYHXEQ4sAQKKsprZXnKn1DEwmstvAyvQ85uOEX8ucJHgMjSmM9X3 muow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=J9El22d1; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-180102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6340a06c05asi15538019a12.92.2024.05.15.14.01.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 14:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=J9El22d1; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-180102-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180102-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk 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 B99DEB23C3F for ; Wed, 15 May 2024 16:01:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F101B15624D; Wed, 15 May 2024 16:00:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="J9El22d1" Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72BEC155A53; Wed, 15 May 2024 16:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715788856; cv=none; b=EOUCJdkWk7gq9+tsmXZZUTJGoREFVo1fmVeBojv498d0fcv160AkrYZ+0OaT6O47MoHZFV5w0YAgeg4cOzx1ucM527oLKP9qxEr0nxYHCQcJohjhaSXZbQVq30Q3OR27LOG6bMmEDpjMMCqhyiR/qxVgT8df1FXDT5pG3gwQ4IM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715788856; c=relaxed/simple; bh=k/puBfybqGdRr3s0WvxOTD3Uq//G7F2oQm8GUykR+Bg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rHOYF7PalhZ6ym+wNvh1HeRYlspn4FK9wBIcC/mDrCvGM95JkRbEdXqBRfqexBRsDqPK9TDeGkNCQjFv/yPmJ3EpQPcX0fiDnKIAvmhpRCnd0IAymfQeEyKSVnjOdsA5xWY5NG1H6n/1IuNPQq6r1OT8uheeqyRtpDkiXIwsNL0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=J9El22d1; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=k/puBfybqGdRr3s0WvxOTD3Uq//G7F2oQm8GUykR+Bg=; b=J9El22d1eLEvXYRqeMrIo/on1Y xKAb0pZjsq5PVXgThiBl41GRr0BHp7i/pJK9+wlrkWI+MAcv1d+GKcDZVno/b2lv6J2dz7dJMq0u5 f8aZB4jeZrAZ0qKTW0uP49kEVwMib1KR8qHxsb7MGaFUZaLHzGRhlzolaD99EYQZiqoumUb4381bY wlzvjyoBK+eA3eO87XiJlOudtLYFK0MLsM/7QMVXaeI7gxX5hevKWaQyUIiaCCwHaqVXhEatxH7IX KcIPWfR59DT3w66YccTf+I1Xx3Ai30S0Md1p32AxY0vqhjS51mW4xTPXQ1+1kdJ8aWMY192U2kBPj WItA821Q==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1s7H3Y-007XlO-0F; Wed, 15 May 2024 16:00:40 +0000 Date: Wed, 15 May 2024 17:00:40 +0100 From: Al Viro To: Jiasheng Jiang Cc: brauner@kernel.org, jack@suse.cz, arnd@arndb.de, gregkh@suse.de, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] libfs: fix implicitly cast in simple_attr_write_xsigned() Message-ID: <20240515160040.GL2118490@ZenIV> References: 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: Sender: Al Viro On Wed, May 15, 2024 at 03:17:25PM +0000, Jiasheng Jiang wrote: > Return 0 to indicate failure and return "len" to indicate success. > It was hard to distinguish success or failure if "len" equals the error > code after the implicit cast. > Moreover, eliminating implicit cast is a better practice. According to whom? Merits of your ex cathedra claims aside, you do realize that functions have calling conventions because they are, well, called, right? And changing the value returned in such and such case should be accompanied with the corresponding change in the _callers_. Al, wondering if somebody had decided to play with LLM...