Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp302663lqj; Wed, 10 Apr 2024 10:49:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXy307b+RiC8I4OrO9/6TqaxQ1sJFGidQC3q6UO5W258yoV8c/H6AcHVS4aqezrHwsaWp+4uXNxG1WssVc77yQbaa/ATI4mn7VmUi4WLQ== X-Google-Smtp-Source: AGHT+IErDo5aXtKhcQJP3plM95LVi/X3i83D0o8VN4MCOMzdmbKGaZkHCloSYU8ctu2ilvGBv5We X-Received: by 2002:a05:6870:709a:b0:22e:912f:252b with SMTP id v26-20020a056870709a00b0022e912f252bmr3576201oae.2.1712771390582; Wed, 10 Apr 2024 10:49:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712771390; cv=pass; d=google.com; s=arc-20160816; b=kVIFolgrecVIc4ScVC0GbC7W6MVKp55mCAW1j+RysforxOhN4L13npC23V8kwBjmt4 HFf50cewHkKWvbhAx/Y9o2d1f1WnBZxodrYdjJADYHIhorFEnnBVJO5GeQsBLHLlmlQz /GYYYB0iXyRcIj5Ob1+f3YqpPQQqrYrVOkhwYXQcetJJELn9Qlzgd/XpK46VawwrIRAX ys9Kxv4FG94uARM9v4yGQ0Tiirar6lsn0tKwrbzfKYw84jhs0nShjcfx9tIbeljJH6+p roFSR6yvGg5AhtrQYOeQBK4H0UuapswJOl5U4FbLqv42bWcAtuhIWnyRVFNBJ4WTI0td gYQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=gaFrwClPngI9/zE0tUKh4ZF3uG/AFy0qWp2ynKlaVw4=; fh=xrvvRixrF/8Z1R/+XbySbbnjlXpu3wI25AtbEYEZtZY=; b=tRacxuT5uDbm3l0Y0TBHXA8DnXJXudN/6zZNgFHdmrQUeKBY78iW65m4il8PPp8uv9 Zx0Fj8BmkWjFip5VC1mZ+B3ANOYH94QaywhGFJt/JtU3vkKFozg/XEUoKb/A8xysRQF0 2p2xL4gGzFJyXuykSjG2gzOM5VpbGDvQO0gKeahG6VcuEnTCzOhqJ9gmVurtZJYW6CuY MKg80Haf0yQGI5AEoQrrMJkWroM2RdGh1kgqGc6Qmwd6TUX0acdjRPXuMm4oQUCcRQ/1 tyNkZ6CEi1YlfMDmYXGtWHj0SU+6zwIjJHf2Tf+Z/GmYYXSuHcBNZBYXoLBm2zW/TLxk NgPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=yBxxYVQ5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hTuKFvG7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=elXsFP10; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-139140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139140-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k18-20020a05620a0b9200b00789ea463f58si12337632qkh.191.2024.04.10.10.49.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 10:49:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=yBxxYVQ5; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=hTuKFvG7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=elXsFP10; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-139140-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139140-linux.lists.archive=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4088B1C22BE1 for ; Wed, 10 Apr 2024 17:49:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34C6E1A0B07; Wed, 10 Apr 2024 17:45:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="yBxxYVQ5"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="wcXOFf+8"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="hTuKFvG7"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="elXsFP10" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 0F42F194C9B; Wed, 10 Apr 2024 17:45:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771109; cv=none; b=CKn3fOrCNwA6YWy7+Q9pMhEzHj6uEK8qH7pVEi3VdGuJo7yqt/GtsTz7KxzumxiS5rD7QYyO44jNpJPbCFLKBiA7JW9+uETRG1c23McDsU38hJA4wDIc5b9COKWYEKL0aM8rHYfYFsLzufvTRz5KRnYGWeI5nR/i9h5nHHPvoss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712771109; c=relaxed/simple; bh=FfbM6dBK2mr783lz2Tf1oTCDjUnulOUEAmCPb7EW5VM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EVhfzyIvjTg3zPUrTr2bhwuR+ZjNqdJ2+0Gk2xyvaXckh7VbS7Nzv8guE70sN231L64WPu1ypVkzatK/MmqsBlA3tvicCUyZ0g9bEp3KyfKf2Qlwbg2sJlm4ECsLVBviyf0klnDLOOcuM8B/caDmtBWtiYeMglUhdqg/hcE65E8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=yBxxYVQ5; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=wcXOFf+8; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=hTuKFvG7; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=elXsFP10; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E2696205D3; Wed, 10 Apr 2024 17:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712771105; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gaFrwClPngI9/zE0tUKh4ZF3uG/AFy0qWp2ynKlaVw4=; b=yBxxYVQ5qlkPxthan7rOZuqjvdWMlGiSEckUBrhGCntgkxyBe3cH6Ca8fevLcFoHomITZe GDShA6eK07x/fuR/cCKQCz9o1H2C4pSgFxoHQfFbh6Ty4vOurIPSuL+JlC00mbz+3ABl9L /Rto2067OhB/bbb+TJMGwpWTA9UqGSM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712771105; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gaFrwClPngI9/zE0tUKh4ZF3uG/AFy0qWp2ynKlaVw4=; b=wcXOFf+8TTqZkLO7ZAhXTaXf3LTZxdBgkYcJdIsbyfKZFrJ17TDcW2kx+A7ppzhqACHlAU PPHEyqM26cUBTBDQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1712771103; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gaFrwClPngI9/zE0tUKh4ZF3uG/AFy0qWp2ynKlaVw4=; b=hTuKFvG7HdUAjobTA8wbNFYw60I0pmphQSN0CmvsMdtMGMFYFXdR0htXCBrBVrI4cFBFkw S8vHT8ZXd/VMO5YXqB8Q+5TknHMO3o+n3q080BriaRpBvbFfQAQeuYpN89CAkxmovsePsW TbuHCdx83Zr++KxAycUsj31w5E8JkAY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1712771103; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gaFrwClPngI9/zE0tUKh4ZF3uG/AFy0qWp2ynKlaVw4=; b=elXsFP10Kw0MWNWMmYdgHRNgO7EAK34dkQ60DZwM9dLMUhg3O251X/W6J7IptLR/IlRGjv goedGCkJGw7ylaBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D458E13691; Wed, 10 Apr 2024 17:45:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id s0yPMx/QFmYTXAAAD6G6ig (envelope-from ); Wed, 10 Apr 2024 17:45:03 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 73BD9A0681; Wed, 10 Apr 2024 19:45:03 +0200 (CEST) Date: Wed, 10 Apr 2024 19:45:03 +0200 From: Jan Kara To: Colin Ian King Cc: Alexander Viro , Christian Brauner , Jan Kara , linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] fs/direct-io: remove redundant assignment to variable retval Message-ID: <20240410174503.wycdhqsglx4pms4q@quack3> References: <20240410162221.292485-1-colin.i.king@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: <20240410162221.292485-1-colin.i.king@gmail.com> X-Spam-Level: X-Spamd-Result: default: False [-1.65 / 50.00]; BAYES_HAM(-2.35)[96.99%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCVD_COUNT_THREE(0.00)[3]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_RCPT(0.00)[]; MISSING_XM_UA(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.cz:email] X-Spam-Score: -1.65 X-Spam-Flag: NO On Wed 10-04-24 17:22:21, Colin Ian King wrote: > The variable retval is being assigned a value that is not being read, > it is being re-assigned later on in the function. The assignment > is redundant and can be removed. > > Cleans up clang scan build warning: > fs/direct-io.c:1220:2: warning: Value stored to 'retval' is never > read [deadcode.DeadStores] > > Signed-off-by: Colin Ian King Indeed it's assigned a few lines below. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/direct-io.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/direct-io.c b/fs/direct-io.c > index 62c97ff9e852..b0aafe640fa4 100644 > --- a/fs/direct-io.c > +++ b/fs/direct-io.c > @@ -1217,7 +1217,6 @@ ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode, > */ > inode_dio_begin(inode); > > - retval = 0; > sdio.blkbits = blkbits; > sdio.blkfactor = i_blkbits - blkbits; > sdio.block_in_file = offset >> blkbits; > -- > 2.39.2 > -- Jan Kara SUSE Labs, CR