Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754688Ab1EDPEH (ORCPT ); Wed, 4 May 2011 11:04:07 -0400 Received: from mail-yi0-f46.google.com ([209.85.218.46]:64575 "EHLO mail-yi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754571Ab1EDPEE (ORCPT ); Wed, 4 May 2011 11:04:04 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=maza3d0xIlpUMTf/LmzKIkAsyhDYxTrThdekvYZhIqQ7s8urnyY07I6FADMM4tSimJ YcPYDpCTalWtI07HNzQLhKCSRdZdUSADhztTPq8e6FTQwQmgkfNHs6Qhzq6B/ljN2Hgw eQfq6gtQ5Uk4wdcoLdRlShjUJGcVS9zznPotg= MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 4 May 2011 16:04:03 +0100 Message-ID: Subject: Re: [PATCH] usb: gadget: f_mass_storage: Remove the LUN check which is always true From: Maxin John To: Michal Nazarewicz Cc: gregkh@suse.de, stern@rowland.harvard.edu, m-sonasath@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, roger.quadros@nokia.com Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1228 Lines: 33 Hi Michal, > Acked-by: Michal Nazarewicz Thank you very much for reviewing the patch. > file_storage.c has the same check, could you remove it as well. Please find the patch for "file_storage.c" below. Should I merge these two patches and re-submit as a single one? Signed-off-by: Maxin B. John --- diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index a6eacb5..a9c5177 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -2314,7 +2314,7 @@ static int check_command(struct fsg_dev *fsg, int cmnd_size, fsg->lun = lun; // Use LUN from the command /* Check the LUN */ - if (fsg->lun >= 0 && fsg->lun < fsg->nluns) { + if (fsg->lun < fsg->nluns) { fsg->curlun = curlun = &fsg->luns[fsg->lun]; if (fsg->cmnd[0] != REQUEST_SENSE) { curlun->sense_data = SS_NO_SENSE; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/