From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:54433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Njs-0003Dn-PR for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Njq-0005J0-Uv for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:25:20 -0400 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]:43098) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3Njp-0005H2-Iv for qemu-devel@nongnu.org; Mon, 11 Mar 2019 12:25:17 -0400 Received: by mail-oi1-x232.google.com with SMTP id i8so4126586oib.10 for ; Mon, 11 Mar 2019 09:25:17 -0700 (PDT) MIME-Version: 1.0 References: <20190307095441.31921-1-kraxel@redhat.com> <20190307095441.31921-4-kraxel@redhat.com> In-Reply-To: From: Peter Maydell Date: Mon, 11 Mar 2019 16:25:05 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH] usb-mtp: fix return status of delete List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bandan Das Cc: Gerd Hoffmann , QEMU Developers On Mon, 11 Mar 2019 at 16:14, Bandan Das wrote: > > Peter Maydell writes: > > At the moment PARTIAL_DELETE is "ALL_DELETE | READ_ONLY", which > > doesn't seem like it makes much sense. > > > > Sorry, can you please clarify what doesn't make sense ? Generally, if you have multiple bits X, Y in a return value, they should be independent. Sometimes we define a convenience value Z that's X | Y, but then Z should have a name that indicates that it's really doing both X and Y (for instance often a READWRITE constant will be READ | WRITE). In this case, I don't see why PARTIAL_DELETE would be a sensible name to indicate "both ALL_DELETE and also READ_ONLY" -- if we only partially did a delete why do we set the ALL_DELETE bit ? It might be useful to take a step back -- what are the different possible outcomes from this function that we need to distinguish, and when should we be returning which outcome? thanks -- PMM