[lkml]   [2009]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] strstrip incorrectly marked __must_check
    On Tue, 03 Nov 2009 12:38:08 -0600
    James Bottomley <> wrote:

    > strstrip strips whitespace from the beginning and end of a string. I
    > agree you have to take the returned pointer if you want to strip from
    > the beginning. However, if you wish to keep the whitespace at the
    > beginning and only wish strstrip to remove it from the end, then it's
    > entirely legitimate to discard the returned pointer.
    > This is what we have in drivers/scsi/ipr.c and the patch to make
    > strstrip __must_check is now causing SCSI spurious warnings in that
    > code.

    Would prefer to keep the warning and to patch ipr.c, please. We found
    I think three call sites which were incorrectly ignoring the strstrip()
    return value and it's reasonable to fear that others will make the same
    mistake in the future.

    And maybe ipr.c _should_ be patched. Right now it's assuming that the
    string coming back from the device has no leading whitespace. Why trim
    any possible trailing whitespace but not trim any possible leading


    * Comment goes here
    static inline void strsrip_tail(char *str)
    char *x __used;
    x = strstrip(str);

     \ /
      Last update: 2009-11-03 20:03    [W:0.022 / U:37.096 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site